PostGIS  2.3.8dev-r@@SVN_REVISION@@
lwgeom_functions_basic.c File Reference
#include "postgres.h"
#include "fmgr.h"
#include "utils/elog.h"
#include "utils/array.h"
#include "utils/geo_decls.h"
#include "../postgis_config.h"
#include "liblwgeom.h"
#include "lwgeom_pg.h"
#include <math.h>
#include <float.h>
#include <string.h>
#include <stdio.h>
#include <errno.h>
Include dependency graph for lwgeom_functions_basic.c:

Go to the source code of this file.

Functions

Datum LWGEOM_mem_size (PG_FUNCTION_ARGS)
 
Datum LWGEOM_summary (PG_FUNCTION_ARGS)
 
Datum LWGEOM_npoints (PG_FUNCTION_ARGS)
 
Datum LWGEOM_nrings (PG_FUNCTION_ARGS)
 
Datum LWGEOM_area_polygon (PG_FUNCTION_ARGS)
 
Datum postgis_uses_stats (PG_FUNCTION_ARGS)
 
Datum postgis_autocache_bbox (PG_FUNCTION_ARGS)
 
Datum postgis_scripts_released (PG_FUNCTION_ARGS)
 
Datum postgis_version (PG_FUNCTION_ARGS)
 
Datum postgis_liblwgeom_version (PG_FUNCTION_ARGS)
 
Datum postgis_lib_version (PG_FUNCTION_ARGS)
 
Datum postgis_svn_version (PG_FUNCTION_ARGS)
 
Datum postgis_libxml_version (PG_FUNCTION_ARGS)
 
Datum postgis_lib_build_date (PG_FUNCTION_ARGS)
 
Datum LWGEOM_length2d_linestring (PG_FUNCTION_ARGS)
 
Datum LWGEOM_length_linestring (PG_FUNCTION_ARGS)
 
Datum LWGEOM_perimeter2d_poly (PG_FUNCTION_ARGS)
 
Datum LWGEOM_perimeter_poly (PG_FUNCTION_ARGS)
 
Datum LWGEOM_maxdistance2d_linestring (PG_FUNCTION_ARGS)
 
Datum LWGEOM_mindistance2d (PG_FUNCTION_ARGS)
 
Datum LWGEOM_closestpoint (PG_FUNCTION_ARGS)
 
Datum LWGEOM_shortestline2d (PG_FUNCTION_ARGS)
 
Datum LWGEOM_longestline2d (PG_FUNCTION_ARGS)
 
Datum LWGEOM_dwithin (PG_FUNCTION_ARGS)
 
Datum LWGEOM_dfullywithin (PG_FUNCTION_ARGS)
 
Datum LWGEOM_maxdistance3d (PG_FUNCTION_ARGS)
 
Datum LWGEOM_mindistance3d (PG_FUNCTION_ARGS)
 
Datum LWGEOM_closestpoint3d (PG_FUNCTION_ARGS)
 
Datum LWGEOM_shortestline3d (PG_FUNCTION_ARGS)
 
Datum LWGEOM_longestline3d (PG_FUNCTION_ARGS)
 
Datum LWGEOM_dwithin3d (PG_FUNCTION_ARGS)
 
Datum LWGEOM_dfullywithin3d (PG_FUNCTION_ARGS)
 
Datum LWGEOM_inside_circle_point (PG_FUNCTION_ARGS)
 
Datum LWGEOM_collect (PG_FUNCTION_ARGS)
 
Datum LWGEOM_collect_garray (PG_FUNCTION_ARGS)
 
Datum LWGEOM_expand (PG_FUNCTION_ARGS)
 
Datum LWGEOM_to_BOX (PG_FUNCTION_ARGS)
 
Datum LWGEOM_envelope (PG_FUNCTION_ARGS)
 
Datum LWGEOM_isempty (PG_FUNCTION_ARGS)
 
Datum LWGEOM_segmentize2d (PG_FUNCTION_ARGS)
 
Datum LWGEOM_reverse (PG_FUNCTION_ARGS)
 
Datum LWGEOM_force_clockwise_poly (PG_FUNCTION_ARGS)
 
Datum LWGEOM_force_sfs (PG_FUNCTION_ARGS)
 
Datum LWGEOM_noop (PG_FUNCTION_ARGS)
 
Datum LWGEOM_zmflag (PG_FUNCTION_ARGS)
 
Datum LWGEOM_hasz (PG_FUNCTION_ARGS)
 
Datum LWGEOM_hasm (PG_FUNCTION_ARGS)
 
Datum LWGEOM_ndims (PG_FUNCTION_ARGS)
 
