[gdal-dev] ogr2ogr PDF

paul.malm at lfv.se paul.malm at lfv.se
Wed Nov 13 04:19:50 PST 2019


Hi,
I’m now setting attribute OGR_STYLE in my postGis db for a testlayer (line)
I’m now setting attribute OGR_STYLE in my postgis db for a test layer (LineString):
… SET \"OGR_STYLE\"= 'PEN(c:#FF3333,id:ogr-pen-4,w:1px)'
Does anyone know why the pen symbol (id) is ignored when exporting the PDF, it’s always a solid line?
Color and width is ok.
I’ve tried to draw a ogr-symbol together with a point layer and it worked like a charm.
Kind regards,
Paul

Från: Andreas Neumann [mailto:a.neumann at carto.net]
Skickat: den 11 november 2019 08:35
Till: Malm, Paul (Operations AIM)
Kopia: gdal-dev at lists.osgeo.org
Ämne: Re: [gdal-dev] ogr2ogr PDF


Hi Paul,

ogr2ogr usually doesn't care much about styling, unless you use ogr feature styles:

https://svn.osgeo.org/gdal/trunk/gdal/ogr/ogr_feature_style.html

Or you use QGIS 3.10* which has a nice GeoPDF export built in. But if you want to automate things, I understand that the automated solution might be better for your workflow.

*Disclaimer: QGIS 3.10 must be compiled with GDAL >= 3.0 and proj6, which as far as I know is currently not the case for QGIS Windows standalone builds. See also https://gis.stackexchange.com/questions/340030/create-geospatial-pdf-geopdf-is-greyed-out-in-pdf-export-options-in-qgis-3-10

Greetings,

Andreas

On 2019-11-11 08:28, paul.malm at lfv.se wrote:


Hi list,

I have a question on how to export a PDF file from PostGIS with a color on the lines instead of the default black lines. I have searched on the internet but have not reached all the way…

I have 2 tables that I would like to export into test.pdf (rivers and roads)

ogr2ogr -f "PDF" c:\Temp\test.pdf PG:"host=xxx.xxx.xxx.x user=yyyy dbname=testdb password=pwd" rivers roads



I would, for instance set like to set line width to 1 px and color to 4040FF on rivers,

Width 3 px and color FF4040 on roads.



Thanks,

Paul

_______________________________________________
gdal-dev mailing list
gdal-dev at lists.osgeo.org<mailto:gdal-dev at lists.osgeo.org>
https://lists.osgeo.org/mailman/listinfo/gdal-dev


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20191113/72830825/attachment.html>


More information about the gdal-dev mailing list