[gdal-dev] Review of ogr2ogr SQL queries

Pekka Sarkola pekka at gispo.fi
Sat Sep 19 05:16:43 PDT 2015


Thanks Even,

I will check those queries from PostgreSQL logs.

Ok, I understand also developer: -clipsrc can be more stupid file format
than PostGIS.

Rgs,

Pekka

Pekka Sarkola
Gispo Oy
pekka.sarkola at gispo.fi   - GSM +358 40 725 2042
www.gispo.fi – www.paikkatieto.com

2015-09-19 15:08 GMT+03:00 Even Rouault <even.rouault at spatialys.com>:

> Pekka,
> >
> > I just wonder if it possible to review which kind of SQL queries ogr2ogr
> is
> > doing.
>
> With a debug build of GDAL and "--debug on" added on the ogr2ogr command
> line,
> you should be able to see the queries.
> Otherwise you could have a look at the PostgreSQL logs
>
> >
> > My problem: I'm exporting data from PostGIS to SQlite and some of the
> > queries are slow. So, I'm not sure if my indexes are perfect in PostGIS
> > side. Should be, but you never know.
> >
> > My export query includes -clipsrc <from PostGIS layer>. Is ogr2ogr
> building
> > one huge SQL query to PostGIS or will it first get clip
> > polygon/multipolygons from -clipsrc and then send that again to PostGIS?
>
> Ah, from what I see in the code, it appears that -clipsrc does only client-
> side clipping. You should probably combine it with -spat so that server
> side
> filtering happens and reduce the number of features that are received on
> the
> client side. Not sure why it isn't done automatically: developer lazyness I
> guess ;-)
>
> Even
>
> >
> > Rgs,
> >
> > Pekka
> >
> > Pekka Sarkola
> > Gispo Oy
> > pekka.sarkola at gispo.fi   - GSM +358 40 725 2042
> > www.gispo.fi – www.paikkatieto.com
>
> --
> Spatialys - Geospatial professional services
> http://www.spatialys.com
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20150919/acc4915b/attachment.html>


More information about the gdal-dev mailing list