[Gdal-dev] OGR C API question
Markus Neteler
neteler at itc.it
Mon Mar 22 17:38:46 EST 2004
On Mon, Mar 22, 2004 at 09:53:21AM -0500, Frank Warmerdam wrote:
> Markus Neteler wrote:
> > poSpatialFilter = OGR_G_CreateGeometry( wkbPolygon );
> > Ogr_oRing = OGR_G_CreateGeometry( wkbLineString );
> > OGR_G_AddPoint(Ogr_oRing, xmin, ymin, 0);
> > OGR_G_AddPoint(Ogr_oRing, xmin, ymax, 0);
> > OGR_G_AddPoint(Ogr_oRing, xmax, ymax, 0);
> > OGR_G_AddPoint(Ogr_oRing, xmax, ymin, 0);
> > OGR_G_AddPoint(Ogr_oRing, xmin, ymin, 0);
> > OGR_G_AddGeometryDirectly(poSpatialFilter, Ogr_oRing);
> >
> > OGR_L_SetSpatialFilter(Ogr_layer, poSpatialFilter );
> >
> >Does anyone see why this doesn't work any longer? The spatial filter is
> >simply ignored.
>
> Markus,
>
> The wkbLineString should be wkbLinearRing. It looks like the
> AddGeometryDirectly() method returns OGRERR_UNSUPPORTED_GEOMETRY_TYPE if
> you pass anything other than a wkbLinearRing to add to a polygon. The
> checking may have been added after the initial implementation though I see
> nothing obvious in the change logs.
Great, now it works smoothly (tried with SHAPE, hope it does as well
with PostGIS data).
Thanks,
Markus
More information about the Gdal-dev
mailing list