[Gdal-dev] Re: OGR C API question

Etienne Dube etdube at globetrotter.net
Tue Mar 30 19:44:17 EST 2004


Greetings, Frank.

On Monday 29 March 2004 17:17, Frank Warmerdam wrote:
> Etienne,
>
> I would just add that OGR does attempt to apply spatial constraints to the
> query.  When it is building the WHERE clause to use, it includes the
> spatial constraint.  Features that are selected will still best tested
> conventionally, but if you have set a small area of interest via the
> spatial filter, it should only have to check features in the correct area.
>
> See OGRPGTableLayer::BuildWhere() to see the logic for applying the
> BOX3D spatial filter.
>
> Best regards,

You're right... I was looking in the wrong file. But is the PostgreSQL driver 
page up to date (http://www.remotesensing.org/gdal/ogr/drv_pg.html) ? It 
says: "Some features are not implemented properly. For instance, spatial 
filtering is broken." If so, what exactly is broken in spatial filtering?

I'll try building a GiST index for the wkb_geometry column, to see if it 
speeds up the queries... I'm using the Quebec road coverage from geobase.ca, 
it's quite large (more than 300000 linestrings).

>> I've found that if you don't specify the -s_srs (source spatial ref. sys.) 
>> when importing an ESRI shapefile with ogr2ogr, the SRID row in 
>> spatial_ref_sys won't be created. Make sure you use the same datum as the 
>> data in your shapefile.
[...]
> If you can isolate this issue I would encourage you to submit it in the OGR
> bugzilla and I will try to correct it in the next few weeks.  I have a few
> other improvements I would like to make to the PostGIS driver in OGR
> anyways. 

I'll look into that. By the way, I'm developing a GPS mapping app for 
Qt/Embedded (on an HP iPAQ running Familiar Linux). I've got to get a few 
basic features done in the next three weeks (it's for an undergraduate 
engineering design project, which is due (too) soon) but after that, I'm 
going to release it under the GPL. I plan to add sqlite support to OGR, as 
Postgres is not really intented for embedded use. It won't be ready anytime 
soon, but eventually I'd like to contribute these improvements back to the 
OGR cvs tree.

Oh, and thank you for developing and especially sharing freely such an useful 
piece of software. It does wonders for my project.

Etienne



More information about the Gdal-dev mailing list