[gdal-dev] clipping a vector to extent with gdal.VectorTranslate

Even Rouault even.rouault at spatialys.com
Fri Feb 3 01:53:52 PST 2017


On vendredi 3 février 2017 10:45:37 CET Johan Van de Wauw wrote:
> Hi all,
> 
> We are using the new python function gdal.VectorTranslate which should
> work similar to ogr2ogr.
> 
> We were able to use spatFilter to select only elements that intersect
> (like the [-spat xmin ymin xmax ymax] operator.
> 
> But we failed to clip to the extent, similar to the
> [-clipsrc [xmin ymin xmax ymax] option in ogr2ogr. Is this possible
> with this function?
> 

Johann,

it indeed doesn't look like this was mapped to a friendly Python argument. But you can 
always use the generic options keyword to specify the command line parameters like you do 
with ogr2ogr (note that if you use options, all other dedicated parameters will be ignored).

Contributions to add a dedicated argument for clipSrc are welcome. Hint: edit
the VectorTranslateOptions() method in swig/include/python/gdal_python.i

Even

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20170203/fa423503/attachment.html>


More information about the gdal-dev mailing list