[Gdal-dev] Re: OGR C API question

Stephan Holl sholl at gmx.net
Mon Mar 29 10:44:07 EST 2004


On Mon, 22 Mar 2004 23:38:46 +0100
Markus Neteler <neteler at itc.it> wrote:

> 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).

After some testin it does not work with PostGIS-data. It always pulls
the whole geometries out of PostGIS.

Does anybody know a solution?!

Thanks

-- 
Stephan Holl

Check headers for GnuPG Key!






More information about the Gdal-dev mailing list