[geos-devel] Re: Return value of GEOSGeom_getDimensions_r

Alex Trofast alex.trofast at ingres.com
Fri Dec 11 11:11:06 EST 2009


Hi Frank,

The reason I said that is because the fact is I get a 3 no matter which 
type I use (Point, Polygon, or Linestring) and looking at the 
implementation of GEOSGeom_getDimensions_r it is returned as this:
dim = ls->getCoordinatesRO()->getDimension();
It does not call the Linestring's getDimension it seems. Does this seem 
like the correct interpretation?

Thanks,

Alex


On 12/11/2009 09:51 AM, Frank Warmerdam wrote:
> 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,
>
> Alex,
>
> 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,



More information about the geos-devel mailing list