[geos-devel] Some C API Issues
strk at refractions.net
strk at refractions.net
Tue Jun 27 11:34:55 EDT 2006
(1) and (2) committed.
For (3) the returned object is really a Geometry (a Polygon) so nothing
should blow up.
About exposing the Envelope class, what would you use it for exactly ?
(next you'd want indexes...)
We should really provide unit tests for the C api at this stage.
--strk;
On Sat, Jun 24, 2006 at 10:21:03PM -0600, Charlie Savage wrote:
> Some issues with the c api.
>
>
> 1. It looks like GEOSCoordSeq_getOrdinate is missing a coordinate
> sequence as its first parameter.
>
>
> ===================================================================
> RCS file: /home/cvs/postgis/geos/capi/geos_c.cpp,v
> retrieving revision 1.24
> diff -u -r1.24 geos_c.cpp
> --- capi/geos_c.cpp 5 Jun 2006 15:36:34 -0000 1.24
> +++ capi/geos_c.cpp 25 Jun 2006 02:59:02 -0000
>
> -extern "C" int GEOS_DLL GEOSCoordSeq_getOrdinate(unsigned int, unsigned
> int, double *);
> +extern "C" int GEOS_DLL GEOSCoordSeq_getOrdinate(CoordinateSequence *,
> unsigned int, unsigned int, double *);
>
>
> 2. There is an enum GEOSGeomTypeId in geos_c.h but also a method with
> the same name. This makes VC++ 2005 unhappy. Can the enum be renamed
> to something like GEOSGeomTypes?
>
>
> 3. You can get an Envelope from a Geometry, but its returned to you as
> a GEOSGeom. But an Envelope is not a geometry. If you get one, and
> then use it some of the methods like Intersects, won't things blow up?
> Also, in my existing code I make use of a fair bit of the Envelope api
> (width, height, etc.). Any chance this can be exposed in the C api?
>
> Thanks,
>
> Charlie
More information about the geos-devel
mailing list