[postgis-users] Compilation error postgis_geos_wrapper.c

Paul Ramsey pramsey at refractions.net
Tue Oct 14 09:18:09 PDT 2003


Does the const'ed version of GEOS currently compile and run all tests?
Paul

strk wrote:

> Here is a context diff
> 
> --strk;
> 
> ---8<-------------------------------------------------------------
> 
> Index: postgis_geos_wrapper.cpp
> ===================================================================
> RCS file: /home/cvs/postgis/postgis/postgis_geos_wrapper.cpp,v
> retrieving revision 1.7
> diff -c -r1.7 postgis_geos_wrapper.cpp
> *** postgis_geos_wrapper.cpp    3 Oct 2003 16:45:37 -0000       1.7
> --- postgis_geos_wrapper.cpp    14 Oct 2003 09:34:33 -0000
> ***************
> *** 102,110 ****
>   extern "C" POINT3D  *GEOSGetCoordinate(Geometry *g1);
>   extern "C" POINT3D  *GEOSGetCoordinates(Geometry *g1);
>   extern "C" int      GEOSGetNumCoordinate(Geometry *g1);
> ! extern "C" Geometry *GEOSGetGeometryN(Geometry *g1, int n);
> ! extern "C" Geometry *GEOSGetExteriorRing(Geometry *g1);
> ! extern "C" Geometry *GEOSGetInteriorRingN(Geometry *g1, int n);
>   extern "C" int      GEOSGetNumInteriorRings(Geometry *g1);
>   extern "C" int      GEOSGetSRID(Geometry *g1);
>   extern "C" int      GEOSGetNumGeometries(Geometry *g1);
> --- 102,110 ----
>   extern "C" POINT3D  *GEOSGetCoordinate(Geometry *g1);
>   extern "C" POINT3D  *GEOSGetCoordinates(Geometry *g1);
>   extern "C" int      GEOSGetNumCoordinate(Geometry *g1);
> ! extern "C" const Geometry *GEOSGetGeometryN(Geometry *g1, int n);
> ! extern "C" const Geometry *GEOSGetExteriorRing(Geometry *g1);
> ! extern "C" const Geometry *GEOSGetInteriorRingN(Geometry *g1, int n);
>   extern "C" int      GEOSGetNumInteriorRings(Geometry *g1);
>   extern "C" int      GEOSGetSRID(Geometry *g1);
>   extern "C" int      GEOSGetNumGeometries(Geometry *g1);
> ***************
> *** 836,842 ****
>   {
>         try{
>                 POINT3D         *result = (POINT3D*) malloc (sizeof(POINT3D));
> !               Coordinate *c =g1->getCoordinate();
> 
>                 result->x = c->x;
>                 result->y = c->y;
> --- 836,842 ----
>   {
>         try{
>                 POINT3D         *result = (POINT3D*) malloc (sizeof(POINT3D));
> !               const Coordinate *c =g1->getCoordinate();
> 
>                 result->x = c->x;
>                 result->y = c->y;
> ***************
> *** 922,931 ****
> 
> 
>   //call only on GEOMETRYCOLLECTION or MULTI*
> ! Geometry *GEOSGetGeometryN(Geometry *g1, int n)
>   {
>         try{
> !               GeometryCollection *gc = (GeometryCollection *) g1;
>                 return gc->getGeometryN(n);
>         }
>         catch(...)
> --- 922,931 ----
> 
> 
>   //call only on GEOMETRYCOLLECTION or MULTI*
> ! const Geometry *GEOSGetGeometryN(Geometry *g1, int n)
>   {
>         try{
> !               const GeometryCollection *gc = (GeometryCollection *) g1;
>                 return gc->getGeometryN(n);
>         }
>         catch(...)
> ***************
> *** 936,942 ****
> 
> 
>   //call only on polygon
> ! Geometry *GEOSGetExteriorRing(Geometry *g1)
>   {
>         try{
>                 Polygon *p = (Polygon *) g1;
> --- 936,942 ----
> 
> 
>   //call only on polygon
> ! const Geometry *GEOSGetExteriorRing(Geometry *g1)
>   {
>         try{
>                 Polygon *p = (Polygon *) g1;
> ***************
> *** 949,955 ****
>   }
> 
>   //call only on polygon
> ! Geometry *GEOSGetInteriorRingN(Geometry *g1,int n)
>   {
>         try{
>                 Polygon *p = (Polygon *) g1;
> --- 949,955 ----
>   }
> 
>   //call only on polygon
> ! const Geometry *GEOSGetInteriorRingN(Geometry *g1,int n)
>   {
>         try{
>                 Polygon *p = (Polygon *) g1;
> 
> ---8<-------------------------------------------------------------
> 
> Horst.Duester wrote:
> 
>>During compilation of PostGIS with GEOS the compilation process breaks with
>>the following error message:
>> 
>>c++ -O2 -Wall -Wmissing-prototypes -Wmissing-declarations -g -fexceptions
>>-I. -DFRO
>>NTEND -DSYSCONFDIR='"/home/hdus/local/etc/postgresql"'  -DUSE_VERSION=72
>>-I/home/hdus
>>/local/include/geos -DUSE_GEOS -I../../src/include   -c -o
>>postgis_geos_wrapper.o pos
>>tgis_geos_wrapper.cpp
>>postgis_geos_wrapper.cpp: In function `POINT3D *GEOSGetCoordinate
>>(geos::Geometry *)':
>>postgis_geos_wrapper.cpp:839: cannot convert `const geos::Coordinate *'
>>to `geos::Coordinate *' in initialization
>>postgis_geos_wrapper.cpp: In function `geos::Geometry *GEOSGetGeometryN
>>(geos::Geometry *, int)':
>>postgis_geos_wrapper.cpp:929: cannot convert `const geos::Geometry *'
>>to `geos::Geometry *' in return
>>postgis_geos_wrapper.cpp: In function `geos::Geometry
>>*GEOSGetExteriorRing (geos::Geometry *)':
>>postgis_geos_wrapper.cpp:943: cannot convert `const geos::LineString *'
>>to `geos::Geometry *' in return
>>postgis_geos_wrapper.cpp: In function `geos::Geometry
>>*GEOSGetInteriorRingN (geos::Geometry *, int)':
>>postgis_geos_wrapper.cpp:956: cannot convert `const geos::LineString *'
>>to `geos::Geometry *' in return
>>make: *** [postgis_geos_wrapper.o] Error 1
>> 
>>GEOS_20031014
>>Postgis-cvs from today
>>PostgreSQL 7.2.4
>> 
>>Any hint???
>> 
>>With best regards 
>> 
>>
>>Dr. Horst Düster 
>>Leiter 
>>Abteilung SO!GIS Koordination
>>Rötihof 
>>4500 Solothurn 
>>
>>Tel.: 032 627 25 32 
>>Fax: 032 627 22 14
>>
>>horst.duester at bd.so.ch <mailto:horst.duester at bd.so.ch> 
>>www.sogis.so.ch <http://www.sogis.so.ch/> 
>>
>>
>> 
>>
>>_______________________________________________
>>postgis-users mailing list
>>postgis-users at postgis.refractions.net
>>http://postgis.refractions.net/mailman/listinfo/postgis-users
> 
> 
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users


-- 
       __
      /
      | Paul Ramsey
      | Refractions Research
      | Email: pramsey at refractions.net
      | Phone: (250) 885-0632
      \_




More information about the postgis-users mailing list