[gdal-dev] ogr2ogr PDF

paul.malm at lfv.se paul.malm at lfv.se
Mon Nov 11 00:33:54 PST 2019


Thanks Andreas and Jukka!! 
-Gurus!
/Paul

-----Ursprungligt meddelande-----
Från: gdal-dev [mailto:gdal-dev-bounces at lists.osgeo.org] För jratike80
Skickat: den 11 november 2019 09:13
Till: gdal-dev at lists.osgeo.org
Ämne: Re: [gdal-dev] ogr2ogr PDF

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
_______________________________________________
gdal-dev mailing list
gdal-dev at lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev


More information about the gdal-dev mailing list