Datum LWGEOM_makepoint (PG_FUNCTION_ARGS)
 
Datum LWGEOM_makepoint3dm (PG_FUNCTION_ARGS)
 
Datum LWGEOM_makeline_garray (PG_FUNCTION_ARGS)
 
Datum LWGEOM_makeline (PG_FUNCTION_ARGS)
 
Datum LWGEOM_makepoly (PG_FUNCTION_ARGS)
 
Datum LWGEOM_line_from_mpoint (PG_FUNCTION_ARGS)
 
Datum LWGEOM_addpoint (PG_FUNCTION_ARGS)
 
Datum LWGEOM_removepoint (PG_FUNCTION_ARGS)
 
Datum LWGEOM_setpoint_linestring (PG_FUNCTION_ARGS)
 
Datum LWGEOM_asEWKT (PG_FUNCTION_ARGS)
 
Datum LWGEOM_hasBBOX (PG_FUNCTION_ARGS)
 
Datum LWGEOM_azimuth (PG_FUNCTION_ARGS)
 
Datum LWGEOM_affine (PG_FUNCTION_ARGS)
 
Datum LWGEOM_longitude_shift (PG_FUNCTION_ARGS)
 
Datum optimistic_overlap (PG_FUNCTION_ARGS)
 
Datum ST_GeoHash (PG_FUNCTION_ARGS)
 
Datum ST_MakeEnvelope (PG_FUNCTION_ARGS)
 
Datum ST_CollectionExtract (PG_FUNCTION_ARGS)
 
Datum ST_CollectionHomogenize (PG_FUNCTION_ARGS)
 
Datum ST_IsCollection (PG_FUNCTION_ARGS)
 
Datum ST_WrapX (PG_FUNCTION_ARGS)
 
 PG_FUNCTION_INFO_V1 (LWGEOM_mem_size)
 find the size of geometry More...
 
 PG_FUNCTION_INFO_V1 (LWGEOM_summary)
 get summary info on a GEOMETRY More...
 
 PG_FUNCTION_INFO_V1 (postgis_version)
 
 PG_FUNCTION_INFO_V1 (postgis_liblwgeom_version)
 
 PG_FUNCTION_INFO_V1 (postgis_lib_version)
 
 PG_FUNCTION_INFO_V1 (postgis_svn_version)
 
 PG_FUNCTION_INFO_V1 (postgis_lib_build_date)
 
 PG_FUNCTION_INFO_V1 (postgis_scripts_released)
 
 PG_FUNCTION_INFO_V1 (postgis_uses_stats)
 
 PG_FUNCTION_INFO_V1 (postgis_autocache_bbox)
 
 PG_FUNCTION_INFO_V1 (postgis_libxml_version)
 
 PG_FUNCTION_INFO_V1 (LWGEOM_npoints)
 number of points in an object More...
 
 PG_FUNCTION_INFO_V1 (LWGEOM_nrings)
 number of rings in an object More...
 
 PG_FUNCTION_INFO_V1 (LWGEOM_area_polygon)
 Calculate the area of all the subobj in a polygon area(point) = 0 area (line) = 0 area(polygon) = find its 2d area. More...
 
 PG_FUNCTION_INFO_V1 (LWGEOM_length2d_linestring)
 find the "length of a geometry" length2d(point) = 0 length2d(line) = length of line length2d(polygon) = 0 – could make sense to return sum(ring perimeter) uses euclidian 2d length (even if input is 3d) More...
 
 PG_FUNCTION_INFO_V1 (LWGEOM_length_linestring)
 find the "length of a geometry" length(point) = 0 length(line) = length of line length(polygon) = 0 – could make sense to return sum(ring perimeter) uses euclidian 3d/2d length depending on input dimensions. More...
 
 PG_FUNCTION_INFO_V1 (LWGEOM_perimeter_poly)
 find the "perimeter of a geometry" perimeter(point) = 0 perimeter(line) = 0 perimeter(polygon) = sum of ring perimeters uses euclidian 3d/2d computation depending on input dimension. More...
 
 PG_FUNCTION_INFO_V1 (LWGEOM_perimeter2d_poly)
 find the "perimeter of a geometry" perimeter(point) = 0 perimeter(line) = 0 perimeter(polygon) = sum of ring perimeters uses euclidian 2d computation even if input is 3d More...
 
 PG_FUNCTION_INFO_V1 (LWGEOM_force_2d)
 
Datum LWGEOM_force_2d (PG_FUNCTION_ARGS)
 
 PG_FUNCTION_INFO_V1 (LWGEOM_force_3dz)
 
