[geos-devel] Re: Return value of GEOSGeom_getDimensions_r

Frank Warmerdam warmerdam at pobox.com
Fri Dec 11 09:51:40 EST 2009

Alex Trofast wrote:
> Hi all,
> After reading the source and if I did it right, it seems like that 
> GEOSGeom_getDimensions_r would always return a 3, judging by 
> getDimensions in this file: 
> source/headers/geos/geom/CoordinateArraySequence.h
> If this is the case am I misunderstanding what GEOSGeom_getDimensions_r 
> is actually supposed to do: return 0 for point, 1 for curve, 2 for surface?
> Any help is greatly appreciated,


I do not believe that a CoordinateArraySequence is a Geometry based on my
cursory review.  Instead the particular instance classes of Geometry, like
LineString, own an instance of a CoordinateArraySequence, but actually provide
their own implementation of Geometry::getDimension(). In the case of LineString
I see this returns Dimension::L which I assume is 2.

Best regards,
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent

More information about the geos-devel mailing list