[gdal-dev] ogr2ogr PDF

jratike80 jukka.rahkonen at maanmittauslaitos.fi
Mon Nov 11 00:12:34 PST 2019


Hi,

You must add a field named "ogr_style" into your PostGIS table and fill it
with the style definition strings. You can see some examples in
http://latuviitta.org/documents/Geospatial_PDF_maps_from_OSM_with_GDAL.pdf.

In simple cases as you may have it can be easier to add the styles
on-the-fly with a SQL query instead of saving them into the database

SELECT geometry, attribute, 'PEN(c:#FF0000,w:5px)' AS OGR_STYLE from roads;



-Jukka Rahkonen-



paul.malm 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 .osgeo

> https://lists.osgeo.org/mailman/listinfo/gdal-dev





--
Sent from: http://osgeo-org.1560.x6.nabble.com/GDAL-Dev-f3742093.html


More information about the gdal-dev mailing list