[gdal-dev] org2org

Rahkonen Jukka jukka.rahkonen at maanmittauslaitos.fi
Wed Nov 9 03:21:29 PST 2022


Hi,

Does the SQL part work with a tool like pgAdmin? Notice that the inner double quotes must be escaped as \" in the ogr2ogr command or otherwise they will truncate the -sql parameter. And it seems that you did not select the geometry field. Generally I would suggest to start with a simple SQL and add complexity once you have gotten a good result. Suggestion includes testing with easy table names first before forwarding to names like countries.geometries_boundary_buffer_10km('and').

-Jukka Rahkonen-

Lähettäjä: gdal-dev <gdal-dev-bounces at lists.osgeo.org> Puolesta Leber, Thorsten
Lähetetty: keskiviikko 9. marraskuuta 2022 13.02
Vastaanottaja: gdal-dev at lists.osgeo.org
Aihe: [gdal-dev] org2org

Hi All,
I am trying to use org2org with the following command:

ogr2ogr -f "ESRI Shapefile" C:\RenderTest\raster_clipper_and.shp PG:"host=10.49.20.42 port=5432 user=tilemill password=test dbname=nextgen" -sql "SELECT "name", "left", top, "right", bottom FROM grids.grid_1_25grad WHERE ST_Intersects(geom, (SELECT geom FROM countries.geometries_boundary_buffer_10km('and'))) AND NOT ST_Touches(geom, (SELECT geom FROM countries.geometries_boundary_buffer_10km('and')))" -s_srs EPSG:4326 -t_srs EPSG:4326 -overwrite -lco ENCODING=utf8

I expect in the output folder 5 files

[cid:image001.png at 01D8F43D.E8366150]

But I receive a warning:

Warning 1: layer names ignored in combination with -sql.

And get only 3 files

[cid:image002.png at 01D8F43D.E8366150]

I am missing the .shp and the .shx file. Is there something wrong in my command?

KR

Thorsten


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20221109/454671e8/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 3261 bytes
Desc: image001.png
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20221109/454671e8/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.png
Type: image/png
Size: 2071 bytes
Desc: image002.png
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20221109/454671e8/attachment-0003.png>


More information about the gdal-dev mailing list