Changeset: 5d746f541f69 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=5d746f541f69
Modified Files:
        geom/lib/libgeom.c
        geom/lib/libgeom.h
        geom/monetdb5/geom.c
        geom/monetdb5/geom_upgrade.c
Branch: default
Log Message:

Modified the wkb types to avoid the clash with the respective GDAL types


diffs (truncated from 592 to 300 lines):

diff --git a/geom/lib/libgeom.c b/geom/lib/libgeom.c
--- a/geom/lib/libgeom.c
+++ b/geom/lib/libgeom.c
@@ -130,21 +130,21 @@ const char* geom_type2str(int t, int fla
                switch (t) {
                //case wkbGeometry:
                //      return "GEOMETRY";
-               case wkbPoint:
+               case wkbPoint_mdb:
                        return "POINT";
-               case wkbLineString:
+               case wkbLineString_mdb:
                        return "LINESTRING";
-               case wkbLinearRing:
+               case wkbLinearRing_mdb:
                        return "LINEARRING";
-               case wkbPolygon:
+               case wkbPolygon_mdb:
                        return "POLYGON";
-               case wkbMultiPoint:
+               case wkbMultiPoint_mdb:
                        return "MULTIPOINT";
-               case wkbMultiLineString:
+               case wkbMultiLineString_mdb:
                        return "MULTILINESTRING";
-               case wkbMultiPolygon:
+               case wkbMultiPolygon_mdb:
                        return "MULTIPOLYGON";
-               case wkbGeometryCollection:
+               case wkbGeometryCollection_mdb:
                        return "GEOMETRYCOLLECTION";
                } 
        }
@@ -152,21 +152,21 @@ const char* geom_type2str(int t, int fla
                switch (t) {
                //case wkbGeometry:
                //      return "ST_Geometry";
-               case wkbPoint:
+               case wkbPoint_mdb:
                        return "ST_Point";
-               case wkbLineString:
+               case wkbLineString_mdb:
                        return "ST_LineString";
-               case wkbLinearRing:
+               case wkbLinearRing_mdb:
                        return "ST_LinearRing";
-               case wkbPolygon:
+               case wkbPolygon_mdb:
                        return "ST_Polygon";
-               case wkbMultiPoint:
+               case wkbMultiPoint_mdb:
                        return "ST_MultiPoint";
-               case wkbMultiLineString:
+               case wkbMultiLineString_mdb:
                        return "ST_MultiLinestring";
-               case wkbMultiPolygon:
+               case wkbMultiPolygon_mdb:
                        return "ST_MultiPolygon";
-               case wkbGeometryCollection:
+               case wkbGeometryCollection_mdb:
                        return "ST_GeometryCollection";
                }
        }
diff --git a/geom/lib/libgeom.h b/geom/lib/libgeom.h
--- a/geom/lib/libgeom.h
+++ b/geom/lib/libgeom.h
@@ -94,15 +94,15 @@ 11 = MULTIPOLYGON
 */
 
 typedef enum wkb_type {
-       //wkbGeometry = 0,
-       wkbPoint = 1,
-       wkbLineString = 2,
-       wkbLinearRing = 3,
-       wkbPolygon = 4,
-       wkbMultiPoint = 5,
-       wkbMultiLineString = 6,
-       wkbMultiPolygon = 7,
-       wkbGeometryCollection = 8
+       //wkbGeometry_mbd = 0,
+       wkbPoint_mdb = 1,
+       wkbLineString_mdb = 2,
+       wkbLinearRing_mdb = 3,
+       wkbPolygon_mdb = 4,
+       wkbMultiPoint_mdb = 5,
+       wkbMultiLineString_mdb = 6,
+       wkbMultiPolygon_mdb = 7,
+       wkbGeometryCollection_mdb = 8
 } wkb_type;
 
 libgeom_export const char *geom_type2str(int t, int flag);
