OSGeo / gdal

GDAL is an open source MIT licensed translator library for raster and vector geospatial data formats.
https://gdal.org
Other
4.91k stars 2.55k forks source link

PDF writer doesn't honor the symbol size for custom raster SYMBOL styles #671

Open gane-knetworks opened 6 years ago

gane-knetworks commented 6 years ago

OGR Feature style SYMBOL not support custom raster icon resize in PDF Driver

gane-knetworks commented 6 years ago

Expected behavior and actual behavior.

SYMBOL(c:#000000FF,s:50px,id:bus_stop.png); The expected behavior is to resize the image bus_stop.png to 50px size when drawing the Point OGR Features.

The actual behavior is the image is always in one standard size only, irrespective of change in source image dimensions. For e.g, 32x32 px when resized to 16x16 px always appear as 50x50 px.

Steps to reproduce the problem.

Create a VRT data source and add style to Point Features, i.e., Each point should be marked as this imagery on that PDF on a Layer. SYMBOL(c:#000000FF,s:50px,id:bus_stop.png);

Operating system

Windows 10

GDAL version and provenance

atlight commented 6 years ago

From looking at pdfcreatecopy.cpp it seems that GDAL only honors the symbol size (dfSymbolSize -> dfRadius) when using one of the built-in symbols. It ought not to be too difficult to tweak this function call to account for the custom symbol size.