[Gdal-dev] Re: C# Geometry Classes?

Simon Perkins sy at perkins.net
Thu Mar 22 02:13:19 EDT 2007


Frank Warmerdam wrote:
> Simon Perkins wrote:
>> This seems to me like a big chunk that's missing from the OGR C 
>> interface, but maybe I'm just missing some aspect of how the C API 
>> can be used. For my money, I'm thinking that this functionality 
>> should be added into the basic C API (and thence picked up from there 
>> by SWIG et al). Don't people using the C API to OGR want more 
>> geometry specific functionality? I still haven't worked out how one 
>> can deal with all but the simplest geometries through the C interface 
>> - for instance identifying inner and outer rings of a polygon.
>
> Can you be more specific about what you think is missing?

Well if it's not obvious to you then probably the only thing that's 
missing is my knowledge of OGR... But here's an example of where I'm 
confused.

Suppose I've just read a feature from a layer.

I call OGR_G_GetGeometryType() to get the geometry type and get back 
wkbPolygon.

Presumably I can then call OGR_G_ GetPointCount() to get the number of 
points, and then OGR_G_GetPoint() to get the polygon points. But if the 
polygon contains multiple rings, how do I know which points belong to 
which ring?

Or can I invoke OGR_G_GetGeometryRef() on the polygon to get access to 
the rings? If this is the case, is the first ring defined to be the 
outer ring?

Just struggling with lack of documentation or examples using the C OGR 
API...

Cheers,

Sy





More information about the Gdal-dev mailing list