MobilityDB  1.0
postgis.h
Go to the documentation of this file.
1 /*****************************************************************************
2  *
3  * This MobilityDB code is provided under The PostgreSQL License.
4  *
5  * Copyright (c) 2016-2021, Université libre de Bruxelles and MobilityDB
6  * contributors
7  *
8  * Permission to use, copy, modify, and distribute this software and its
9  * documentation for any purpose, without fee, and without a written
10  * agreement is hereby granted, provided that the above copyright notice and
11  * this paragraph and the following two paragraphs appear in all copies.
12  *
13  * IN NO EVENT SHALL UNIVERSITE LIBRE DE BRUXELLES BE LIABLE TO ANY PARTY FOR
14  * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING
15  * LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION,
16  * EVEN IF UNIVERSITE LIBRE DE BRUXELLES HAS BEEN ADVISED OF THE POSSIBILITY
17  * OF SUCH DAMAGE.
18  *
19  * UNIVERSITE LIBRE DE BRUXELLES SPECIFICALLY DISCLAIMS ANY WARRANTIES,
20  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
21  * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON
22  * AN "AS IS" BASIS, AND UNIVERSITE LIBRE DE BRUXELLES HAS NO OBLIGATIONS TO
23  * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. 
24  *
25  *****************************************************************************/
26 
33 #ifndef __POSTGIS_H__
34 #define __POSTGIS_H__
35 
36 #include <postgres.h>
37 #include <fmgr.h>
38 
39 #include <liblwgeom.h>
40 #if POSTGIS_VERSION_NUMBER >= 30000
41 #include <lwgeodetic_tree.h>
42 #endif
43 
44 /*****************************************************************************
45  * Definitions needed for PostGIS 2.5.5 since they are not exported in
46  * library liblwgeom
47  *****************************************************************************/
48 #if POSTGIS_VERSION_NUMBER < 30000
49 
50 /* Definitions needed for developing geography_line_interpolate_point */
51 
55 #define deg2rad(d) (M_PI * (d) / 180.0)
56 #define rad2deg(r) (180.0 * (r) / M_PI)
57 
61 typedef struct
62 {
63  double lon;
64  double lat;
66 
70 typedef struct
71 {
75 
76 extern int spheroid_init_from_srid(FunctionCallInfo fcinfo, int srid, SPHEROID *s);
77 extern double ptarray_length_spheroid(const POINTARRAY *pa, const SPHEROID *s);
78 extern int lwline_is_empty(const LWLINE *line);
79 extern void geographic_point_init(double lon, double lat, GEOGRAPHIC_POINT *g);
80 extern double sphere_distance(const GEOGRAPHIC_POINT *s, const GEOGRAPHIC_POINT *e);
81 extern void geog2cart(const GEOGRAPHIC_POINT *g, POINT3D *p);
82 extern void cart2geog(const POINT3D *p, GEOGRAPHIC_POINT *g);
83 extern void normalize(POINT3D *p);
85  const GEOGRAPHIC_POINT *p);
86 extern double edge_distance_to_point(const GEOGRAPHIC_EDGE *e,
87  const GEOGRAPHIC_POINT *gp, GEOGRAPHIC_POINT *closest);
88 extern uint32_t edge_intersects(const POINT3D *A1, const POINT3D *A2,
89  const POINT3D *B1, const POINT3D *B2);
90 extern int edge_intersection(const GEOGRAPHIC_EDGE *e1, const GEOGRAPHIC_EDGE *e2,
91  GEOGRAPHIC_POINT *g);
92 extern double edge_distance_to_edge(const GEOGRAPHIC_EDGE *e1, const GEOGRAPHIC_EDGE *e2,
93  GEOGRAPHIC_POINT *closest1, GEOGRAPHIC_POINT *closest2);
94 
95 /* Definitions copied from gserialized_gist.h */
96 
97 #define POSTGIS_FREE_IF_COPY_P(ptrsrc, ptrori) \
98  do { \
99  if ((Pointer) (ptrsrc) != (Pointer) (ptrori)) \
100  pfree(ptrsrc); \
101  } while (0)
102 
103 /* Definitions copied from measures.h */
104 
105 #define DIST_MAX -1
106 #define DIST_MIN 1
107 
108 typedef struct
109 {
110  double distance; /*the distance between p1 and p2*/
111  POINT2D p1;
112  POINT2D p2;
113  int mode; /*the direction of looking, if thedir = -1 then we look for maxdistance and if it is 1 then we look for mindistance*/
114  int twisted; /*To preserve the order of incoming points to match the first and second point in shortest and longest line*/
115  double tolerance; /*the tolerance for dwithin and dfullywithin*/
116 } DISTPTS;
117 
118 extern int lw_dist2d_recursive(const LWGEOM *lw1, const LWGEOM *lw2, DISTPTS *dl);
119 
120 /* Finds the two closest points and distance between two linesegments */
121 extern int lw_dist2d_seg_seg(const POINT2D *A, const POINT2D *B, const POINT2D *C, const POINT2D *D, DISTPTS *dl);
122 
123 /* Definitions copied from measures3d.h */
124 
125 typedef struct
126 {
127  double distance; /*the distance between p1 and p2*/
128  POINT3DZ p1;
129  POINT3DZ p2;
130  int mode; /*the direction of looking, if thedir = -1 then we look for 3dmaxdistance and if it is 1 then we look for 3dmindistance*/
131  int twisted; /*To preserve the order of incoming points to match the first and second point in 3dshortest and 3dlongest line*/
132  double tolerance; /*the tolerance for 3ddwithin and 3ddfullywithin*/
133 } DISTPTS3D;
134 
135 typedef struct
136 {
137  double x,y,z;
138 }
139 VECTOR3D;
140 
141 #define DOT(u,v) ((u).x * (v).x + (u).y * (v).y + (u).z * (v).z)
142 #define VECTORLENGTH(v) sqrt(((v).x * (v).x) + ((v).y * (v).y) + ((v).z * (v).z))
143 
144 extern int lw_dist3d_pt_pt(POINT3DZ *p1, POINT3DZ *p2, DISTPTS3D *dl);
145 extern int lw_dist3d_pt_seg(POINT3DZ *p, POINT3DZ *A, POINT3DZ *B, DISTPTS3D *dl);
146 extern int lw_dist3d_recursive(const LWGEOM *lwg1,const LWGEOM *lwg2, DISTPTS3D *dl);
147 
148 /* Finds the two closest points and distance between two linesegments */
149 extern int lw_dist3d_seg_seg(POINT3DZ *s1p1, POINT3DZ *s1p2, POINT3DZ *s2p1, POINT3DZ *s2p2, DISTPTS3D *dl);
150 
151 /* Definitions copied from lwgeodetic.h */
152 
156 #define PIR_NO_INTERACT 0x00
157 #define PIR_INTERSECTS 0x01
158 #define PIR_COLINEAR 0x02
159 #define PIR_A_TOUCH_RIGHT 0x04
160 #define PIR_A_TOUCH_LEFT 0x08
161 #define PIR_B_TOUCH_RIGHT 0x10
162 #define PIR_B_TOUCH_LEFT 0x20
163 
164 extern double spheroid_distance(const GEOGRAPHIC_POINT *a, const GEOGRAPHIC_POINT *b, const SPHEROID *spheroid);
165 extern int geographic_point_equals(const GEOGRAPHIC_POINT *g1, const GEOGRAPHIC_POINT *g2);
166 
167 /* Definitions copied from lwgeodetic_tree.h */
168 
169 typedef struct circ_node
170 {
172  double radius;
173  uint32_t num_nodes;
174  struct circ_node** nodes;
175  int edge_num;
176  uint32_t geom_type;
177  double d;
178  POINT2D pt_outside;
179  POINT2D* p1;
180  POINT2D* p2;
181 } CIRC_NODE;
182 
183 extern CIRC_NODE* lwgeom_calculate_circ_tree(const LWGEOM* lwgeom);
184 extern void circ_tree_free(CIRC_NODE* node);
185 
186 /* Definitions copied from liblwgeom_internal.h */
187 
191 #define FP_TOLERANCE 1e-12
192 #define FP_IS_ZERO(A) (fabs(A) <= FP_TOLERANCE)
193 #define FP_MAX(A, B) (((A) > (B)) ? (A) : (B))
194 #define FP_MIN(A, B) (((A) < (B)) ? (A) : (B))
195 #define FP_ABS(a) ((a) < (0) ? -(a) : (a))
196 #define FP_EQUALS(A, B) (fabs((A)-(B)) <= FP_TOLERANCE)
197 #define FP_NEQUALS(A, B) (fabs((A)-(B)) > FP_TOLERANCE)
198 #define FP_LT(A, B) (((A) + FP_TOLERANCE) < (B))
199 #define FP_LTEQ(A, B) (((A) - FP_TOLERANCE) <= (B))
200 #define FP_GT(A, B) (((A) - FP_TOLERANCE) > (B))
201 #define FP_GTEQ(A, B) (((A) + FP_TOLERANCE) >= (B))
202 #define FP_CONTAINS_TOP(A, X, B) (FP_LT(A, X) && FP_LTEQ(X, B))
203 #define FP_CONTAINS_BOTTOM(A, X, B) (FP_LTEQ(A, X) && FP_LT(X, B))
204 #define FP_CONTAINS_INCL(A, X, B) (FP_LTEQ(A, X) && FP_LTEQ(X, B))
205 #define FP_CONTAINS_EXCL(A, X, B) (FP_LT(A, X) && FP_LT(X, B))
206 #define FP_CONTAINS(A, X, B) FP_CONTAINS_EXCL(A, X, B)
207 
211 typedef struct gridspec_t
212 {
213  double ipx;
214  double ipy;
215  double ipz;
216  double ipm;
217  double xsize;
218  double ysize;
219  double zsize;
220  double msize;
221 }
222 gridspec;
223 
224 extern int p4d_same(const POINT4D *p1, const POINT4D *p2);
225 extern int p3d_same(const POINT3D *p1, const POINT3D *p2);
226 extern int p2d_same(const POINT2D *p1, const POINT2D *p2);
227 
228 /* Other functions needed: TODO determine where they came from */
229 
230 extern void srid_is_latlong(FunctionCallInfo fcinfo, int srid);
231 extern int clamp_srid(int srid);
232 extern int getSRIDbySRS(FunctionCallInfo fcinfo, const char *srs);
233 
234 extern char *getSRSbySRID(FunctionCallInfo fcinfo, int32_t srid, bool short_crs);
235 
236 extern int lwprint_double(double d, int maxdd, char *buf, size_t bufsize);
237 extern char getMachineEndian(void);
238 extern char lwpoint_same(const LWPOINT *p1, const LWPOINT *p2);
239 extern LWPOINT *lwpoint_clone(const LWPOINT *lwgeom);
240 
241 #endif
242 /*****************************************************************************
243  * End of definitions needed for PostGIS 2.5.5
244  *****************************************************************************/
245 
246 #if POSTGIS_VERSION_NUMBER >= 30000
247 int32_t getSRIDbySRS(FunctionCallInfo fcinfo, const char *srs);
248 char *getSRSbySRID(FunctionCallInfo fcinfo, int32_t srid, bool short_crs);
249 #endif
250 
251 /* PostGIS functions called by MobilityDB */
252 
253 extern Datum transform(PG_FUNCTION_ARGS);
254 extern Datum buffer(PG_FUNCTION_ARGS);
255 extern Datum centroid(PG_FUNCTION_ARGS);
256 
257 extern Datum geography_from_geometry(PG_FUNCTION_ARGS);
258 extern Datum geometry_from_geography(PG_FUNCTION_ARGS);
259 
260 extern Datum boundary(PG_FUNCTION_ARGS);
261 extern Datum contains(PG_FUNCTION_ARGS);
262 extern Datum containsproperly(PG_FUNCTION_ARGS);
263 extern Datum covers(PG_FUNCTION_ARGS);
264 extern Datum coveredby(PG_FUNCTION_ARGS);
265 extern Datum crosses(PG_FUNCTION_ARGS);
266 extern Datum disjoint(PG_FUNCTION_ARGS);
267 extern Datum issimple(PG_FUNCTION_ARGS);
268 extern Datum overlaps(PG_FUNCTION_ARGS);
269 extern Datum pgis_union_geometry_array(PG_FUNCTION_ARGS);
270 extern Datum relate_full(PG_FUNCTION_ARGS);
271 extern Datum relate_pattern(PG_FUNCTION_ARGS);
272 extern Datum touches(PG_FUNCTION_ARGS);
273 extern Datum within(PG_FUNCTION_ARGS);
274 
275 extern Datum ST_Equals(PG_FUNCTION_ARGS);
276 #if POSTGIS_VERSION_NUMBER < 30000
277 extern Datum distance(PG_FUNCTION_ARGS); /* For 2D */
278 extern Datum distance3d(PG_FUNCTION_ARGS); /* For 3D */
279 extern Datum intersection(PG_FUNCTION_ARGS);
280 extern Datum intersects(PG_FUNCTION_ARGS); /* For 2D */
281 extern Datum intersects3d(PG_FUNCTION_ARGS); /* For 3D */
282 #else
283 extern Datum ST_Distance(PG_FUNCTION_ARGS); /* For 2D */
284 extern Datum ST_3DDistance(PG_FUNCTION_ARGS); /* For 3D */
285 extern Datum ST_Intersection(PG_FUNCTION_ARGS);
286 extern Datum ST_Intersects(PG_FUNCTION_ARGS); /* For 2D */
287 extern Datum ST_3DIntersects(PG_FUNCTION_ARGS); /* For 2D */
288 #endif
289 
290 extern Datum BOX2D_to_LWGEOM(PG_FUNCTION_ARGS);
291 extern Datum BOX3D_to_LWGEOM(PG_FUNCTION_ARGS);
292 
293 extern Datum LWGEOM_addpoint(PG_FUNCTION_ARGS);
294 extern Datum LWGEOM_azimuth(PG_FUNCTION_ARGS);
295 extern Datum LWGEOM_closestpoint(PG_FUNCTION_ARGS); /* For 2D */
296 extern Datum LWGEOM_closestpoint3d(PG_FUNCTION_ARGS); /* For 3D */
297 extern Datum LWGEOM_collect_garray(PG_FUNCTION_ARGS);
298 extern Datum LWGEOM_dwithin(PG_FUNCTION_ARGS); /* For 2D */
299 extern Datum LWGEOM_dwithin3d(PG_FUNCTION_ARGS); /* For 3D */
300 extern Datum LWGEOM_geometryn_collection(PG_FUNCTION_ARGS);
301 extern Datum LWGEOM_get_srid(PG_FUNCTION_ARGS); /* also for geography */
302 extern Datum LWGEOM_set_srid(PG_FUNCTION_ARGS);
303 extern Datum LWGEOM_isempty(PG_FUNCTION_ARGS);
304 extern Datum LWGEOM_length_linestring(PG_FUNCTION_ARGS);
305 extern Datum LWGEOM_line_locate_point(PG_FUNCTION_ARGS);
306 extern Datum LWGEOM_line_interpolate_point(PG_FUNCTION_ARGS);
307 extern Datum LWGEOM_line_substring(PG_FUNCTION_ARGS);
308 extern Datum LWGEOM_makepoint(PG_FUNCTION_ARGS);
309 extern Datum LWGEOM_numgeometries_collection(PG_FUNCTION_ARGS);
310 extern Datum LWGEOM_numpoints_linestring(PG_FUNCTION_ARGS);
311 extern Datum LWGEOM_pointn_linestring(PG_FUNCTION_ARGS);
312 extern Datum LWGEOM_reverse(PG_FUNCTION_ARGS);
313 extern Datum LWGEOM_setpoint_linestring(PG_FUNCTION_ARGS);
314 extern Datum LWGEOM_shortestline2d(PG_FUNCTION_ARGS); /* For 2D */
315 extern Datum LWGEOM_shortestline3d(PG_FUNCTION_ARGS); /* For 3D */
316 
317 extern Datum lwgeom_eq(PG_FUNCTION_ARGS);
318 extern Datum lwgeom_lt(PG_FUNCTION_ARGS);
319 extern Datum lwgeom_hash(PG_FUNCTION_ARGS);
320 
321 extern Datum geography_covers(PG_FUNCTION_ARGS);
322 extern Datum geography_length(PG_FUNCTION_ARGS);
323 extern Datum geography_dwithin(PG_FUNCTION_ARGS);
324 extern Datum geography_distance(PG_FUNCTION_ARGS);
325 extern Datum geography_azimuth(PG_FUNCTION_ARGS);
326 extern Datum geography_bestsrid(PG_FUNCTION_ARGS);
327 
328 extern Datum geography_eq(PG_FUNCTION_ARGS);
329 extern Datum geography_lt(PG_FUNCTION_ARGS);
330 
331 #define PG_GETARG_GSERIALIZED_P(varno) ((GSERIALIZED *)PG_DETOAST_DATUM(PG_GETARG_DATUM(varno)))
332 #define PG_GETARG_GSERIALIZED_P_COPY(varno) ((GSERIALIZED *)PG_DETOAST_DATUM_COPY(PG_GETARG_DATUM(varno)))
333 
334 #include "general/temporal.h"
335 #include <liblwgeom.h>
336 
337 #endif /* __TEMPORAL_POSTGIS_H__ */
338 /*****************************************************************************/
double d
Definition: postgis.h:177
Datum buffer(PG_FUNCTION_ARGS)
Datum LWGEOM_collect_garray(PG_FUNCTION_ARGS)
Datum centroid(PG_FUNCTION_ARGS)
Definition: postgis.h:169
double distance
Definition: postgis.h:127
Datum overlaps(PG_FUNCTION_ARGS)
Datum intersects3d(PG_FUNCTION_ARGS)
double lon
Definition: postgis.h:63
Definition: postgis.h:135
Two-point great circle segment from a to b.
Definition: postgis.h:70
double ipx
Definition: postgis.h:213
int lw_dist3d_pt_seg(POINT3DZ *p, POINT3DZ *A, POINT3DZ *B, DISTPTS3D *dl)
GEOGRAPHIC_POINT center
Definition: postgis.h:171
uint32_t num_nodes
Definition: postgis.h:173
uint32_t geom_type
Definition: postgis.h:176
double z
Definition: postgis.h:137
POINT3DZ p2
Definition: postgis.h:129
Datum intersects(PG_FUNCTION_ARGS)
POINT2D * p2
Definition: postgis.h:180
int mode
Definition: postgis.h:113
Datum transform(PG_FUNCTION_ARGS)
Datum LWGEOM_set_srid(PG_FUNCTION_ARGS)
double lat
Definition: postgis.h:64
POINT2D * p1
Definition: postgis.h:179
Datum ST_Equals(PG_FUNCTION_ARGS)
Datum LWGEOM_numgeometries_collection(PG_FUNCTION_ARGS)
void normalize(POINT3D *p)
uint32_t edge_intersects(const POINT3D *A1, const POINT3D *A2, const POINT3D *B1, const POINT3D *B2)
Datum LWGEOM_shortestline3d(PG_FUNCTION_ARGS)
char * getSRSbySRID(FunctionCallInfo fcinfo, int32_t srid, bool short_crs)
Datum lwgeom_lt(PG_FUNCTION_ARGS)
char lwpoint_same(const LWPOINT *p1, const LWPOINT *p2)
int edge_num
Definition: postgis.h:175
Datum BOX3D_to_LWGEOM(PG_FUNCTION_ARGS)
LWPOINT * lwpoint_clone(const LWPOINT *lwgeom)
Datum covers(PG_FUNCTION_ARGS)
double ipy
Definition: postgis.h:214
Datum LWGEOM_makepoint(PG_FUNCTION_ARGS)
Point in spherical coordinates on the world.
Definition: postgis.h:61
Definition: postgis.h:125
Datum containsproperly(PG_FUNCTION_ARGS)
Datum crosses(PG_FUNCTION_ARGS)
void geog2cart(const GEOGRAPHIC_POINT *g, POINT3D *p)
int lw_dist2d_recursive(const LWGEOM *lw1, const LWGEOM *lw2, DISTPTS *dl)
int lw_dist3d_pt_pt(POINT3DZ *p1, POINT3DZ *p2, DISTPTS3D *dl)
POINT3DZ p1
Definition: postgis.h:128
Datum distance(PG_FUNCTION_ARGS)
double spheroid_distance(const GEOGRAPHIC_POINT *a, const GEOGRAPHIC_POINT *b, const SPHEROID *spheroid)
Basic functions for temporal types of any subtype.
Datum LWGEOM_closestpoint(PG_FUNCTION_ARGS)
POINT2D p1
Definition: postgis.h:111
Datum LWGEOM_line_interpolate_point(PG_FUNCTION_ARGS)
Datum LWGEOM_azimuth(PG_FUNCTION_ARGS)
double zsize
Definition: postgis.h:219
double tolerance
Definition: postgis.h:115
int lwline_is_empty(const LWLINE *line)
Datum touches(PG_FUNCTION_ARGS)
Datum geography_dwithin(PG_FUNCTION_ARGS)
Datum LWGEOM_dwithin3d(PG_FUNCTION_ARGS)
Datum LWGEOM_get_srid(PG_FUNCTION_ARGS)
Datum issimple(PG_FUNCTION_ARGS)
int lw_dist2d_seg_seg(const POINT2D *A, const POINT2D *B, const POINT2D *C, const POINT2D *D, DISTPTS *dl)
Datum lwgeom_eq(PG_FUNCTION_ARGS)
double sphere_distance(const GEOGRAPHIC_POINT *s, const GEOGRAPHIC_POINT *e)
void circ_tree_free(CIRC_NODE *node)
Datum disjoint(PG_FUNCTION_ARGS)
void geographic_point_init(double lon, double lat, GEOGRAPHIC_POINT *g)
GEOGRAPHIC_POINT start
Definition: postgis.h:72
double edge_distance_to_point(const GEOGRAPHIC_EDGE *e, const GEOGRAPHIC_POINT *gp, GEOGRAPHIC_POINT *closest)
Datum intersection(PG_FUNCTION_ARGS)
Datum within(PG_FUNCTION_ARGS)
int twisted
Definition: postgis.h:131
Datum geometry_from_geography(PG_FUNCTION_ARGS)
struct circ_node CIRC_NODE
Datum geography_bestsrid(PG_FUNCTION_ARGS)
Datum contains(PG_FUNCTION_ARGS)
int p3d_same(const POINT3D *p1, const POINT3D *p2)
POINT2D p2
Definition: postgis.h:112
int lw_dist3d_recursive(const LWGEOM *lwg1, const LWGEOM *lwg2, DISTPTS3D *dl)
int mode
Definition: postgis.h:130
int p4d_same(const POINT4D *p1, const POINT4D *p2)
GEOGRAPHIC_POINT end
Definition: postgis.h:73
Datum geography_eq(PG_FUNCTION_ARGS)
Datum LWGEOM_isempty(PG_FUNCTION_ARGS)
Datum geography_lt(PG_FUNCTION_ARGS)
Datum LWGEOM_line_locate_point(PG_FUNCTION_ARGS)
Datum LWGEOM_reverse(PG_FUNCTION_ARGS)
int edge_contains_coplanar_point(const GEOGRAPHIC_EDGE *e, const GEOGRAPHIC_POINT *p)
Datum boundary(PG_FUNCTION_ARGS)
Datum LWGEOM_pointn_linestring(PG_FUNCTION_ARGS)
int twisted
Definition: postgis.h:114
Datum geography_distance(PG_FUNCTION_ARGS)
int lw_dist3d_seg_seg(POINT3DZ *s1p1, POINT3DZ *s1p2, POINT3DZ *s2p1, POINT3DZ *s2p2, DISTPTS3D *dl)
Datum LWGEOM_line_substring(PG_FUNCTION_ARGS)
CIRC_NODE * lwgeom_calculate_circ_tree(const LWGEOM *lwgeom)
double msize
Definition: postgis.h:220
int edge_intersection(const GEOGRAPHIC_EDGE *e1, const GEOGRAPHIC_EDGE *e2, GEOGRAPHIC_POINT *g)
int getSRIDbySRS(FunctionCallInfo fcinfo, const char *srs)
Datum relate_pattern(PG_FUNCTION_ARGS)
Datum LWGEOM_geometryn_collection(PG_FUNCTION_ARGS)
double tolerance
Definition: postgis.h:132
Datum BOX2D_to_LWGEOM(PG_FUNCTION_ARGS)
double ysize
Definition: postgis.h:218
double distance
Definition: postgis.h:110
Datum LWGEOM_addpoint(PG_FUNCTION_ARGS)
int geographic_point_equals(const GEOGRAPHIC_POINT *g1, const GEOGRAPHIC_POINT *g2)
int clamp_srid(int srid)
void cart2geog(const POINT3D *p, GEOGRAPHIC_POINT *g)
Datum lwgeom_hash(PG_FUNCTION_ARGS)
POINT2D pt_outside
Definition: postgis.h:178
Datum LWGEOM_shortestline2d(PG_FUNCTION_ARGS)
int p2d_same(const POINT2D *p1, const POINT2D *p2)
Datum LWGEOM_closestpoint3d(PG_FUNCTION_ARGS)
void srid_is_latlong(FunctionCallInfo fcinfo, int srid)
Datum LWGEOM_setpoint_linestring(PG_FUNCTION_ARGS)
Datum geography_azimuth(PG_FUNCTION_ARGS)
double edge_distance_to_edge(const GEOGRAPHIC_EDGE *e1, const GEOGRAPHIC_EDGE *e2, GEOGRAPHIC_POINT *closest1, GEOGRAPHIC_POINT *closest2)
double radius
Definition: postgis.h:172
Datum LWGEOM_numpoints_linestring(PG_FUNCTION_ARGS)
Datum geography_length(PG_FUNCTION_ARGS)
struct gridspec_t gridspec
Snap-to-grid Support.
Datum LWGEOM_dwithin(PG_FUNCTION_ARGS)
Datum distance3d(PG_FUNCTION_ARGS)
Datum coveredby(PG_FUNCTION_ARGS)
Definition: postgis.h:108
double xsize
Definition: postgis.h:217
Datum geography_from_geometry(PG_FUNCTION_ARGS)
Datum geography_covers(PG_FUNCTION_ARGS)
Datum pgis_union_geometry_array(PG_FUNCTION_ARGS)
Datum LWGEOM_length_linestring(PG_FUNCTION_ARGS)
char getMachineEndian(void)
double ptarray_length_spheroid(const POINTARRAY *pa, const SPHEROID *s)
double ipm
Definition: postgis.h:216
struct circ_node ** nodes
Definition: postgis.h:174
int lwprint_double(double d, int maxdd, char *buf, size_t bufsize)
Datum relate_full(PG_FUNCTION_ARGS)
int spheroid_init_from_srid(FunctionCallInfo fcinfo, int srid, SPHEROID *s)
double ipz
Definition: postgis.h:215
Snap-to-grid Support.
Definition: postgis.h:211