| gaiageo.h | | gaiageo.h | |
| /* | | /* | |
| gaiageo.h -- Gaia common support for geometries | | gaiageo.h -- Gaia common support for geometries | |
| | | | |
|
| version 2.3, 2008 October 13 | | version 2.4, 2009 September 17 | |
| | | | |
| Author: Sandro Furieri a.furieri@lqt.it | | Author: Sandro Furieri a.furieri@lqt.it | |
| | | | |
| --------------------------------------------------------------------------
---- | | --------------------------------------------------------------------------
---- | |
| | | | |
| Version: MPL 1.1/GPL 2.0/LGPL 2.1 | | Version: MPL 1.1/GPL 2.0/LGPL 2.1 | |
| | | | |
| The contents of this file are subject to the Mozilla Public License Versio
n | | The contents of this file are subject to the Mozilla Public License Versio
n | |
| 1.1 (the "License"); you may not use this file except in compliance with | | 1.1 (the "License"); you may not use this file except in compliance with | |
| the License. You may obtain a copy of the License at | | the License. You may obtain a copy of the License at | |
| | | | |
| skipping to change at line 80 | | skipping to change at line 80 | |
| #define GAIA_BIG_ENDIAN 0 | | #define GAIA_BIG_ENDIAN 0 | |
| #define GAIA_LITTLE_ENDIAN 1 | | #define GAIA_LITTLE_ENDIAN 1 | |
| | | | |
| /* constants that defines special markers used for encoding of SpatiaLite i
nternal BLOB geometries */ | | /* constants that defines special markers used for encoding of SpatiaLite i
nternal BLOB geometries */ | |
| #define GAIA_MARK_START 0x00 | | #define GAIA_MARK_START 0x00 | |
| #define GAIA_MARK_END 0xFE | | #define GAIA_MARK_END 0xFE | |
| #define GAIA_MARK_MBR 0x7C | | #define GAIA_MARK_MBR 0x7C | |
| #define GAIA_MARK_ENTITY 0x69 | | #define GAIA_MARK_ENTITY 0x69 | |
| | | | |
| /* constants that defines GEOMETRY CLASSes */ | | /* constants that defines GEOMETRY CLASSes */ | |
|
| #define GAIA_UNKNOWN 0 | | #define GAIA_UNKNOWN 0 | |
| #define GAIA_POINT 1 | | #define GAIA_POINT 1 | |
| #define GAIA_LINESTRING 2 | | #define GAIA_LINESTRING 2 | |
| #define GAIA_POLYGON 3 | | #define GAIA_POLYGON 3 | |
| #define GAIA_MULTIPOINT 4 | | #define GAIA_MULTIPOINT 4 | |
| #define GAIA_MULTILINESTRING 5 | | #define GAIA_MULTILINESTRING 5 | |
| #define GAIA_MULTIPOLYGON 6 | | #define GAIA_MULTIPOLYGON 6 | |
| #define GAIA_GEOMETRYCOLLECTION 7 | | #define GAIA_GEOMETRYCOLLECTION 7 | |
| | | #define GAIA_POINTZ 1001 | |
| | | #define GAIA_LINESTRINGZ 1002 | |
| | | #define GAIA_POLYGONZ 1003 | |
| | | #define GAIA_MULTIPOINTZ 1004 | |
| | | #define GAIA_MULTILINESTRINGZ 1005 | |
| | | #define GAIA_MULTIPOLYGONZ 1006 | |
| | | #define GAIA_GEOMETRYCOLLECTIONZ 1007 | |
| | | #define GAIA_POINTM 2001 | |
| | | #define GAIA_LINESTRINGM 2002 | |
| | | #define GAIA_POLYGONM 2003 | |
| | | #define GAIA_MULTIPOINTM 2004 | |
| | | #define GAIA_MULTILINESTRINGM 2005 | |
| | | #define GAIA_MULTIPOLYGONM 2006 | |
| | | #define GAIA_GEOMETRYCOLLECTIONM 2007 | |
| | | #define GAIA_POINTZM 3001 | |
| | | #define GAIA_LINESTRINGZM 3002 | |
| | | #define GAIA_POLYGONZM 3003 | |
| | | #define GAIA_MULTIPOINTZM 3004 | |
| | | #define GAIA_MULTILINESTRINGZM 3005 | |
| | | #define GAIA_MULTIPOLYGONZM 3006 | |
| | | #define GAIA_GEOMETRYCOLLECTIONZM 3007 | |
| | | | |
| | | /* constants that defines Compressed GEOMETRY CLASSes */ | |
| | | #define GAIA_COMPRESSED_LINESTRING 1000002 | |
| | | #define GAIA_COMPRESSED_POLYGON 1000003 | |
| | | #define GAIA_COMPRESSED_LINESTRINGZ 1001002 | |
| | | #define GAIA_COMPRESSED_POLYGONZ 1001003 | |
| | | #define GAIA_COMPRESSED_LINESTRINGM 1002002 | |
| | | #define GAIA_COMPRESSED_POLYGONM 1002003 | |
| | | #define GAIA_COMPRESSED_LINESTRINGZM 1003002 | |
| | | #define GAIA_COMPRESSED_POLYGONZM 1003003 | |
| | | | |
| /* constants that defines token codes for WKT parsing */ | | /* constants that defines token codes for WKT parsing */ | |
| #define GAIA_COORDINATE 8 | | #define GAIA_COORDINATE 8 | |
| #define GAIA_OPENED 9 | | #define GAIA_OPENED 9 | |
| #define GAIA_CLOSED 10 | | #define GAIA_CLOSED 10 | |
| #define GAIA_COMMA 11 | | #define GAIA_COMMA 11 | |
| #define GAIA_SPACE 12 | | #define GAIA_SPACE 12 | |
| | | | |
| /* constants that defines multitype values */ | | /* constants that defines multitype values */ | |
| #define GAIA_NULL_VALUE 0 | | #define GAIA_NULL_VALUE 0 | |
| | | | |
| skipping to change at line 117 | | skipping to change at line 148 | |
| /* constants that defines MBRs spatial relationships */ | | /* constants that defines MBRs spatial relationships */ | |
| #define GAIA_MBR_CONTAINS 1 | | #define GAIA_MBR_CONTAINS 1 | |
| #define GAIA_MBR_DISJOINT 2 | | #define GAIA_MBR_DISJOINT 2 | |
| #define GAIA_MBR_EQUAL 3 | | #define GAIA_MBR_EQUAL 3 | |
| #define GAIA_MBR_INTERSECTS 4 | | #define GAIA_MBR_INTERSECTS 4 | |
| #define GAIA_MBR_OVERLAPS 5 | | #define GAIA_MBR_OVERLAPS 5 | |
| #define GAIA_MBR_TOUCHES 6 | | #define GAIA_MBR_TOUCHES 6 | |
| #define GAIA_MBR_WITHIN 7 | | #define GAIA_MBR_WITHIN 7 | |
| | | | |
| /* constants used for FilterMBR */ | | /* constants used for FilterMBR */ | |
|
| #define GAIA_FILTER_MBR_WITHIN 74 | | #define GAIA_FILTER_MBR_WITHIN 74 | |
| #define GAIA_FILTER_MBR_CONTAINS 77 | | #define GAIA_FILTER_MBR_CONTAINS 77 | |
| #define GAIA_FILTER_MBR_INTERSECTS 79 | | #define GAIA_FILTER_MBR_INTERSECTS 79 | |
| #define GAIA_FILTER_MBR_DECLARE 89 | | #define GAIA_FILTER_MBR_DECLARE 89 | |
| | | | |
| /* constants defining SVG default values */ | | /* constants defining SVG default values */ | |
|
| #define GAIA_SVG_DEFAULT_RELATIVE 0 | | #define GAIA_SVG_DEFAULT_RELATIVE 0 | |
| #define GAIA_SVG_DEFAULT_PRECISION 6 | | #define GAIA_SVG_DEFAULT_PRECISION 6 | |
| #define GAIA_SVG_DEFAULT_MAX_PRECISION 15 | | #define GAIA_SVG_DEFAULT_MAX_PRECISION 15 | |
| | | | |
| /* constants used for VirtualNetwork */ | | /* constants used for VirtualNetwork */ | |
|
| #define GAIA_NET_START 0x67 | | #define GAIA_NET_START 0x67 | |
| #define GAIA_NET_END 0x87 | | #define GAIA_NET64_START 0x68 | |
| #define GAIA_NET_HEADER 0xc0 | | #define GAIA_NET64_A_STAR_START 0x69 | |
| #define GAIA_NET_CODE 0xa6 | | #define GAIA_NET_END 0x87 | |
| | | #define GAIA_NET_HEADER 0xc0 | |
| | | #define GAIA_NET_CODE 0xa6 | |
| #define GAIA_NET_ID 0xb5 | | #define GAIA_NET_ID 0xb5 | |
|
| #define GAIA_NET_NODE 0xde | | #define GAIA_NET_NODE 0xde | |
| #define GAIA_NET_ARC 0x54 | | #define GAIA_NET_ARC 0x54 | |
| #define GAIA_NET_TABLE 0xa0 | | #define GAIA_NET_TABLE 0xa0 | |
| #define GAIA_NET_FROM 0xa1 | | #define GAIA_NET_FROM 0xa1 | |
| #define GAIA_NET_TO 0xa2 | | #define GAIA_NET_TO 0xa2 | |
|
| #define GAIA_NET_GEOM 0xa3 | | #define GAIA_NET_GEOM 0xa3 | |
| #define GAIA_NET_BLOCK 0xed | | #define GAIA_NET_NAME 0xa4 | |
| | | #define GAIA_NET_A_STAR_COEFF 0xa5 | |
| | | #define GAIA_NET_BLOCK 0xed | |
| | | | |
| /* constants used for Coordinate Dimensions */ | | /* constants used for Coordinate Dimensions */ | |
| #define GAIA_XY 0x00 | | #define GAIA_XY 0x00 | |
| #define GAIA_XY_Z 0x01 | | #define GAIA_XY_Z 0x01 | |
| #define GAIA_XY_M 0x02 | | #define GAIA_XY_M 0x02 | |
| #define GAIA_XY_Z_M 0x03 | | #define GAIA_XY_Z_M 0x03 | |
| | | | |
|
| | | /* constants used for length unit conversion */ | |
| | | #define GAIA_KM 0 | |
| | | #define GAIA_M 1 | |
| | | #define GAIA_DM 2 | |
| | | #define GAIA_CM 3 | |
| | | #define GAIA_MM 4 | |
| | | #define GAIA_KMI 5 | |
| | | #define GAIA_IN 6 | |
| | | #define GAIA_FT 7 | |
| | | #define GAIA_YD 8 | |
| | | #define GAIA_MI 9 | |
| | | #define GAIA_FATH 10 | |
| | | #define GAIA_CH 11 | |
| | | #define GAIA_LINK 12 | |
| | | #define GAIA_US_IN 13 | |
| | | #define GAIA_US_FT 14 | |
| | | #define GAIA_US_YD 15 | |
| | | #define GAIA_US_CH 16 | |
| | | #define GAIA_US_MI 17 | |
| | | #define GAIA_IND_YD 18 | |
| | | #define GAIA_IND_FT 19 | |
| | | #define GAIA_IND_CH 20 | |
| | | #define GAIA_MIN_UNIT GAIA_KM | |
| | | #define GAIA_MAX_UNIT GAIA_IND_CH | |
| | | | |
| | | /* constants used for SHAPES */ | |
| | | #define GAIA_SHP_NULL 0 | |
| | | #define GAIA_SHP_POINT 1 | |
| | | #define GAIA_SHP_POLYLINE 3 | |
| | | #define GAIA_SHP_POLYGON 5 | |
| | | #define GAIA_SHP_MULTIPOINT 8 | |
| | | #define GAIA_SHP_POINTZ 11 | |
| | | #define GAIA_SHP_POLYLINEZ 13 | |
| | | #define GAIA_SHP_POLYGONZ 15 | |
| | | #define GAIA_SHP_MULTIPOINTZ 18 | |
| | | #define GAIA_SHP_POINTM 21 | |
| | | #define GAIA_SHP_POLYLINEM 23 | |
| | | #define GAIA_SHP_POLYGONM 25 | |
| | | #define GAIA_SHP_MULTIPOINTM 28 | |
| | | | |
| /* macros */ | | /* macros */ | |
|
| #define gaiaGetPoint(xy,v,x,y) {*x = xy[(v) * 2]; \ | | #define gaiaGetPoint(xy,v,x,y) \ | |
| | | {*x = xy[(v) * 2]; \ | |
| *y = xy[(v) * 2 + 1];} | | *y = xy[(v) * 2 + 1];} | |
| | | | |
|
| #define gaiaSetPoint(xy,v,x,y) {xy[(v) * 2] = x; \ | | #define gaiaSetPoint(xy,v,x,y) \ | |
| | | {xy[(v) * 2] = x; \ | |
| xy[(v) * 2 + 1] = y;} | | xy[(v) * 2 + 1] = y;} | |
| | | | |
|
| | | #define gaiaGetPointXYZ(xyz,v,x,y,z) \ | |
| | | {*x = xyz[(v) * 3]; \ | |
| | | *y = xyz[(v) * 3 + 1]; \ | |
| | | *z = xyz[(v) * 3 + 2];} | |
| | | | |
| | | #define gaiaSetPointXYZ(xyz,v,x,y,z) \ | |
| | | {xyz[(v) * 3] = x; \ | |
| | | xyz[(v) * 3 + 1] = y; \ | |
| | | xyz[(v) * 3 + 2] = z;} | |
| | | | |
| | | #define gaiaGetPointXYM(xym,v,x,y,m) \ | |
| | | {*x = xym[(v) * 3]; \ | |
| | | *y = xym[(v) * 3 + 1]; \ | |
| | | *m = xym[(v) * 3 + 2];} | |
| | | | |
| | | #define gaiaSetPointXYM(xym,v,x,y,m) \ | |
| | | {xym[(v) * 3] = x; \ | |
| | | xym[(v) * 3 + 1] = y; \ | |
| | | xym[(v) * 3 + 2] = m;} | |
| | | | |
| | | #define gaiaGetPointXYZM(xyzm,v,x,y,z,m) \ | |
| | | {*x = xyzm[(v) * 4]; \ | |
| | | *y = xyzm[(v) * 4 + 1]; \ | |
| | | *z = xyzm[(v) * 4 + 2]; \ | |
| | | *m = xyzm[(v) * 4 + 3];} | |
| | | | |
| | | #define gaiaSetPointXYZM(xyzm,v,x,y,z,m) \ | |
| | | {xyzm[(v) * 4] = x; \ | |
| | | xyzm[(v) * 4 + 1] = y; \ | |
| | | xyzm[(v) * 4 + 2] = z; \ | |
| | | xyzm[(v) * 4 + 3] = m;} | |
| | | | |
| typedef struct gaiaPointStruct | | typedef struct gaiaPointStruct | |
| { | | { | |
| /* an OpenGis POINT */ | | /* an OpenGis POINT */ | |
| double X; /* X,Y coordinates */ | | double X; /* X,Y coordinates */ | |
| double Y; | | double Y; | |
|
| | | double Z; /* Z coordinate */ | |
| | | double M; /* M measure */ | |
| | | int DimensionModel; /* (x,y), (x,y,z), (x,y,m) or (x,y,z,m) */ | |
| struct gaiaPointStruct *Next; /* for double-linked list */ | | struct gaiaPointStruct *Next; /* for double-linked list */ | |
| struct gaiaPointStruct *Prev; /* for double-linked list */ | | struct gaiaPointStruct *Prev; /* for double-linked list */ | |
| } gaiaPoint; | | } gaiaPoint; | |
| typedef gaiaPoint *gaiaPointPtr; | | typedef gaiaPoint *gaiaPointPtr; | |
| | | | |
| typedef struct gaiaDynamicLineStruct | | typedef struct gaiaDynamicLineStruct | |
| { | | { | |
| /* a generic DYNAMIC LINE object */ | | /* a generic DYNAMIC LINE object */ | |
| gaiaPointPtr First; /* Points linked list - first */ | | gaiaPointPtr First; /* Points linked list - first */ | |
| gaiaPointPtr Last; /* Points linked list - last */ | | gaiaPointPtr Last; /* Points linked list - last */ | |
| | | | |
| skipping to change at line 181 | | skipping to change at line 293 | |
| | | | |
| typedef struct gaiaLinestringStruct | | typedef struct gaiaLinestringStruct | |
| { | | { | |
| /* an OpenGis LINESTRING */ | | /* an OpenGis LINESTRING */ | |
| int Points; /* number of vertices */ | | int Points; /* number of vertices */ | |
| double *Coords; /* X,Y [vertices] array */ | | double *Coords; /* X,Y [vertices] array */ | |
| double MinX; /* MBR - BBOX */ | | double MinX; /* MBR - BBOX */ | |
| double MinY; /* MBR - BBOX */ | | double MinY; /* MBR - BBOX */ | |
| double MaxX; /* MBR - BBOX */ | | double MaxX; /* MBR - BBOX */ | |
| double MaxY; /* MBR - BBOX */ | | double MaxY; /* MBR - BBOX */ | |
|
| | | int DimensionModel; /* (x,y), (x,y,z), (x,y,m) or (x,y,z,m) */ | |
| struct gaiaLinestringStruct *Next; /* for linked list */ | | struct gaiaLinestringStruct *Next; /* for linked list */ | |
| } gaiaLinestring; | | } gaiaLinestring; | |
| typedef gaiaLinestring *gaiaLinestringPtr; | | typedef gaiaLinestring *gaiaLinestringPtr; | |
| | | | |
| typedef struct gaiaRingStruct | | typedef struct gaiaRingStruct | |
| { | | { | |
| /* a GIS ring - OpenGis LINESTRING, closed */ | | /* a GIS ring - OpenGis LINESTRING, closed */ | |
| int Points; /* number of vertices */ | | int Points; /* number of vertices */ | |
| double *Coords; /* X,Y [vertices] array */ | | double *Coords; /* X,Y [vertices] array */ | |
| int Clockwise; /* clockwise / counterclockwise */ | | int Clockwise; /* clockwise / counterclockwise */ | |
| double MinX; /* MBR - BBOX */ | | double MinX; /* MBR - BBOX */ | |
| double MinY; /* MBR - BBOX */ | | double MinY; /* MBR - BBOX */ | |
| double MaxX; /* MBR - BBOX */ | | double MaxX; /* MBR - BBOX */ | |
| double MaxY; /* MBR - BBOX */ | | double MaxY; /* MBR - BBOX */ | |
|
| | | int DimensionModel; /* (x,y), (x,y,z), (x,y,m) or (x,y,z,m) */ | |
| struct gaiaRingStruct *Next; /* for linked list */ | | struct gaiaRingStruct *Next; /* for linked list */ | |
| struct gaiaPolygonStruct *Link; /* polygon reference */ | | struct gaiaPolygonStruct *Link; /* polygon reference */ | |
| } gaiaRing; | | } gaiaRing; | |
| typedef gaiaRing *gaiaRingPtr; | | typedef gaiaRing *gaiaRingPtr; | |
| | | | |
| typedef struct gaiaPolygonStruct | | typedef struct gaiaPolygonStruct | |
| { | | { | |
| /* an OpenGis POLYGON */ | | /* an OpenGis POLYGON */ | |
| gaiaRingPtr Exterior; /* exterior ring */ | | gaiaRingPtr Exterior; /* exterior ring */ | |
| int NumInteriors; /* number of interior rings */ | | int NumInteriors; /* number of interior rings */ | |
| gaiaRingPtr Interiors; /* interior rings array */ | | gaiaRingPtr Interiors; /* interior rings array */ | |
| int NextInterior; /* first free interior ring */ | | int NextInterior; /* first free interior ring */ | |
| double MinX; /* MBR - BBOX */ | | double MinX; /* MBR - BBOX */ | |
| double MinY; /* MBR - BBOX */ | | double MinY; /* MBR - BBOX */ | |
| double MaxX; /* MBR - BBOX */ | | double MaxX; /* MBR - BBOX */ | |
| double MaxY; /* MBR - BBOX */ | | double MaxY; /* MBR - BBOX */ | |
|
| | | int DimensionModel; /* (x,y), (x,y,z), (x,y,m) or (x,y,z,m) */ | |
| struct gaiaPolygonStruct *Next; /* for linked list */ | | struct gaiaPolygonStruct *Next; /* for linked list */ | |
| } gaiaPolygon; | | } gaiaPolygon; | |
| typedef gaiaPolygon *gaiaPolygonPtr; | | typedef gaiaPolygon *gaiaPolygonPtr; | |
| | | | |
| typedef struct gaiaGeomCollStruct | | typedef struct gaiaGeomCollStruct | |
| { | | { | |
| /* OpenGis GEOMETRYCOLLECTION */ | | /* OpenGis GEOMETRYCOLLECTION */ | |
| int Srid; /* the SRID value for this GEOMETRY */ | | int Srid; /* the SRID value for this GEOMETRY */ | |
| char endian_arch; /* littleEndian - bigEndian arch for targer
CPU */ | | char endian_arch; /* littleEndian - bigEndian arch for targer
CPU */ | |
| char endian; /* littleEndian - bigEndian */ | | char endian; /* littleEndian - bigEndian */ | |
| | | | |
| skipping to change at line 234 | | skipping to change at line 349 | |
| gaiaPointPtr FirstPoint; /* Points linked list - first */ | | gaiaPointPtr FirstPoint; /* Points linked list - first */ | |
| gaiaPointPtr LastPoint; /* Points linked list - last */ | | gaiaPointPtr LastPoint; /* Points linked list - last */ | |
| gaiaLinestringPtr FirstLinestring; /* Linestrings linked list -
first */ | | gaiaLinestringPtr FirstLinestring; /* Linestrings linked list -
first */ | |
| gaiaLinestringPtr LastLinestring; /* Linestrings linked list -
last */ | | gaiaLinestringPtr LastLinestring; /* Linestrings linked list -
last */ | |
| gaiaPolygonPtr FirstPolygon; /* Polygons linked list - first */ | | gaiaPolygonPtr FirstPolygon; /* Polygons linked list - first */ | |
| gaiaPolygonPtr LastPolygon; /* Polygons linked list - last */ | | gaiaPolygonPtr LastPolygon; /* Polygons linked list - last */ | |
| double MinX; /* MBR - BBOX */ | | double MinX; /* MBR - BBOX */ | |
| double MinY; /* MBR - BBOX */ | | double MinY; /* MBR - BBOX */ | |
| double MaxX; /* MBR - BBOX */ | | double MaxX; /* MBR - BBOX */ | |
| double MaxY; /* MBR - BBOX */ | | double MaxY; /* MBR - BBOX */ | |
|
| | | int DimensionModel; /* (x,y), (x,y,z), (x,y,m) or (x,y,z,m) */ | |
| int DeclaredType; /* the declared TYPE for this Geometry */ | | int DeclaredType; /* the declared TYPE for this Geometry */ | |
|
| | | struct gaiaGeomCollStruct *Next; /* Vanuatu - used for linked
list */ | |
| } gaiaGeomColl; | | } gaiaGeomColl; | |
| typedef gaiaGeomColl *gaiaGeomCollPtr; | | typedef gaiaGeomColl *gaiaGeomCollPtr; | |
| | | | |
| typedef struct gaiaPreRingStruct | | typedef struct gaiaPreRingStruct | |
| { | | { | |
| /* a LINESTRING used to build rings */ | | /* a LINESTRING used to build rings */ | |
| gaiaLinestringPtr Line; /* a LINESTRING pointer */ | | gaiaLinestringPtr Line; /* a LINESTRING pointer */ | |
| int AlreadyUsed; /* a switch to mark an already used line ele
ment */ | | int AlreadyUsed; /* a switch to mark an already used line ele
ment */ | |
| struct gaiaPreRingStruct *Next; /* for linked list */ | | struct gaiaPreRingStruct *Next; /* for linked list */ | |
| } gaiaPreRing; | | } gaiaPreRing; | |
| | | | |
| skipping to change at line 280 | | skipping to change at line 397 | |
| typedef struct gaiaDbfListStruct | | typedef struct gaiaDbfListStruct | |
| { | | { | |
| /* a linked list to containt the DBF fields definitions - shapefile attribu
tes */ | | /* a linked list to containt the DBF fields definitions - shapefile attribu
tes */ | |
| int RowId; /* the current RowId */ | | int RowId; /* the current RowId */ | |
| gaiaGeomCollPtr Geometry; /* geometry for current entity */ | | gaiaGeomCollPtr Geometry; /* geometry for current entity */ | |
| gaiaDbfFieldPtr First; /* pointer to first element in linked list *
/ | | gaiaDbfFieldPtr First; /* pointer to first element in linked list *
/ | |
| gaiaDbfFieldPtr Last; /* pointer to last element in linker list */ | | gaiaDbfFieldPtr Last; /* pointer to last element in linker list */ | |
| } gaiaDbfList; | | } gaiaDbfList; | |
| typedef gaiaDbfList *gaiaDbfListPtr; | | typedef gaiaDbfList *gaiaDbfListPtr; | |
| | | | |
|
| | | typedef struct gaiaDbfStruct | |
| | | { | |
| | | /* DBF TYPE */ | |
| | | int endian_arch; | |
| | | int Valid; /* 1 = ready to process */ | |
| | | char *Path; /* the DBF path */ | |
| | | FILE *flDbf; /* the DBF file handle */ | |
| | | gaiaDbfListPtr Dbf; /* the DBF attributes list */ | |
| | | unsigned char *BufDbf; /* the DBF I/O buffer */ | |
| | | int DbfHdsz; /* the DBF header length */ | |
| | | int DbfReclen; /* the DBF record length */ | |
| | | int DbfSize; /* current DBF size */ | |
| | | int DbfRecno; /* current DBF record number */ | |
| | | void *IconvObj; /* opaque reference to ICONV converter */ | |
| | | char *LastError; /* last error message */ | |
| | | } gaiaDbf; | |
| | | typedef gaiaDbf *gaiaDbfPtr; | |
| | | | |
| typedef struct gaiaShapefileStruct | | typedef struct gaiaShapefileStruct | |
| { | | { | |
| /* SHAPEFILE TYPE */ | | /* SHAPEFILE TYPE */ | |
| int endian_arch; | | int endian_arch; | |
| int Valid; /* 1 = ready to process */ | | int Valid; /* 1 = ready to process */ | |
|
| int ReadOnly; /* read or wite mode */ | | int ReadOnly; /* read or write mode */ | |
| char *Path; /* the shapefile abstract path [no suffixes]
*/ | | char *Path; /* the shapefile abstract path [no suffixes]
*/ | |
| FILE *flShx; /* the SHX file handle */ | | FILE *flShx; /* the SHX file handle */ | |
| FILE *flShp; /* the SHP file handle */ | | FILE *flShp; /* the SHP file handle */ | |
| FILE *flDbf; /* the DBF file handle */ | | FILE *flDbf; /* the DBF file handle */ | |
| int Shape; /* the SHAPE code for the whole shapefile */ | | int Shape; /* the SHAPE code for the whole shapefile */ | |
| gaiaDbfListPtr Dbf; /* the DBF attributes list */ | | gaiaDbfListPtr Dbf; /* the DBF attributes list */ | |
| unsigned char *BufDbf; /* the DBF I/O buffer */ | | unsigned char *BufDbf; /* the DBF I/O buffer */ | |
| int DbfHdsz; /* the DBF header length */ | | int DbfHdsz; /* the DBF header length */ | |
| int DbfReclen; /* the DBF record length */ | | int DbfReclen; /* the DBF record length */ | |
| int DbfSize; /* current DBF size */ | | int DbfSize; /* current DBF size */ | |
| | | | |
| skipping to change at line 307 | | skipping to change at line 442 | |
| unsigned char *BufShp; /* the SHP I/O buffer */ | | unsigned char *BufShp; /* the SHP I/O buffer */ | |
| int ShpBfsz; /* the SHP buffer current size */ | | int ShpBfsz; /* the SHP buffer current size */ | |
| int ShpSize; /* current SHP size */ | | int ShpSize; /* current SHP size */ | |
| int ShxSize; /* current SHX size */ | | int ShxSize; /* current SHX size */ | |
| double MinX; /* the MBR/BBOX for the whole shapefile */ | | double MinX; /* the MBR/BBOX for the whole shapefile */ | |
| double MinY; | | double MinY; | |
| double MaxX; | | double MaxX; | |
| double MaxY; | | double MaxY; | |
| void *IconvObj; /* opaque reference to ICONV converter */ | | void *IconvObj; /* opaque reference to ICONV converter */ | |
| char *LastError; /* last error message */ | | char *LastError; /* last error message */ | |
|
| unsigned char EffectiveType; /* the effective Geometry-type, as d | | int EffectiveType; /* the effective Geometry-type, as determine | |
| etermined by gaiaShpAnalyze() */ | | d by gaiaShpAnalyze() */ | |
| | | int EffectiveDims; /* the effective Dimensions [XY, XYZ, XYM, X | |
| | | YZM], as determined by gaiaShpAnalyze() */ | |
| } gaiaShapefile; | | } gaiaShapefile; | |
| typedef gaiaShapefile *gaiaShapefilePtr; | | typedef gaiaShapefile *gaiaShapefilePtr; | |
| | | | |
|
| | | typedef struct gaiaOutBufferStruct | |
| | | { | |
| | | /* a struct handling a dynamically growing output buffer */ | |
| | | char *Buffer; | |
| | | int WriteOffset; | |
| | | int BufferSize; | |
| | | int Error; | |
| | | } gaiaOutBuffer; | |
| | | typedef gaiaOutBuffer *gaiaOutBufferPtr; | |
| | | | |
| | | #ifndef OMIT_ICONV /* ICONV enabled: supporting text reader */ | |
| | | | |
| | | #define VRTTXT_FIELDS_MAX 65535 | |
| | | #define VRTTXT_BLOCK_MAX 65535 | |
| | | | |
| | | #define VRTTXT_TEXT 1 | |
| | | #define VRTTXT_INTEGER 2 | |
| | | #define VRTTXT_DOUBLE 3 | |
| | | #define VRTTXT_NULL 4 | |
| | | | |
| | | struct vrttxt_line | |
| | | { | |
| | | /* a struct representing a full LINE (aka Record) */ | |
| | | off_t offset; | |
| | | int len; | |
| | | int field_offsets[VRTTXT_FIELDS_MAX]; | |
| | | int num_fields; | |
| | | int error; | |
| | | }; | |
| | | | |
| | | struct vrttxt_row | |
| | | { | |
| | | /* a struct storing Row offsets */ | |
| | | int line_no; | |
| | | off_t offset; | |
| | | int len; | |
| | | int num_fields; | |
| | | }; | |
| | | | |
| | | struct vrttxt_row_block | |
| | | { | |
| | | /* | |
| | | / for efficiency sake, individuale Row offsets | |
| | | / are grouped in reasonably sized blocks | |
| | | */ | |
| | | struct vrttxt_row rows[VRTTXT_BLOCK_MAX]; | |
| | | int num_rows; | |
| | | int min_line_no; | |
| | | int max_line_no; | |
| | | struct vrttxt_row_block *next; | |
| | | }; | |
| | | | |
| | | struct vrttxt_column_header | |
| | | { | |
| | | /* a struct representing a Column (aka Field) header */ | |
| | | char *name; | |
| | | int type; | |
| | | }; | |
| | | | |
| | | typedef struct vrttxt_reader | |
| | | { | |
| | | /* the main TXT-Reader struct */ | |
| | | struct vrttxt_column_header columns[VRTTXT_FIELDS_MAX]; | |
| | | FILE *text_file; | |
| | | void *toUtf8; /* the UTF-8 ICONV converter */ | |
| | | char field_separator; | |
| | | char text_separator; | |
| | | char decimal_separator; | |
| | | int first_line_titles; | |
| | | int error; | |
| | | struct vrttxt_row_block *first; | |
| | | struct vrttxt_row_block *last; | |
| | | struct vrttxt_row **rows; | |
| | | int num_rows; | |
| | | int line_no; | |
| | | int max_fields; | |
| | | int current_buf_sz; | |
| | | int current_buf_off; | |
| | | char *line_buffer; | |
| | | char *field_buffer; | |
| | | int field_offsets[VRTTXT_FIELDS_MAX]; | |
| | | int field_lens[VRTTXT_FIELDS_MAX]; | |
| | | int max_current_field; | |
| | | int current_line_ready; | |
| | | } gaiaTextReader; | |
| | | typedef gaiaTextReader *gaiaTextReaderPtr; | |
| | | | |
| | | #endif /* end ICONV (text reader) */ | |
| | | | |
| /* function prototipes */ | | /* function prototipes */ | |
| | | | |
| GAIAGEO_DECLARE int gaiaEndianArch (void); | | GAIAGEO_DECLARE int gaiaEndianArch (void); | |
| GAIAGEO_DECLARE short gaiaImport16 (const unsigned char *p, | | GAIAGEO_DECLARE short gaiaImport16 (const unsigned char *p, | |
| int little_endian, | | int little_endian, | |
| int little_endian_arch); | | int little_endian_arch); | |
| GAIAGEO_DECLARE int gaiaImport32 (const unsigned char *p, int little_en
dian, | | GAIAGEO_DECLARE int gaiaImport32 (const unsigned char *p, int little_en
dian, | |
| int little_endian_arch); | | int little_endian_arch); | |
|
| | | GAIAGEO_DECLARE float gaiaImportF32 (const unsigned char *p, | |
| | | int little_endian, | |
| | | int little_endian_arch); | |
| GAIAGEO_DECLARE double gaiaImport64 (const unsigned char *p, | | GAIAGEO_DECLARE double gaiaImport64 (const unsigned char *p, | |
| int little_endian, | | int little_endian, | |
| int little_endian_arch); | | int little_endian_arch); | |
|
| | | GAIAGEO_DECLARE sqlite3_int64 gaiaImportI64 (const unsigned char *p, | |
| | | int little_endian, | |
| | | int little_endian_arch); | |
| GAIAGEO_DECLARE void gaiaExport16 (unsigned char *p, short value, | | GAIAGEO_DECLARE void gaiaExport16 (unsigned char *p, short value, | |
| int little_endian, | | int little_endian, | |
| int little_endian_arch); | | int little_endian_arch); | |
| GAIAGEO_DECLARE void gaiaExport32 (unsigned char *p, int value, | | GAIAGEO_DECLARE void gaiaExport32 (unsigned char *p, int value, | |
| int little_endian, | | int little_endian, | |
| int little_endian_arch); | | int little_endian_arch); | |
|
| | | GAIAGEO_DECLARE void gaiaExportF32 (unsigned char *p, float value, | |
| | | int little_endian, | |
| | | int little_endian_arch); | |
| GAIAGEO_DECLARE void gaiaExport64 (unsigned char *p, double value, | | GAIAGEO_DECLARE void gaiaExport64 (unsigned char *p, double value, | |
| int little_endian, | | int little_endian, | |
| int little_endian_arch); | | int little_endian_arch); | |
|
| | | GAIAGEO_DECLARE void gaiaExportI64 (unsigned char *p, sqlite3_int64 val | |
| | | ue, | |
| | | int little_endian, | |
| | | int little_endian_arch); | |
| GAIAGEO_DECLARE gaiaPointPtr gaiaAllocPoint (double x, double y); | | GAIAGEO_DECLARE gaiaPointPtr gaiaAllocPoint (double x, double y); | |
|
| | | GAIAGEO_DECLARE gaiaPointPtr gaiaAllocPointXYZ (double x, double y, | |
| | | double z); | |
| | | GAIAGEO_DECLARE gaiaPointPtr gaiaAllocPointXYM (double x, double y, | |
| | | double m); | |
| | | GAIAGEO_DECLARE gaiaPointPtr gaiaAllocPointXYZM (double x, double y, | |
| | | double z, double m); | |
| GAIAGEO_DECLARE void gaiaFreePoint (gaiaPointPtr ptr); | | GAIAGEO_DECLARE void gaiaFreePoint (gaiaPointPtr ptr); | |
| GAIAGEO_DECLARE gaiaLinestringPtr gaiaAllocLinestring (int vert); | | GAIAGEO_DECLARE gaiaLinestringPtr gaiaAllocLinestring (int vert); | |
|
| | | GAIAGEO_DECLARE gaiaLinestringPtr gaiaAllocLinestringXYZ (int vert); | |
| | | GAIAGEO_DECLARE gaiaLinestringPtr gaiaAllocLinestringXYM (int vert); | |
| | | GAIAGEO_DECLARE gaiaLinestringPtr gaiaAllocLinestringXYZM (int vert); | |
| GAIAGEO_DECLARE void gaiaFreeLinestring (gaiaLinestringPtr ptr); | | GAIAGEO_DECLARE void gaiaFreeLinestring (gaiaLinestringPtr ptr); | |
|
| | | GAIAGEO_DECLARE void gaiaCopyLinestringCoords (gaiaLinestringPtr dst, | |
| | | gaiaLinestringPtr src); | |
| GAIAGEO_DECLARE gaiaRingPtr gaiaAllocRing (int vert); | | GAIAGEO_DECLARE gaiaRingPtr gaiaAllocRing (int vert); | |
|
| | | GAIAGEO_DECLARE gaiaRingPtr gaiaAllocRingXYZ (int vert); | |
| | | GAIAGEO_DECLARE gaiaRingPtr gaiaAllocRingXYM (int vert); | |
| | | GAIAGEO_DECLARE gaiaRingPtr gaiaAllocRingXYZM (int vert); | |
| GAIAGEO_DECLARE void gaiaFreeRing (gaiaRingPtr ptr); | | GAIAGEO_DECLARE void gaiaFreeRing (gaiaRingPtr ptr); | |
|
| | | GAIAGEO_DECLARE void gaiaCopyRingCoords (gaiaRingPtr dst, gaiaRingPtr s
rc); | |
| GAIAGEO_DECLARE gaiaPolygonPtr gaiaAllocPolygon (int vert, int excl); | | GAIAGEO_DECLARE gaiaPolygonPtr gaiaAllocPolygon (int vert, int excl); | |
|
| | | GAIAGEO_DECLARE gaiaPolygonPtr gaiaAllocPolygonXYZ (int vert, int excl) | |
| | | ; | |
| | | GAIAGEO_DECLARE gaiaPolygonPtr gaiaAllocPolygonXYM (int vert, int excl) | |
| | | ; | |
| | | GAIAGEO_DECLARE gaiaPolygonPtr gaiaAllocPolygonXYZM (int vert, int excl | |
| | | ); | |
| GAIAGEO_DECLARE gaiaPolygonPtr gaiaCreatePolygon (gaiaRingPtr ring); | | GAIAGEO_DECLARE gaiaPolygonPtr gaiaCreatePolygon (gaiaRingPtr ring); | |
| GAIAGEO_DECLARE void gaiaFreePolygon (gaiaPolygonPtr p); | | GAIAGEO_DECLARE void gaiaFreePolygon (gaiaPolygonPtr p); | |
| GAIAGEO_DECLARE gaiaGeomCollPtr gaiaAllocGeomColl (void); | | GAIAGEO_DECLARE gaiaGeomCollPtr gaiaAllocGeomColl (void); | |
|
| | | GAIAGEO_DECLARE gaiaGeomCollPtr gaiaAllocGeomCollXYZ (void); | |
| | | GAIAGEO_DECLARE gaiaGeomCollPtr gaiaAllocGeomCollXYM (void); | |
| | | GAIAGEO_DECLARE gaiaGeomCollPtr gaiaAllocGeomCollXYZM (void); | |
| GAIAGEO_DECLARE void gaiaFreeGeomColl (gaiaGeomCollPtr p); | | GAIAGEO_DECLARE void gaiaFreeGeomColl (gaiaGeomCollPtr p); | |
| GAIAGEO_DECLARE void gaiaAddPointToGeomColl (gaiaGeomCollPtr p, double
x, | | GAIAGEO_DECLARE void gaiaAddPointToGeomColl (gaiaGeomCollPtr p, double
x, | |
| double y); | | double y); | |
|
| | | GAIAGEO_DECLARE void gaiaAddPointToGeomCollXYZ (gaiaGeomCollPtr p, doub | |
| | | le x, | |
| | | double y, double z); | |
| | | GAIAGEO_DECLARE void gaiaAddPointToGeomCollXYM (gaiaGeomCollPtr p, doub | |
| | | le x, | |
| | | double y, double m); | |
| | | GAIAGEO_DECLARE void gaiaAddPointToGeomCollXYZM (gaiaGeomCollPtr p, | |
| | | double x, double y, | |
| | | double z, double m); | |
| GAIAGEO_DECLARE void gaiaMbrLinestring (gaiaLinestringPtr line); | | GAIAGEO_DECLARE void gaiaMbrLinestring (gaiaLinestringPtr line); | |
| GAIAGEO_DECLARE void gaiaMbrRing (gaiaRingPtr rng); | | GAIAGEO_DECLARE void gaiaMbrRing (gaiaRingPtr rng); | |
| GAIAGEO_DECLARE void gaiaMbrPolygon (gaiaPolygonPtr polyg); | | GAIAGEO_DECLARE void gaiaMbrPolygon (gaiaPolygonPtr polyg); | |
| GAIAGEO_DECLARE void gaiaMbrGeometry (gaiaGeomCollPtr geom); | | GAIAGEO_DECLARE void gaiaMbrGeometry (gaiaGeomCollPtr geom); | |
|
| | | GAIAGEO_DECLARE void gaiaZRangeLinestring (gaiaLinestringPtr line, | |
| | | double *min, double *max); | |
| | | GAIAGEO_DECLARE void gaiaZRangeRing (gaiaRingPtr rng, double *min, | |
| | | double *max); | |
| | | GAIAGEO_DECLARE void gaiaZRangePolygon (gaiaPolygonPtr polyg, double *m | |
| | | in, | |
| | | double *max); | |
| | | GAIAGEO_DECLARE void gaiaZRangeGeometry (gaiaGeomCollPtr geom, double * | |
| | | min, | |
| | | double *max); | |
| | | GAIAGEO_DECLARE void gaiaMRangeLinestring (gaiaLinestringPtr line, | |
| | | double *min, double *max); | |
| | | GAIAGEO_DECLARE void gaiaMRangeRing (gaiaRingPtr rng, double *min, | |
| | | double *max); | |
| | | GAIAGEO_DECLARE void gaiaMRangePolygon (gaiaPolygonPtr polyg, double *m | |
| | | in, | |
| | | double *max); | |
| | | GAIAGEO_DECLARE void gaiaMRangeGeometry (gaiaGeomCollPtr geom, double * | |
| | | min, | |
| | | double *max); | |
| GAIAGEO_DECLARE gaiaLinestringPtr | | GAIAGEO_DECLARE gaiaLinestringPtr | |
| gaiaAddLinestringToGeomColl (gaiaGeomCollPtr p, int vert); | | gaiaAddLinestringToGeomColl (gaiaGeomCollPtr p, int vert); | |
| GAIAGEO_DECLARE void gaiaInsertLinestringInGeomColl (gaiaGeomCollPtr p, | | GAIAGEO_DECLARE void gaiaInsertLinestringInGeomColl (gaiaGeomCollPtr p, | |
| gaiaLinestringPtr | | gaiaLinestringPtr | |
| line); | | line); | |
| GAIAGEO_DECLARE gaiaPolygonPtr gaiaAddPolygonToGeomColl (gaiaGeomCollPt
r p, | | GAIAGEO_DECLARE gaiaPolygonPtr gaiaAddPolygonToGeomColl (gaiaGeomCollPt
r p, | |
| int vert, | | int vert, | |
| int interiors); | | int interiors); | |
| GAIAGEO_DECLARE gaiaPolygonPtr gaiaInsertPolygonInGeomColl (gaiaGeomCol
lPtr | | GAIAGEO_DECLARE gaiaPolygonPtr gaiaInsertPolygonInGeomColl (gaiaGeomCol
lPtr | |
| p, | | p, | |
| | | | |
| skipping to change at line 405 | | skipping to change at line 686 | |
| GAIAGEO_DECLARE gaiaDynamicLinePtr | | GAIAGEO_DECLARE gaiaDynamicLinePtr | |
| gaiaDynamicLineJoinBefore (gaiaDynamicLinePtr org, gaiaPointPtr poin
t, | | gaiaDynamicLineJoinBefore (gaiaDynamicLinePtr org, gaiaPointPtr poin
t, | |
| gaiaDynamicLinePtr toJoin); | | gaiaDynamicLinePtr toJoin); | |
| GAIAGEO_DECLARE gaiaPointPtr gaiaDynamicLineFindByCoords (gaiaDynamicLi
nePtr | | GAIAGEO_DECLARE gaiaPointPtr gaiaDynamicLineFindByCoords (gaiaDynamicLi
nePtr | |
| p, double x, | | p, double x, | |
| double y); | | double y); | |
| GAIAGEO_DECLARE gaiaPointPtr gaiaDynamicLineFindByPos (gaiaDynamicLineP
tr p, | | GAIAGEO_DECLARE gaiaPointPtr gaiaDynamicLineFindByPos (gaiaDynamicLineP
tr p, | |
| int pos); | | int pos); | |
| GAIAGEO_DECLARE gaiaDynamicLinePtr gaiaCreateDynamicLine (double *coord
s, | | GAIAGEO_DECLARE gaiaDynamicLinePtr gaiaCreateDynamicLine (double *coord
s, | |
| int points); | | int points); | |
|
| GAIAGEO_DECLARE double gaiaMeasureLength (double *coords, int vert); | | GAIAGEO_DECLARE double gaiaMeasureLength (int dims, double *coords, | |
| | | int vert); | |
| GAIAGEO_DECLARE double gaiaMeasureArea (gaiaRingPtr ring); | | GAIAGEO_DECLARE double gaiaMeasureArea (gaiaRingPtr ring); | |
| GAIAGEO_DECLARE void gaiaRingCentroid (gaiaRingPtr ring, double *rx, | | GAIAGEO_DECLARE void gaiaRingCentroid (gaiaRingPtr ring, double *rx, | |
| double *ry); | | double *ry); | |
| GAIAGEO_DECLARE void gaiaClockwise (gaiaRingPtr p); | | GAIAGEO_DECLARE void gaiaClockwise (gaiaRingPtr p); | |
| GAIAGEO_DECLARE int gaiaIsPointOnRingSurface (gaiaRingPtr ring, double
pt_x, | | GAIAGEO_DECLARE int gaiaIsPointOnRingSurface (gaiaRingPtr ring, double
pt_x, | |
| double pt_y); | | double pt_y); | |
| GAIAGEO_DECLARE double gaiaMinDistance (double x0, double y0, | | GAIAGEO_DECLARE double gaiaMinDistance (double x0, double y0, | |
|
| double *coords, int n_vert); | | int dims, double *coords, | |
| | | int n_vert); | |
| GAIAGEO_DECLARE int gaiaIsPointOnPolygonSurface (gaiaPolygonPtr polyg, | | GAIAGEO_DECLARE int gaiaIsPointOnPolygonSurface (gaiaPolygonPtr polyg, | |
| double x, double y); | | double x, double y); | |
| GAIAGEO_DECLARE int gaiaIntersect (double *x0, double *y0, double x1, | | GAIAGEO_DECLARE int gaiaIntersect (double *x0, double *y0, double x1, | |
| double y1, double x2, double y2, | | double y1, double x2, double y2, | |
| double x3, double y3, double x4, | | double x3, double y3, double x4, | |
| double y4); | | double y4); | |
| GAIAGEO_DECLARE gaiaGeomCollPtr gaiaFromSpatiaLiteBlobWkb (const unsign
ed | | GAIAGEO_DECLARE gaiaGeomCollPtr gaiaFromSpatiaLiteBlobWkb (const unsign
ed | |
| char *blob, | | char *blob, | |
| unsigned int | | unsigned int | |
| size); | | size); | |
| GAIAGEO_DECLARE void gaiaToSpatiaLiteBlobWkb (gaiaGeomCollPtr geom, | | GAIAGEO_DECLARE void gaiaToSpatiaLiteBlobWkb (gaiaGeomCollPtr geom, | |
| unsigned char **result, | | unsigned char **result, | |
| int *size); | | int *size); | |
|
| | | GAIAGEO_DECLARE void gaiaToCompressedBlobWkb (gaiaGeomCollPtr geom, | |
| | | unsigned char **result, | |
| | | int *size); | |
| GAIAGEO_DECLARE gaiaGeomCollPtr gaiaFromSpatiaLiteBlobMbr (const unsign
ed | | GAIAGEO_DECLARE gaiaGeomCollPtr gaiaFromSpatiaLiteBlobMbr (const unsign
ed | |
| char *blob, | | char *blob, | |
| unsigned int | | unsigned int | |
| size); | | size); | |
| GAIAGEO_DECLARE gaiaGeomCollPtr gaiaFromWkb (const unsigned char *blob, | | GAIAGEO_DECLARE gaiaGeomCollPtr gaiaFromWkb (const unsigned char *blob, | |
| unsigned int size); | | unsigned int size); | |
| GAIAGEO_DECLARE void gaiaToWkb (gaiaGeomCollPtr geom, | | GAIAGEO_DECLARE void gaiaToWkb (gaiaGeomCollPtr geom, | |
| unsigned char **result, int *size); | | unsigned char **result, int *size); | |
|
| GAIAGEO_DECLARE int gaiaFromWkbNoCheck (const unsigned char *in, | | | |
| unsigned int szin, | | | |
| unsigned char **out, int *szout, | | | |
| int srid); | | | |
| GAIAGEO_DECLARE int gaiaToWkbNoCheck (const unsigned char *in, | | | |
| unsigned int szin, | | | |
| unsigned char **out, int *szout); | | | |
| GAIAGEO_DECLARE char *gaiaToHexWkb (gaiaGeomCollPtr geom); | | GAIAGEO_DECLARE char *gaiaToHexWkb (gaiaGeomCollPtr geom); | |
| GAIAGEO_DECLARE void gaiaFreeValue (gaiaValuePtr p); | | GAIAGEO_DECLARE void gaiaFreeValue (gaiaValuePtr p); | |
| GAIAGEO_DECLARE void gaiaSetNullValue (gaiaDbfFieldPtr field); | | GAIAGEO_DECLARE void gaiaSetNullValue (gaiaDbfFieldPtr field); | |
| GAIAGEO_DECLARE void gaiaSetIntValue (gaiaDbfFieldPtr field, | | GAIAGEO_DECLARE void gaiaSetIntValue (gaiaDbfFieldPtr field, | |
| sqlite3_int64 value); | | sqlite3_int64 value); | |
| GAIAGEO_DECLARE void gaiaSetDoubleValue (gaiaDbfFieldPtr field, | | GAIAGEO_DECLARE void gaiaSetDoubleValue (gaiaDbfFieldPtr field, | |
| double value); | | double value); | |
| GAIAGEO_DECLARE void gaiaSetStrValue (gaiaDbfFieldPtr field, char *str)
; | | GAIAGEO_DECLARE void gaiaSetStrValue (gaiaDbfFieldPtr field, char *str)
; | |
| GAIAGEO_DECLARE gaiaDbfFieldPtr gaiaAllocDbfField (char *name, | | GAIAGEO_DECLARE gaiaDbfFieldPtr gaiaAllocDbfField (char *name, | |
| unsigned char type, | | unsigned char type, | |
| | | | |
| skipping to change at line 486 | | skipping to change at line 765 | |
| const char *path, int shape, | | const char *path, int shape, | |
| gaiaDbfListPtr list, | | gaiaDbfListPtr list, | |
| const char *charFrom, | | const char *charFrom, | |
| const char *charTo); | | const char *charTo); | |
| GAIAGEO_DECLARE int gaiaReadShpEntity (gaiaShapefilePtr shp, | | GAIAGEO_DECLARE int gaiaReadShpEntity (gaiaShapefilePtr shp, | |
| int current_row, int srid); | | int current_row, int srid); | |
| GAIAGEO_DECLARE void gaiaShpAnalyze (gaiaShapefilePtr shp); | | GAIAGEO_DECLARE void gaiaShpAnalyze (gaiaShapefilePtr shp); | |
| GAIAGEO_DECLARE int gaiaWriteShpEntity (gaiaShapefilePtr shp, | | GAIAGEO_DECLARE int gaiaWriteShpEntity (gaiaShapefilePtr shp, | |
| gaiaDbfListPtr entity); | | gaiaDbfListPtr entity); | |
| GAIAGEO_DECLARE void gaiaFlushShpHeaders (gaiaShapefilePtr shp); | | GAIAGEO_DECLARE void gaiaFlushShpHeaders (gaiaShapefilePtr shp); | |
|
| | | GAIAGEO_DECLARE gaiaDbfPtr gaiaAllocDbf (void); | |
| | | GAIAGEO_DECLARE void gaiaFreeDbf (gaiaDbfPtr dbf); | |
| | | GAIAGEO_DECLARE void gaiaOpenDbfRead (gaiaDbfPtr dbf, | |
| | | const char *path, | |
| | | const char *charFrom, | |
| | | const char *charTo); | |
| | | GAIAGEO_DECLARE int gaiaReadDbfEntity (gaiaDbfPtr shp, int current_row, | |
| | | int *deleted); | |
| GAIAGEO_DECLARE gaiaGeomCollPtr gaiaParseWkt (const unsigned char | | GAIAGEO_DECLARE gaiaGeomCollPtr gaiaParseWkt (const unsigned char | |
| *dirty_buffer, short type)
; | | *dirty_buffer, short type)
; | |
|
| GAIAGEO_DECLARE void gaiaOutWkt (gaiaGeomCollPtr geom, char **result); | | GAIAGEO_DECLARE void gaiaOutWkt (gaiaOutBufferPtr out_buf, | |
| GAIAGEO_DECLARE void gaiaOutSvg (gaiaGeomCollPtr geom, char **result, | | gaiaGeomCollPtr geom); | |
| int relative, int precision); | | GAIAGEO_DECLARE void gaiaOutSvg (gaiaOutBufferPtr out_buf, | |
| | | gaiaGeomCollPtr geom, int relative, | |
| | | int precision); | |
| | | GAIAGEO_DECLARE void gaiaOutBareKml (gaiaOutBufferPtr out_buf, | |
| | | gaiaGeomCollPtr geom, int precision | |
| | | ); | |
| | | GAIAGEO_DECLARE void gaiaOutFullKml (gaiaOutBufferPtr out_buf, | |
| | | const char *name, const char *desc, | |
| | | gaiaGeomCollPtr geom, int precision | |
| | | ); | |
| | | GAIAGEO_DECLARE void gaiaOutGml (gaiaOutBufferPtr out_buf, int version, | |
| | | int precision, gaiaGeomCollPtr geom); | |
| GAIAGEO_DECLARE gaiaGeomCollPtr gaiaFromFgf (const unsigned char *blob, | | GAIAGEO_DECLARE gaiaGeomCollPtr gaiaFromFgf (const unsigned char *blob, | |
| unsigned int size); | | unsigned int size); | |
| GAIAGEO_DECLARE void gaiaToFgf (gaiaGeomCollPtr geom, | | GAIAGEO_DECLARE void gaiaToFgf (gaiaGeomCollPtr geom, | |
| unsigned char **result, int *size, | | unsigned char **result, int *size, | |
| int coord_dims); | | int coord_dims); | |
| GAIAGEO_DECLARE int gaiaDimension (gaiaGeomCollPtr geom); | | GAIAGEO_DECLARE int gaiaDimension (gaiaGeomCollPtr geom); | |
| GAIAGEO_DECLARE int gaiaGeometryType (gaiaGeomCollPtr geom); | | GAIAGEO_DECLARE int gaiaGeometryType (gaiaGeomCollPtr geom); | |
| GAIAGEO_DECLARE int gaiaGeometryAliasType (gaiaGeomCollPtr geom); | | GAIAGEO_DECLARE int gaiaGeometryAliasType (gaiaGeomCollPtr geom); | |
| GAIAGEO_DECLARE int gaiaIsEmpty (gaiaGeomCollPtr geom); | | GAIAGEO_DECLARE int gaiaIsEmpty (gaiaGeomCollPtr geom); | |
| GAIAGEO_DECLARE int gaiaMbrsContains (gaiaGeomCollPtr mbr1, | | GAIAGEO_DECLARE int gaiaMbrsContains (gaiaGeomCollPtr mbr1, | |
| | | | |
| skipping to change at line 522 | | skipping to change at line 818 | |
| GAIAGEO_DECLARE int gaiaMbrsWithin (gaiaGeomCollPtr mbr1, | | GAIAGEO_DECLARE int gaiaMbrsWithin (gaiaGeomCollPtr mbr1, | |
| gaiaGeomCollPtr mbr2); | | gaiaGeomCollPtr mbr2); | |
| GAIAGEO_DECLARE void gaiaShiftCoords (gaiaGeomCollPtr geom, double shif
t_x, | | GAIAGEO_DECLARE void gaiaShiftCoords (gaiaGeomCollPtr geom, double shif
t_x, | |
| double shift_y); | | double shift_y); | |
| GAIAGEO_DECLARE void gaiaScaleCoords (gaiaGeomCollPtr geom, double scal
e_x, | | GAIAGEO_DECLARE void gaiaScaleCoords (gaiaGeomCollPtr geom, double scal
e_x, | |
| double scale_y); | | double scale_y); | |
| GAIAGEO_DECLARE void gaiaRotateCoords (gaiaGeomCollPtr geom, double ang
le); | | GAIAGEO_DECLARE void gaiaRotateCoords (gaiaGeomCollPtr geom, double ang
le); | |
| GAIAGEO_DECLARE void gaiaReflectCoords (gaiaGeomCollPtr geom, int x_axi
s, | | GAIAGEO_DECLARE void gaiaReflectCoords (gaiaGeomCollPtr geom, int x_axi
s, | |
| int y_axis); | | int y_axis); | |
| GAIAGEO_DECLARE void gaiaSwapCoords (gaiaGeomCollPtr geom); | | GAIAGEO_DECLARE void gaiaSwapCoords (gaiaGeomCollPtr geom); | |
|
| | | GAIAGEO_DECLARE gaiaGeomCollPtr gaiaCastGeomCollToXY (gaiaGeomCollPtr g | |
| | | eom); | |
| | | GAIAGEO_DECLARE gaiaGeomCollPtr gaiaCastGeomCollToXYZ (gaiaGeomCollPtr | |
| | | geom); | |
| | | GAIAGEO_DECLARE gaiaGeomCollPtr gaiaCastGeomCollToXYM (gaiaGeomCollPtr | |
| | | geom); | |
| | | GAIAGEO_DECLARE gaiaGeomCollPtr gaiaCastGeomCollToXYZM (gaiaGeomCollPtr | |
| | | geom); | |
| GAIAGEO_DECLARE gaiaGeomCollPtr gaiaCloneGeomColl (gaiaGeomCollPtr geom
); | | GAIAGEO_DECLARE gaiaGeomCollPtr gaiaCloneGeomColl (gaiaGeomCollPtr geom
); | |
| GAIAGEO_DECLARE gaiaLinestringPtr gaiaCloneLinestring (gaiaLinestringPt
r | | GAIAGEO_DECLARE gaiaLinestringPtr gaiaCloneLinestring (gaiaLinestringPt
r | |
| line); | | line); | |
| GAIAGEO_DECLARE gaiaRingPtr gaiaCloneRing (gaiaRingPtr ring); | | GAIAGEO_DECLARE gaiaRingPtr gaiaCloneRing (gaiaRingPtr ring); | |
| GAIAGEO_DECLARE gaiaPolygonPtr gaiaClonePolygon (gaiaPolygonPtr polyg); | | GAIAGEO_DECLARE gaiaPolygonPtr gaiaClonePolygon (gaiaPolygonPtr polyg); | |
| GAIAGEO_DECLARE int gaiaLinestringEquals (gaiaLinestringPtr line1, | | GAIAGEO_DECLARE int gaiaLinestringEquals (gaiaLinestringPtr line1, | |
| gaiaLinestringPtr line2); | | gaiaLinestringPtr line2); | |
| GAIAGEO_DECLARE int gaiaPolygonEquals (gaiaPolygonPtr geom1, | | GAIAGEO_DECLARE int gaiaPolygonEquals (gaiaPolygonPtr geom1, | |
| gaiaPolygonPtr geom2); | | gaiaPolygonPtr geom2); | |
| GAIAGEO_DECLARE void gaiaMakePoint (double x, double y, int srid, | | GAIAGEO_DECLARE void gaiaMakePoint (double x, double y, int srid, | |
| | | | |
| skipping to change at line 555 | | skipping to change at line 858 | |
| int *size); | | int *size); | |
| GAIAGEO_DECLARE int gaiaGetMbrMinX (const unsigned char *blob, | | GAIAGEO_DECLARE int gaiaGetMbrMinX (const unsigned char *blob, | |
| unsigned int size, double *minx); | | unsigned int size, double *minx); | |
| GAIAGEO_DECLARE int gaiaGetMbrMaxX (const unsigned char *blob, | | GAIAGEO_DECLARE int gaiaGetMbrMaxX (const unsigned char *blob, | |
| unsigned int size, double *maxx); | | unsigned int size, double *maxx); | |
| GAIAGEO_DECLARE int gaiaGetMbrMinY (const unsigned char *blob, | | GAIAGEO_DECLARE int gaiaGetMbrMinY (const unsigned char *blob, | |
| unsigned int size, double *miny); | | unsigned int size, double *miny); | |
| GAIAGEO_DECLARE int gaiaGetMbrMaxY (const unsigned char *blob, | | GAIAGEO_DECLARE int gaiaGetMbrMaxY (const unsigned char *blob, | |
| unsigned int size, double *maxy); | | unsigned int size, double *maxy); | |
| GAIAGEO_DECLARE gaiaGeomCollPtr gaiaBuildRings (gaiaGeomCollPtr geom); | | GAIAGEO_DECLARE gaiaGeomCollPtr gaiaBuildRings (gaiaGeomCollPtr geom); | |
|
| | | GAIAGEO_DECLARE void gaiaFree (void *ptr); | |
| | | GAIAGEO_DECLARE int gaiaEllipseParams (const char *name, double *a, | |
| | | double *b, double *rf); | |
| | | GAIAGEO_DECLARE double gaiaGreatCircleDistance (double a, double b, | |
| | | double lat1, double lon1 | |
| | | , | |
| | | double lat2, double lon2 | |
| | | ); | |
| | | GAIAGEO_DECLARE double gaiaGeodesicDistance (double a, double b, double | |
| | | rf, | |
| | | double lat1, double lon1, | |
| | | double lat2, double lon2); | |
| | | GAIAGEO_DECLARE double gaiaGreatCircleTotalLength (double a, double b, | |
| | | int dims, double *coo | |
| | | rds, | |
| | | int vert); | |
| | | GAIAGEO_DECLARE double gaiaGeodesicTotalLength (double a, double b, | |
| | | double rf, int dims, | |
| | | double *coords, int vert | |
| | | ); | |
| | | GAIAGEO_DECLARE int gaiaConvertLength (double value, int unit_from, | |
| | | int unit_to, double *cvt); | |
| | | GAIAGEO_DECLARE int gaiaLineGetPoint (gaiaLinestringPtr ln, int v, | |
| | | double *x, double *y, double *z, | |
| | | double *m); | |
| | | GAIAGEO_DECLARE int gaiaLineSetPoint (gaiaLinestringPtr ln, int v, doub | |
| | | le x, | |
| | | double y, double z, double m); | |
| | | GAIAGEO_DECLARE int gaiaRingGetPoint (gaiaRingPtr rng, int v, double *x | |
| | | , | |
| | | double *y, double *z, double *m); | |
| | | GAIAGEO_DECLARE int gaiaRingSetPoint (gaiaRingPtr rng, int v, double x, | |
| | | double y, double z, double m); | |
| | | GAIAGEO_DECLARE gaiaGeomCollPtr gaiaSanitize (gaiaGeomCollPtr org); | |
| | | GAIAGEO_DECLARE int gaiaIsToxic (gaiaGeomCollPtr org); | |
| | | GAIAGEO_DECLARE void gaiaOutBufferInitialize (gaiaOutBufferPtr buf); | |
| | | GAIAGEO_DECLARE void gaiaOutBufferReset (gaiaOutBufferPtr buf); | |
| | | GAIAGEO_DECLARE void gaiaAppendToOutBuffer (gaiaOutBufferPtr buf, | |
| | | const char *text); | |
| | | | |
| #ifndef OMIT_PROJ /* including PROJ.4 */ | | #ifndef OMIT_PROJ /* including PROJ.4 */ | |
| | | | |
| GAIAGEO_DECLARE double gaiaRadsToDegs (double rads); | | GAIAGEO_DECLARE double gaiaRadsToDegs (double rads); | |
| GAIAGEO_DECLARE double gaiaDegsToRads (double degs); | | GAIAGEO_DECLARE double gaiaDegsToRads (double degs); | |
| GAIAGEO_DECLARE gaiaGeomCollPtr gaiaTransform (gaiaGeomCollPtr org, | | GAIAGEO_DECLARE gaiaGeomCollPtr gaiaTransform (gaiaGeomCollPtr org, | |
| char *proj_from, | | char *proj_from, | |
| char *proj_to); | | char *proj_to); | |
| | | | |
| #endif /* end including PROJ.4 */ | | #endif /* end including PROJ.4 */ | |
| | | | |
| #ifndef OMIT_GEOS /* including GEOS */ | | #ifndef OMIT_GEOS /* including GEOS */ | |
| | | | |
|
| | | GAIAGEO_DECLARE void gaiaResetGeosMsg (void); | |
| | | GAIAGEO_DECLARE const char *gaiaGetGeosErrorMsg (void); | |
| | | GAIAGEO_DECLARE const char *gaiaGetGeosWarningMsg (void); | |
| | | GAIAGEO_DECLARE void gaiaSetGeosErrorMsg (const char *msg); | |
| | | GAIAGEO_DECLARE void gaiaSetGeosWarningMsg (const char *msg); | |
| | | | |
| GAIAGEO_DECLARE int gaiaGeomCollEquals (gaiaGeomCollPtr geom1, | | GAIAGEO_DECLARE int gaiaGeomCollEquals (gaiaGeomCollPtr geom1, | |
| gaiaGeomCollPtr geom2); | | gaiaGeomCollPtr geom2); | |
| GAIAGEO_DECLARE int gaiaGeomCollDisjoint (gaiaGeomCollPtr geom1, | | GAIAGEO_DECLARE int gaiaGeomCollDisjoint (gaiaGeomCollPtr geom1, | |
| gaiaGeomCollPtr geom2); | | gaiaGeomCollPtr geom2); | |
| GAIAGEO_DECLARE int gaiaGeomCollIntersects (gaiaGeomCollPtr geom1, | | GAIAGEO_DECLARE int gaiaGeomCollIntersects (gaiaGeomCollPtr geom1, | |
| gaiaGeomCollPtr geom2); | | gaiaGeomCollPtr geom2); | |
| GAIAGEO_DECLARE int gaiaGeomCollOverlaps (gaiaGeomCollPtr geom1, | | GAIAGEO_DECLARE int gaiaGeomCollOverlaps (gaiaGeomCollPtr geom1, | |
| gaiaGeomCollPtr geom2); | | gaiaGeomCollPtr geom2); | |
| GAIAGEO_DECLARE int gaiaGeomCollCrosses (gaiaGeomCollPtr geom1, | | GAIAGEO_DECLARE int gaiaGeomCollCrosses (gaiaGeomCollPtr geom1, | |
| gaiaGeomCollPtr geom2); | | gaiaGeomCollPtr geom2); | |
| | | | |
| skipping to change at line 627 | | skipping to change at line 968 | |
| GAIAGEO_DECLARE int gaiaIsSimple (gaiaGeomCollPtr geom); | | GAIAGEO_DECLARE int gaiaIsSimple (gaiaGeomCollPtr geom); | |
| GAIAGEO_DECLARE int gaiaIsClosed (gaiaLinestringPtr line); | | GAIAGEO_DECLARE int gaiaIsClosed (gaiaLinestringPtr line); | |
| GAIAGEO_DECLARE int gaiaIsRing (gaiaLinestringPtr line); | | GAIAGEO_DECLARE int gaiaIsRing (gaiaLinestringPtr line); | |
| GAIAGEO_DECLARE int gaiaIsValid (gaiaGeomCollPtr geom); | | GAIAGEO_DECLARE int gaiaIsValid (gaiaGeomCollPtr geom); | |
| GAIAGEO_DECLARE gaiaGeomCollPtr gaiaConvexHull (gaiaGeomCollPtr geom); | | GAIAGEO_DECLARE gaiaGeomCollPtr gaiaConvexHull (gaiaGeomCollPtr geom); | |
| GAIAGEO_DECLARE gaiaGeomCollPtr gaiaGeomCollBuffer (gaiaGeomCollPtr geo
m, | | GAIAGEO_DECLARE gaiaGeomCollPtr gaiaGeomCollBuffer (gaiaGeomCollPtr geo
m, | |
| double radius, | | double radius, | |
| int points); | | int points); | |
| GAIAGEO_DECLARE gaiaGeomCollPtr gaiaPolygonize (gaiaGeomCollPtr geom, | | GAIAGEO_DECLARE gaiaGeomCollPtr gaiaPolygonize (gaiaGeomCollPtr geom, | |
| int force_multipolygon); | | int force_multipolygon); | |
|
| | | GAIAGEO_DECLARE void *gaiaToGeos (const gaiaGeomCollPtr gaia); | |
| | | GAIAGEO_DECLARE gaiaGeomCollPtr gaiaFromGeos_XY (const void *geos); | |
| | | GAIAGEO_DECLARE gaiaGeomCollPtr gaiaFromGeos_XYZ (const void *geos); | |
| | | GAIAGEO_DECLARE gaiaGeomCollPtr gaiaFromGeos_XYM (const void *geos); | |
| | | GAIAGEO_DECLARE gaiaGeomCollPtr gaiaFromGeos_XYZM (const void *geos); | |
| | | | |
| #endif /* end including GEOS */ | | #endif /* end including GEOS */ | |
| | | | |
|
| | | #ifndef OMIT_ICONV /* ICONV enabled: supporting text reader */ | |
| | | GAIAGEO_DECLARE gaiaTextReaderPtr gaiaTextReaderAlloc (const char *path | |
| | | , | |
| | | char field_separa | |
| | | tor, | |
| | | char text_separat | |
| | | or, | |
| | | char | |
| | | decimal_separator | |
| | | , | |
| | | int | |
| | | first_line_titles | |
| | | , | |
| | | const char | |
| | | *encoding); | |
| | | GAIAGEO_DECLARE void gaiaTextReaderDestroy (gaiaTextReaderPtr reader); | |
| | | GAIAGEO_DECLARE int gaiaTextReaderParse (gaiaTextReaderPtr reader); | |
| | | GAIAGEO_DECLARE int gaiaTextReaderGetRow (gaiaTextReaderPtr reader, | |
| | | int row_num); | |
| | | GAIAGEO_DECLARE int gaiaTextReaderFetchField (gaiaTextReaderPtr reader, | |
| | | int field_num, int *type, | |
| | | const char **value); | |
| | | #endif /* end ICONV (text reader) */ | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| } | | } | |
| #endif | | #endif | |
| | | | |
| #endif /* _GAIAGEO_H */ | | #endif /* _GAIAGEO_H */ | |
| | | | |
End of changes. 45 change blocks. |
| 42 lines changed or deleted | | 433 lines changed or added | |
|