Datum LWGEOM_force_3dz (PG_FUNCTION_ARGS)
 
 PG_FUNCTION_INFO_V1 (LWGEOM_force_3dm)
 transform input geometry to 3dm if not 3dm already More...
 
Datum LWGEOM_force_3dm (PG_FUNCTION_ARGS)
 
 PG_FUNCTION_INFO_V1 (LWGEOM_force_4d)
 
Datum LWGEOM_force_4d (PG_FUNCTION_ARGS)
 
 PG_FUNCTION_INFO_V1 (LWGEOM_force_collection)
 transform input geometry to a collection type More...
 
Datum LWGEOM_force_collection (PG_FUNCTION_ARGS)
 
 PG_FUNCTION_INFO_V1 (LWGEOM_force_multi)
 transform input geometry to a multi* type More...
 
Datum LWGEOM_force_multi (PG_FUNCTION_ARGS)
 
 PG_FUNCTION_INFO_V1 (LWGEOM_force_curve)
 transform input geometry to a curved type More...
 
Datum LWGEOM_force_curve (PG_FUNCTION_ARGS)
 
 PG_FUNCTION_INFO_V1 (LWGEOM_force_sfs)
 transform input geometry to a SFS 1.1 geometry type compliant More...
 
 PG_FUNCTION_INFO_V1 (LWGEOM_closestpoint)
 Returns the point in first input geometry that is closest to the second input geometry in 2d. More...
 
 PG_FUNCTION_INFO_V1 (LWGEOM_shortestline2d)
 Returns the shortest 2d line between two geometries. More...
 
 PG_FUNCTION_INFO_V1 (LWGEOM_longestline2d)
 Returns the longest 2d line between two geometries. More...
 
 PG_FUNCTION_INFO_V1 (LWGEOM_mindistance2d)
 Minimum 2d distance between objects in geom1 and geom2. More...
 
 PG_FUNCTION_INFO_V1 (LWGEOM_dwithin)
 Returns boolean describing if mininimum 2d distance between objects in geom1 and geom2 is shorter than tolerance. More...
 
 PG_FUNCTION_INFO_V1 (LWGEOM_dfullywithin)
 Returns boolean describing if maximum 2d distance between objects in geom1 and geom2 is shorter than tolerance. More...
 
 PG_FUNCTION_INFO_V1 (LWGEOM_maxdistance2d_linestring)
 Maximum 2d distance between objects in geom1 and geom2. More...
 
 PG_FUNCTION_INFO_V1 (LWGEOM_closestpoint3d)
 Returns the point in first input geometry that is closest to the second input geometry in 3D. More...
 
 PG_FUNCTION_INFO_V1 (LWGEOM_shortestline3d)
 Returns the shortest line between two geometries in 3D. More...
 
 PG_FUNCTION_INFO_V1 (LWGEOM_longestline3d)
 Returns the longest line between two geometries in 3D. More...
 
 PG_FUNCTION_INFO_V1 (LWGEOM_mindistance3d)
 Minimum 2d distance between objects in geom1 and geom2 in 3D. More...
 
 PG_FUNCTION_INFO_V1 (LWGEOM_dwithin3d)
 Returns boolean describing if mininimum 3d distance between objects in geom1 and geom2 is shorter than tolerance. More...
 
 PG_FUNCTION_INFO_V1 (LWGEOM_dfullywithin3d)
 Returns boolean describing if maximum 3d distance between objects in geom1 and geom2 is shorter than tolerance. More...
 
 PG_FUNCTION_INFO_V1 (LWGEOM_maxdistance3d)
 Maximum 3d distance between objects in geom1 and geom2. More...
 
 PG_FUNCTION_INFO_V1 (LWGEOM_longitude_shift)
 
 PG_FUNCTION_INFO_V1 (ST_WrapX)
 
 PG_FUNCTION_INFO_V1 (LWGEOM_inside_circle_point)
 
 PG_FUNCTION_INFO_V1 (LWGEOM_collect)
 collect( geom, geom ) returns a geometry which contains all the sub_objects from both of the argument geometries More...
 
 PG_FUNCTION_INFO_V1 (LWGEOM_collect_garray)
 collect_garray ( GEOMETRY[] ) returns a geometry which contains all the sub_objects from all of the geometries in given array. More...
 
 PG_FUNCTION_INFO_V1 (LWGEOM_line_from_mpoint)
 LineFromMultiPoint ( GEOMETRY ) returns a LINE formed by all the points in the in given multipoint. More...
 
 PG_FUNCTION_INFO_V1 (LWGEOM_makeline_garray)
 makeline_garray ( GEOMETRY[] ) returns a LINE formed by all the point geometries in given array. More...
 
 PG_FUNCTION_INFO_V1 (LWGEOM_makeline)
 makeline ( GEOMETRY, GEOMETRY ) returns a LINESTRIN segment formed by the given point geometries. More...
 
 PG_FUNCTION_INFO_V1 (LWGEOM_makepoly)
 makepoly( GEOMETRY, GEOMETRY[] ) returns a POLYGON formed by the given shell and holes geometries. More...
 
 PG_FUNCTION_INFO_V1 (LWGEOM_expand)
 makes a polygon of the expanded features bvol - 1st point = LL 3rd=UR 2d only. More...
 
 PG_FUNCTION_INFO_V1 (LWGEOM_to_BOX)
 Convert geometry to BOX (internal postgres type) More...
 
 PG_FUNCTION_INFO_V1 (LWGEOM_envelope)
 makes a polygon of the features bvol - 1st point = LL 3rd=UR 2d only. More...
 
 PG_FUNCTION_INFO_V1 (LWGEOM_isempty)
 
 PG_FUNCTION_INFO_V1 (LWGEOM_segmentize2d)
 Returns a modified geometry so that no segment is longer then the given distance (computed using 2d). More...
 
 PG_FUNCTION_INFO_V1 (LWGEOM_reverse)
 Reverse vertex order of geometry. More...
 
 PG_FUNCTION_INFO_V1 (LWGEOM_force_clockwise_poly)
 Force polygons of the collection to obey Right-Hand-Rule. More...
 
 PG_FUNCTION_INFO_V1 (LWGEOM_noop)
 Test deserialize/serialize operations. More...
 
