[Gdal-dev] OGR reading vector

Tamas Szekeres szekerest at gmail.com
Tue Jan 16 06:27:57 EST 2007


Hi,

You should use the generic Geometry class instead of OGRPoint. In
addition wkbFlatten is currently not exposed to the SWIG interface.
Here is a raw C# equivalent of the sampe mentioned at the tutorial
(not tested):

Feature feat;
layer.ResetReading();
while( (feat = layer.GetNextFeature()) != null )
{
	Geometry geom = feat.GetGeometryRef();
	if( geom != null && geom.GetGeometryType() == ogr.wkbPoint)
	{
		Trace.WriteLine(geom.GetX().ToString() + "," + geom.GetY().ToString());
	}
	else
	{
		Trace.WriteLine("no point geometry");
	}
	feat.Dispose();
}

For more examples about the OGR C# usage, see the createdata.cs and
the ogrinfo.cs examples at the csharp/apps directory.


Best Regards,

Tamas Szekeres


2007/1/16, mbaye <mbaye1234 at yahoo.fr>:
>
> I want to make the reading of file vector out of C # with ogr on the tutorial
> C ++ I saw
> wkbFlatten (poGeometry->getGeometryType ()) == wkbPoint)
> and
> OGRPoint
> I wanted to have the equivalents in c# thank you for your assistance
> --
> View this message in context: http://www.nabble.com/OGR-reading-vector-tf3020084.html#a8387596
> Sent from the GDAL - Dev mailing list archive at Nabble.com.
>
> _______________________________________________
> Gdal-dev mailing list
> Gdal-dev at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/gdal-dev
>



More information about the Gdal-dev mailing list