[gdal-dev] ogr2ogr PDF

paul.malm at lfv.se paul.malm at lfv.se
Fri Nov 15 00:31:02 PST 2019


Stephen, 

thanks for responding!

I've tried this:
PEN(c:#FF00FF,w:3pt,p:"3pt 3pt")
PEN(c:#FF00FF,w:3pt,p:3pt 3pt)
PEN(p:"3pt 3pt",c:#FF00FF,w:3pt)
PEN(p:3pt 3pt,c:#FF00FF,w:3pt)
PEN(c:#FF00FF, p:"3pt 3pt",w:3pt)
PEN(c:#FF00FF, p:3pt 3pt,w:3pt)
But I'm getting the same solid line. Width and color are ok.

I have also tried to use: PEN(c:#FF00FF,id:ogr-pen-4,w:3pt) 
And I'm only getting the same solid line....

I'm using GDAL 2.4.1, released 2019/03/15
As I understand the PDF driver should handle line patterns.
/Paul 

-----Ursprungligt meddelande-----
Från: gdal-dev [mailto:gdal-dev-bounces at lists.osgeo.org] För Stephen Woodbridge
Skickat: den 14 november 2019 16:44
Till: gdal-dev at lists.osgeo.org
Ämne: Re: [gdal-dev] ogr2ogr PDF

Paul,

Your issue might be one of scale. You have specified units in px try 
changing it to pt. (units (g, px, pt, mm, cm, in))

See: https://gdal.org/user/ogr_feature_style.html#ogr-feature-style

You can also try named pens like:

Here is the current list of OGR pen ids (this could grow over time):

  *

    ogr-pen-0: solid (the default when no id is provided)

  *

    ogr-pen-1: null pen (invisible)

  *

    ogr-pen-2: dash

  *

    ogr-pen-3: short-dash

  *

    ogr-pen-4: long-dash

  *

    ogr-pen-5: dot line

  *

    ogr-pen-6: dash-dot line

  *

    ogr-pen-7: dash-dot-dot line

  *

    ogr-pen-8: alternate-line (sets every other pixel)

System-specific ids are very likely to be meaningful only to that 
specific system that created them. The ids should start with the 
system’s name, followed by a dash (-), followed by whatever information 
is meaningful to that system (a number, a name, a filename, etc.).
e.g. “mapinfo-5”, or “mysoft-lines.sym-123”, or “othersystems-funnyline”

System-specific ids are allowed in order to prevent loss of information 
when dealing with data from systems that store line patterns in external 
files or that have their own pre-defined set of line styles (for 
instance, to do a MapInfo MIF to TAB translation without any loss.)

Examples:
PEN(c:#00FF00,id:”ogr-pen-0”) - simple solid line
PEN(c:#00FF00,id:”mapinfo-5,ogr -pen-7”) - corresponds to MapInfo’s Pen 
#5, and a system that can’t understand MapInfo pens falls back on the 
default “ogr-pen-7” pen (dot-dot line).

-Steve W

On 11/14/2019 2:18 AM, paul.malm at lfv.se wrote:
> Thanks for responding Jukka!
> I'm getting real irritated of myself for not getting such a simple thing to work with such grate tools.
> I have now tried with:
> PEN(c:#FF00FF,w:3px,p:"3px 3px")
> PEN(c:#FF00FF,w:3px,p:3px 3px)
> PEN(p:"3px 3px",c:#FF00FF,w:3px)
> PEN(p:3px 3px,c:#FF00FF,w:3px)
> PEN(c:#FF00FF, p:"3px 3px",w:3px)
> PEN(c:#FF00FF, p:3px 3px,w:3px)
> But I'm getting the same solid line. Width and color are ok.
> /Paul
>
> -----Ursprungligt meddelande-----
> Från: gdal-dev [mailto:gdal-dev-bounces at lists.osgeo.org] För jratike80
> Skickat: den 13 november 2019 16:35
> Till: gdal-dev at lists.osgeo.org
> Ämne: Re: [gdal-dev] ogr2ogr PDF
>
> Hi,
>
> What is supported is documented in a table in
> https://gdal.org/drivers/raster/pdf.html. For PEN only these options are
> supported: color (c); width (w); dash pattern (p).
>
> So why, you know, nobody has implemented it yet. Meanwhile you can do
> something with dash pattern, or edit the PDF with some PDF editor.
>
> -Jukka Rahkonen-
>
>
> paul.malm wrote
>> 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
>
>
>
>
> --
> 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
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/gdal-dev

_______________________________________________
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