Datum ST_Normalize (PG_FUNCTION_ARGS)
 
 PG_FUNCTION_INFO_V1 (ST_Normalize)
 
 PG_FUNCTION_INFO_V1 (LWGEOM_zmflag)
 
 PG_FUNCTION_INFO_V1 (LWGEOM_hasz)
 
 PG_FUNCTION_INFO_V1 (LWGEOM_hasm)
 
 PG_FUNCTION_INFO_V1 (LWGEOM_hasBBOX)
 
 PG_FUNCTION_INFO_V1 (LWGEOM_ndims)
 Return: 2,3 or 4. More...
 
 PG_FUNCTION_INFO_V1 (LWGEOM_same)
 lwgeom_same(lwgeom1, lwgeom2) More...
 
Datum LWGEOM_same (PG_FUNCTION_ARGS)
 
 PG_FUNCTION_INFO_V1 (ST_MakeEnvelope)
 
 PG_FUNCTION_INFO_V1 (ST_IsCollection)
 
 PG_FUNCTION_INFO_V1 (LWGEOM_makepoint)
 
 PG_FUNCTION_INFO_V1 (LWGEOM_makepoint3dm)
 
 PG_FUNCTION_INFO_V1 (LWGEOM_addpoint)
 
 PG_FUNCTION_INFO_V1 (LWGEOM_removepoint)
 
 PG_FUNCTION_INFO_V1 (LWGEOM_setpoint_linestring)
 
 PG_FUNCTION_INFO_V1 (LWGEOM_asEWKT)
 
 PG_FUNCTION_INFO_V1 (LWGEOM_azimuth)
 Compute the azimuth of segment defined by the two given Point geometries. More...
 
 PG_FUNCTION_INFO_V1 (optimistic_overlap)
 
 PG_FUNCTION_INFO_V1 (LWGEOM_affine)
 
 PG_FUNCTION_INFO_V1 (ST_GeoHash)
 
 PG_FUNCTION_INFO_V1 (ST_CollectionExtract)
 
 PG_FUNCTION_INFO_V1 (ST_CollectionHomogenize)
 
Datum ST_RemoveRepeatedPoints (PG_FUNCTION_ARGS)
 
 PG_FUNCTION_INFO_V1 (ST_RemoveRepeatedPoints)
 
Datum ST_FlipCoordinates (PG_FUNCTION_ARGS)
 
 PG_FUNCTION_INFO_V1 (ST_FlipCoordinates)
 
static LWORD ordname2ordval (char n)
 
Datum ST_SwapOrdinates (PG_FUNCTION_ARGS)
 
 PG_FUNCTION_INFO_V1 (ST_SwapOrdinates)
 
Datum ST_BoundingDiagonal (PG_FUNCTION_ARGS)
 
 PG_FUNCTION_INFO_V1 (ST_BoundingDiagonal)
 
Datum ST_Scale (PG_FUNCTION_ARGS)
 
 PG_FUNCTION_INFO_V1 (ST_Scale)
 
Datum ST_Points (PG_FUNCTION_ARGS)
 
 PG_FUNCTION_INFO_V1 (ST_Points)