[gdal-dev] ogr2ogr -clipsrc datasource postgis?

Hailey Eckstrand hailey at foundryspatial.com
Wed Jun 8 10:13:14 PDT 2022


Hi all,

I'm trying to import a layer from a filegeodatabase into postgis and clip
it to a separate postgis layer. Is that possible? I can successfully clip
using the clipsrc argument with a bounding box I've read that it will also
work for a shapefile, but I'd prefer to use a postgis layer as the clipsrc
datasource.


ogr2ogr \
-f "PostgreSQL" \
PG:$(DATABASE_URL_OGR) \
data/data.gdb \
-nln data.flows \
Flows \
-lco GEOMETRY_NAME=geom \
-nlt MULTILINESTRING \
-t_srs EPSG:4326 \
-clipsrc datasource \
-clipsrclayer 'select geom4326 from data.boundary' PG:$(DATABASE_URL_OGR)

This is my latest attempt but the error is:
ERROR 5: cannot load source clip geometry

Thanks!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20220608/4d3f5712/attachment-0001.htm>


More information about the gdal-dev mailing list