diff --git a/geom/monetdb5/geom.c b/geom/monetdb5/geom.c
--- a/geom/monetdb5/geom.c
+++ b/geom/monetdb5/geom.c
@@ -247,16 +247,16 @@ static str transformMultiGeometry(GEOSGe
                subGeometryType = GEOSGeomTypeId(multiGeometry)+1;
 
                switch(subGeometryType) {
-               case wkbPoint:
+               case wkbPoint_mdb:
                        ret = transformPoint(&(transformedMultiGeometries[i]), 
multiGeometry, proj4_src, proj4_dst);
                        break;
-               case wkbLineString:
+               case wkbLineString_mdb:
                        ret = 
transformLineString(&(transformedMultiGeometries[i]), multiGeometry, proj4_src, 
proj4_dst);
                        break;
-               case wkbLinearRing:
+               case wkbLinearRing_mdb:
                        ret = 
transformLinearRing(&(transformedMultiGeometries[i]), multiGeometry, proj4_src, 
proj4_dst);
                        break;
-               case wkbPolygon:
+               case wkbPolygon_mdb:
                        ret = 
transformPolygon(&(transformedMultiGeometries[i]), multiGeometry, proj4_src, 
proj4_dst, srid);
                        break;
                default:
@@ -363,21 +363,21 @@ str wkbTransform(wkb** transformedWKB, w
        geometryType = GEOSGeomTypeId(geosGeometry)+1;
 
        switch(geometryType) {
-       case wkbPoint:
+       case wkbPoint_mdb:
                ret = transformPoint(&transformedGeosGeometry, geosGeometry, 
proj4_src, proj4_dst);
                break;
-       case wkbLineString:
+       case wkbLineString_mdb:
                ret = transformLineString(&transformedGeosGeometry, 
geosGeometry, proj4_src, proj4_dst);
                break;
-       case wkbLinearRing:
+       case wkbLinearRing_mdb:
                ret = transformLinearRing(&transformedGeosGeometry, 
geosGeometry, proj4_src, proj4_dst);
                break;
-       case wkbPolygon:
+       case wkbPolygon_mdb:
                ret = transformPolygon(&transformedGeosGeometry, geosGeometry, 
proj4_src, proj4_dst, *srid_dst);
                break;
-       case wkbMultiPoint:
-       case wkbMultiLineString:
-       case wkbMultiPolygon:
+       case wkbMultiPoint_mdb:
+       case wkbMultiLineString_mdb:
+       case wkbMultiPolygon_mdb:
                ret = transformMultiGeometry(&transformedGeosGeometry, 
geosGeometry, proj4_src, proj4_dst, *srid_dst, geometryType);
                break;
        default:
@@ -607,32 +607,32 @@ static str forceDimGeometry(GEOSGeometry
 
        //check the type of the geometry
        switch(geometryType) {
-       case wkbPoint:
+       case wkbPoint_mdb:
                if((err = forceDimPoint(outGeometry, geosGeometry, dim)) != 
MAL_SUCCEED){
                        str msg = createException(MAL, "geom.ForceDim", 
"%s",err);
                        GDKfree(err);
                        return msg;
                }
                break;
-       case wkbLineString:
-       case wkbLinearRing:
+       case wkbLineString_mdb:
+       case wkbLinearRing_mdb:
                if((err = forceDimLineString(outGeometry, geosGeometry, dim)) 
!= MAL_SUCCEED){
                        str msg = createException(MAL, "geom.ForceDim", 
"%s",err);
                        GDKfree(err);
                        return msg;
                }
                break;
-       case wkbPolygon:
+       case wkbPolygon_mdb:
                if((err = forceDimPolygon(outGeometry, geosGeometry, dim)) != 
MAL_SUCCEED){
                        str msg = createException(MAL, "geom.ForceDim", 
"%s",err);
                        GDKfree(err);
                        return msg;
                }
                break;
-       case wkbMultiPoint:
-       case wkbMultiLineString:
-       case wkbMultiPolygon:
-       case wkbGeometryCollection:
+       case wkbMultiPoint_mdb:
+       case wkbMultiLineString_mdb:
+       case wkbMultiPolygon_mdb:
+       case wkbGeometryCollection_mdb:
                if((err = forceDimMultiGeometry(outGeometry, geosGeometry, 
dim)) != MAL_SUCCEED){
                        str msg = createException(MAL, "geom.ForceDim", 
"%s",err);
                        GDKfree(err);
@@ -940,32 +940,32 @@ static str segmentizeGeometry(GEOSGeomet
 
        //check the type of the geometry
        switch(geometryType) {
-       case wkbPoint:
+       case wkbPoint_mdb:
                if((err = segmentizePoint(outGeometry, geosGeometry, sz)) != 
MAL_SUCCEED){
                        str msg = createException(MAL, "geom.Segmentize", 
"%s",err);
                        GDKfree(err);
                        return msg;
                }
                break;
-       case wkbLineString:
-       case wkbLinearRing:
+       case wkbLineString_mdb:
+       case wkbLinearRing_mdb:
                if((err = segmentizeLineString(outGeometry, geosGeometry, sz, 
0)) != MAL_SUCCEED){
                        str msg = createException(MAL, "geom.Segmentize", 
"%s",err);
                        GDKfree(err);
                        return msg;
                }
                break;
-       case wkbPolygon:
+       case wkbPolygon_mdb:
                if((err = segmentizePolygon(outGeometry, geosGeometry, sz)) != 
MAL_SUCCEED){
                        str msg = createException(MAL, "geom.Segmentize", 
"%s",err);
                        GDKfree(err);
                        return msg;
                }
                break;
-       case wkbMultiPoint:
-       case wkbMultiLineString:
-       case wkbMultiPolygon:
-       case wkbGeometryCollection:
+       case wkbMultiPoint_mdb:
+       case wkbMultiLineString_mdb:
+       case wkbMultiPolygon_mdb:
+       case wkbGeometryCollection_mdb:
                if((err = segmentizeMultiGeometry(outGeometry, geosGeometry, 
sz)) != MAL_SUCCEED){
                        str msg = createException(MAL, "geom.Segmentize", 
"%s",err);
                        GDKfree(err);
@@ -1228,32 +1228,32 @@ static str translateGeometry(GEOSGeometr
 
        //check the type of the geometry
        switch(geometryType) {
-       case wkbPoint:
+       case wkbPoint_mdb:
                if((err = translatePoint(outGeometry, geosGeometry, dx, dy, 
dz)) != MAL_SUCCEED){
                        str msg = createException(MAL, "geom.Translate", 
"%s",err);
                        GDKfree(err);
                        return msg;
                }
                break;
-       case wkbLineString:
-       case wkbLinearRing:
+       case wkbLineString_mdb:
+       case wkbLinearRing_mdb:
                if((err = translateLineString(outGeometry, geosGeometry, dx, 
dy, dz)) != MAL_SUCCEED){
                        str msg = createException(MAL, "geom.Translate", 
"%s",err);
                        GDKfree(err);
                        return msg;
                }
                break;
-       case wkbPolygon:
+       case wkbPolygon_mdb:
                if((err = translatePolygon(outGeometry, geosGeometry, dx, dy, 
dz)) != MAL_SUCCEED){
                        str msg = createException(MAL, "geom.Translate", 
"%s",err);
                        GDKfree(err);
                        return msg;
                }
                break;
-       case wkbMultiPoint:
-       case wkbMultiLineString:
-       case wkbMultiPolygon:
-       case wkbGeometryCollection:
+       case wkbMultiPoint_mdb:
+       case wkbMultiLineString_mdb:
+       case wkbMultiPolygon_mdb:
+       case wkbGeometryCollection_mdb:
                if((err = translateMultiGeometry(outGeometry, geosGeometry, dx, 
dy, dz)) != MAL_SUCCEED){
                        str msg = createException(MAL, "geom.Translate", 
"%s",err);
                        GDKfree(err);
@@ -1429,10 +1429,10 @@ static str dumpGeometriesGeometry(BAT* i
 
        //check the type of the geometry
        switch(geometryType) {
-       case wkbPoint:
-       case wkbLineString:
-       case wkbLinearRing:
-       case wkbPolygon:
+       case wkbPoint_mdb:
+       case wkbLineString_mdb:
+       case wkbLinearRing_mdb:
+       case wkbPolygon_mdb:
                //Single Geometry
                if((err = dumpGeometriesSingle(idBAT, geomBAT, geosGeometry, 
&lvl, path)) != MAL_SUCCEED){
                        str msg = createException(MAL, "geom.Dump", "%s",err);
@@ -1440,10 +1440,10 @@ static str dumpGeometriesGeometry(BAT* i
                        return msg;
                }
                break;
-       case wkbMultiPoint:
-       case wkbMultiLineString:
-       case wkbMultiPolygon:
-       case wkbGeometryCollection:
+       case wkbMultiPoint_mdb:
+       case wkbMultiLineString_mdb:
+       case wkbMultiPolygon_mdb:
+       case wkbGeometryCollection_mdb:
                //Multi Geometry
                //check if the geometry was empty
                if(GEOSisEmpty(geosGeometry) == 1) {
@@ -1695,32 +1695,32 @@ static str dumpPointsGeometry(BAT* idBAT
 
        //check the type of the geometry
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to