[gdal-dev] Gdal pdf driver and ogr_datasource with automatic -spat

Even Rouault even.rouault at mines-paris.org
Mon Jun 11 12:14:51 PDT 2012


Le lundi 11 juin 2012 14:47:32, Jukka Rahkonen a écrit :
> Hi,
> 
> Could it be possible to make GDAL PDF driver
> (http://gdal.org/frmt_pdf.html) to apply automatically -spat filter for
> the OGR_DATASOURCE layers which are to be drawn on top of raster layers?
> The values for the filter could be captured from the raster layer extents.
> 
> Now by default all the features from the vector layer are inserted into
> the PDF document. The features which lie outside the map borders on
> the map are rather unusable for users because it is impossible to
> show the features on a map even it is possible to select the features
> from the list and show the attributes. However, I suppose that usually
> people suppose that the map and feature list suit together.
> 
> I can imagine that there could be some troubles in automatic construction
> of -spat filter if the PDF targer srs is different than the native srs of
> OGR_DATASOURCE.

Excellent idea implemented in :

r24576 /trunk/ (4 files in 3 dirs): GDAL PDF: avoid writing OGR features that 
are outside the raster extent (and reproject OGR geometries to raster SRS if 
necessary)

Indeed, setting the spatial filter if the PDF targer srs is different than the 
native srs of OGR_DATASOURCE would be challenging, so I don't do that. In case 
reprojection is involved, no spatial filter is set, but just an intersection 
test after reprojection of each geometry. Not the most efficient, but achieves 
the purpose of discarding non intersecting geometries.

> 
> -Jukka Rahkonen-
> 
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20120611/0a3b33a7/attachment.html>


More information about the gdal-dev mailing list