[Gdal-dev] How to use SetSpatialFilter()
szekerest at gmail.com
Tue Nov 7 08:24:30 EST 2006
If you would create a geometry from a WKT string you should not
specify the geom type explicitly, like:
Geometry geom = new Geometry(ogr.wkbUnknown, "POINT(47.0 19.2)", 0, null, null);
See the createdata.cs as a working example.
2006/11/7, Mir Hassan Ali <mirhassanali at gmail.com>:
> I am using the C# wrapper for GDAL in my application. I want to use
> SetSpatialFilter() method on a layer. I have an area defined by the
> <type> area</type>
> I am trying to set this area as spatial filter for the layer by using the
> following code
> layer.SetSpatialFilter(new Geometry(ogr.wkbGeometryCollection ,
> "RECTANGLE(393546 377079 393544 377081 393542 377079 393544 377077)", 0,
> null, null));
> But doing this does not return the desired result. It returns feature count
> as zero, rather than returning the features. Could someone please guide me
> how to use this function correctly.
> I apologise for asking such a basic question, but I am new to the GIS stuff
> so I hope you won't mind.
> Any help will be appreciated.
> Best Regards
> Mir Hassan Ali
> Gdal-dev mailing list
> Gdal-dev at lists.maptools.org
More information about the Gdal-dev