SpatiaLite  4.2.0
 All Data Structures Files Functions Variables Typedefs Macros Pages
gg_mbr.h
Go to the documentation of this file.
1 /*
2  gg_mbr.h -- Gaia common support for geometries: MBR functions
3 
4  version 4.2, 2014 July 25
5 
6  Author: Sandro Furieri a.furieri@lqt.it
7 
8  ------------------------------------------------------------------------------
9 
10  Version: MPL 1.1/GPL 2.0/LGPL 2.1
11 
12  The contents of this file are subject to the Mozilla Public License Version
13  1.1 (the "License"); you may not use this file except in compliance with
14  the License. You may obtain a copy of the License at
15  http://www.mozilla.org/MPL/
16 
17 Software distributed under the License is distributed on an "AS IS" basis,
18 WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
19 for the specific language governing rights and limitations under the
20 License.
21 
22 The Original Code is the SpatiaLite library
23 
24 The Initial Developer of the Original Code is Alessandro Furieri
25 
26 Portions created by the Initial Developer are Copyright (C) 2008-2013
27 the Initial Developer. All Rights Reserved.
28 
29 Contributor(s):
30 
31 
32 Alternatively, the contents of this file may be used under the terms of
33 either the GNU General Public License Version 2 or later (the "GPL"), or
34 the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
35 in which case the provisions of the GPL or the LGPL are applicable instead
36 of those above. If you wish to allow use of your version of this file only
37 under the terms of either the GPL or the LGPL, and not to allow others to
38 use your version of this file under the terms of the MPL, indicate your
39 decision by deleting the provisions above and replace them with the notice
40 and other provisions required by the GPL or the LGPL. If you do not delete
41 the provisions above, a recipient may use your version of this file under
42 the terms of any one of the MPL, the GPL or the LGPL.
43 
44 */
45 
46 
53 #ifndef _GG_MBR_H
54 #ifndef DOXYGEN_SHOULD_SKIP_THIS
55 #define _GG_MBR_H
56 #endif
57 
58 #ifdef __cplusplus
59 extern "C"
60 {
61 #endif
62 
63 /* function prototypes */
64 
70  GAIAGEO_DECLARE void gaiaMbrLinestring (gaiaLinestringPtr line);
71 
77  GAIAGEO_DECLARE void gaiaMbrRing (gaiaRingPtr rng);
78 
84  GAIAGEO_DECLARE void gaiaMbrPolygon (gaiaPolygonPtr polyg);
85 
91  GAIAGEO_DECLARE void gaiaMbrGeometry (gaiaGeomCollPtr geom);
92 
104  GAIAGEO_DECLARE int gaiaGetMbrMinX (const unsigned char *blob,
105  unsigned int size, double *minx);
106 
118  GAIAGEO_DECLARE int gaiaGetMbrMaxX (const unsigned char *blob,
119  unsigned int size, double *maxx);
120 
132  GAIAGEO_DECLARE int gaiaGetMbrMinY (const unsigned char *blob,
133  unsigned int size, double *miny);
134 
146  GAIAGEO_DECLARE int gaiaGetMbrMaxY (const unsigned char *blob,
147  unsigned int size, double *maxy);
148 
166  GAIAGEO_DECLARE gaiaGeomCollPtr gaiaFromSpatiaLiteBlobMbr (const unsigned
167  char *blob,
168  unsigned int
169  size);
170 
182  GAIAGEO_DECLARE int gaiaMbrsContains (gaiaGeomCollPtr mbr1,
183  gaiaGeomCollPtr mbr2);
184 
196  GAIAGEO_DECLARE int gaiaMbrsDisjoint (gaiaGeomCollPtr mbr1,
197  gaiaGeomCollPtr mbr2);
198 
210  GAIAGEO_DECLARE int gaiaMbrsEqual (gaiaGeomCollPtr mbr1,
211  gaiaGeomCollPtr mbr2);
212 
224  GAIAGEO_DECLARE int gaiaMbrsIntersects (gaiaGeomCollPtr mbr1,
225  gaiaGeomCollPtr mbr2);
226 
238  GAIAGEO_DECLARE int gaiaMbrsOverlaps (gaiaGeomCollPtr mbr1,
239  gaiaGeomCollPtr mbr2);
240 
252  GAIAGEO_DECLARE int gaiaMbrsTouches (gaiaGeomCollPtr mbr1,
253  gaiaGeomCollPtr mbr2);
254 
266  GAIAGEO_DECLARE int gaiaMbrsWithin (gaiaGeomCollPtr mbr1,
267  gaiaGeomCollPtr mbr2);
268 
289  GAIAGEO_DECLARE void gaiaBuildMbr (double x1, double y1, double x2,
290  double y2, int srid,
291  unsigned char **result, int *size);
292 
310  GAIAGEO_DECLARE void gaiaBuildCircleMbr (double x, double y, double radius,
311  int srid, unsigned char **result,
312  int *size);
313 
337  GAIAGEO_DECLARE void gaiaBuildFilterMbr (double x1, double y1, double x2,
338  double y2, int mode,
339  unsigned char **result, int *size);
340 
358  GAIAGEO_DECLARE int gaiaParseFilterMbr (unsigned char *result, int size,
359  double *minx, double *miny,
360  double *maxx, double *maxy,
361  int *mode);
362 
372  GAIAGEO_DECLARE void gaiaZRangeLinestring (gaiaLinestringPtr line,
373  double *min, double *max);
374 
384  GAIAGEO_DECLARE void gaiaZRangeRing (gaiaRingPtr rng, double *min,
385  double *max);
386 
396  GAIAGEO_DECLARE void gaiaZRangePolygon (gaiaPolygonPtr polyg, double *min,
397  double *max);
398 
408  GAIAGEO_DECLARE void gaiaZRangeGeometry (gaiaGeomCollPtr geom, double *min,
409  double *max);
410 
420  GAIAGEO_DECLARE void gaiaMRangeLinestring (gaiaLinestringPtr line,
421  double *min, double *max);
422 
432  GAIAGEO_DECLARE void gaiaMRangeRing (gaiaRingPtr rng, double *min,
433  double *max);
434 
444  GAIAGEO_DECLARE void gaiaMRangePolygon (gaiaPolygonPtr polyg, double *min,
445  double *max);
446 
456  GAIAGEO_DECLARE void gaiaMRangeGeometry (gaiaGeomCollPtr geom, double *min,
457  double *max);
458 
459 
460 #ifdef __cplusplus
461 }
462 #endif
463 
464 #endif /* _GG_MBR_H */
GAIAGEO_DECLARE void gaiaMRangePolygon(gaiaPolygonPtr polyg, double *min, double *max)
Computes the M-Range for a Polygon object.
GAIAGEO_DECLARE void gaiaZRangePolygon(gaiaPolygonPtr polyg, double *min, double *max)
Computes the Z-Range for a Polygon object.
GAIAGEO_DECLARE void gaiaMbrRing(gaiaRingPtr rng)
Updates the actual MBR for a Ring object.
GAIAGEO_DECLARE int gaiaMbrsIntersects(gaiaGeomCollPtr mbr1, gaiaGeomCollPtr mbr2)
MBRs comparison: Intersects.
GAIAGEO_DECLARE void gaiaBuildCircleMbr(double x, double y, double radius, int srid, unsigned char **result, int *size)
Creates a BLOB-Geometry representing an Envelope [MBR].
GAIAGEO_DECLARE int gaiaGetMbrMaxX(const unsigned char *blob, unsigned int size, double *maxx)
Retrieves the MBR (MaxX) from a BLOB-Geometry object.
GAIAGEO_DECLARE void gaiaZRangeGeometry(gaiaGeomCollPtr geom, double *min, double *max)
Computes the Z-Range for a Geometry object.
GAIAGEO_DECLARE int gaiaGetMbrMinY(const unsigned char *blob, unsigned int size, double *miny)
Retrieves the MBR (MinY) from a BLOB-Geometry object.
Container for OGC POLYGON Geometry.
Definition: gg_structs.h:182
GAIAGEO_DECLARE void gaiaMRangeRing(gaiaRingPtr rng, double *min, double *max)
Computes the M-Range for a Ring object.
GAIAGEO_DECLARE gaiaGeomCollPtr gaiaFromSpatiaLiteBlobMbr(const unsigned char *blob, unsigned int size)
Creates a Geometry object corresponding to the Envelope [MBR] for a BLOB-Geometry.
GAIAGEO_DECLARE int gaiaGetMbrMaxY(const unsigned char *blob, unsigned int size, double *maxy)
Retrieves the MBR (MaxY) from a BLOB-Geometry object.
GAIAGEO_DECLARE int gaiaGetMbrMinX(const unsigned char *blob, unsigned int size, double *minx)
Retrieves the MBR (MinX) from a BLOB-Geometry object.
GAIAGEO_DECLARE void gaiaMbrPolygon(gaiaPolygonPtr polyg)
Updates the actual MBR for a Polygon object.
GAIAGEO_DECLARE void gaiaBuildFilterMbr(double x1, double y1, double x2, double y2, int mode, unsigned char **result, int *size)
Creates a BLOB-FilterMBR.
GAIAGEO_DECLARE void gaiaMRangeLinestring(gaiaLinestringPtr line, double *min, double *max)
Computes the M-Range for a Linestring object.
GAIAGEO_DECLARE int gaiaParseFilterMbr(unsigned char *result, int size, double *minx, double *miny, double *maxx, double *maxy, int *mode)
Creates a BLOB-FilterMBR.
Container for OGC RING Geometry.
Definition: gg_structs.h:148
GAIAGEO_DECLARE void gaiaMRangeGeometry(gaiaGeomCollPtr geom, double *min, double *max)
Computes the Z-Range for a Geometry object.
GAIAGEO_DECLARE void gaiaMbrLinestring(gaiaLinestringPtr line)
Updates the actual MBR for a Linestring object.
Container for OGC LINESTRING Geometry.
Definition: gg_structs.h:118
GAIAGEO_DECLARE int gaiaMbrsContains(gaiaGeomCollPtr mbr1, gaiaGeomCollPtr mbr2)
MBRs comparison: Contains.
GAIAGEO_DECLARE int gaiaMbrsWithin(gaiaGeomCollPtr mbr1, gaiaGeomCollPtr mbr2)
MBRs comparison: Within.
GAIAGEO_DECLARE void gaiaZRangeLinestring(gaiaLinestringPtr line, double *min, double *max)
Computes the Z-Range for a Linestring object.
GAIAGEO_DECLARE void gaiaMbrGeometry(gaiaGeomCollPtr geom)
Updates the actual MBR for a Geometry object.
GAIAGEO_DECLARE void gaiaZRangeRing(gaiaRingPtr rng, double *min, double *max)
Computes the Z-Range for a Ring object.
GAIAGEO_DECLARE int gaiaMbrsEqual(gaiaGeomCollPtr mbr1, gaiaGeomCollPtr mbr2)
MBRs comparison: Equal.
GAIAGEO_DECLARE int gaiaMbrsDisjoint(gaiaGeomCollPtr mbr1, gaiaGeomCollPtr mbr2)
MBRs comparison: Disjoint.
Container for OGC GEOMETRYCOLLECTION Geometry.
Definition: gg_structs.h:216
GAIAGEO_DECLARE void gaiaBuildMbr(double x1, double y1, double x2, double y2, int srid, unsigned char **result, int *size)
Creates a BLOB-Geometry representing an Envelope [MBR].
GAIAGEO_DECLARE int gaiaMbrsTouches(gaiaGeomCollPtr mbr1, gaiaGeomCollPtr mbr2)
MBRs comparison: Touches.
GAIAGEO_DECLARE int gaiaMbrsOverlaps(gaiaGeomCollPtr mbr1, gaiaGeomCollPtr mbr2)
MBRs comparison: Overlaps.