[gdal-dev] Correct sintax for multicommand in FeatureStyle specification
Even Rouault
even.rouault at spatialys.com
Sat Aug 30 06:39:38 PDT 2014
Andrea,
Both work for me.
Tested with :
* foo.csv :
id,WKT,OGR_STYLE
1,"POLYGON((1 1,1 9,4 9,4 1,1 1))","LABEL(f:""Arial"",t:""Blah Blah Blah"",s:3g,c:#0000FF);BRUSH(fc:#FF0000)"
2,"POLYGON((5 1,5 9,9 9,9 1,5 1))","BRUSH(fc:#FF0000);LABEL(f:""Arial"",t:""Blah Blah Blah"",s:3g,c:#0000FF)"
(the repeated "" is due to CSV escaping of double quotes)
* foo.map :
MAP
NAME test
EXTENT 0 0 10 10
SIZE 200 200
PROJECTION
"init=epsg:4326"
END
WEB
METADATA
OWS_ONLINERESOURCE "http://127.0.0.0.1"
OWS_SRS "EPSG:4326"
OWS_ENABLE_REQUEST "*"
END
END
LAYER
NAME foo
TYPE POLYGON
STATUS ON
CONNECTIONTYPE OGR
CONNECTION "foo.csv"
STYLEITEM "AUTO"
CLASS
END
END
END
* test command :
shp2img -m foo.map -o foo.png
Attached the resulting foo.png
Best egards,
Evn
> Hi,
> I'm try to undestand the FeatureStyle specification.
>
> To do this I'm using the mapserver that seem to work with it.
>
>
> Actually I have a dubt about the usage of more than one command.
>
> Infact a single command could be as example:
>
> 'LABEL(f:"Arial",t:"Blah Blah Blah",s:3g,c:#0000FF)'
>
> That command mean "print a label with text "Blah Blah Blah" . Color
> Blu font Arial and size 3 ground-unit.
>
> Infact using it with mapserver work and effectively the map has that
> result.
>
> Also if I try this other command:
>
> 'BRUSH(fc:#FF0000)'
>
> this mean : fill the polygon with a full red.
>
> Also this work with mapserver.
>
> Now I need to understand if and how is possible to have more than one
> command.
>
> Reading the specs ,
> I guess the right sintax should be this:
>
> 'BRUSH(fc:#FF0000);LABEL(f:"Arial",t:"Blah Blah Blah",s:3g,c:#0000FF)'
>
> Where the two command are separate by a ; char.
>
> Unfortunately this string dont seem work with mapserver.
>
> I try also the opposite string:
>
> "LABEL(f:"Arial",t:"Blah Blah Blah",s:3g,c:#0000FF);BRUSH(fc:#FF0000)"
>
> BUt still not seem work.
> Always is showed only the first command only.
>
> This could effectively tobe an issue of mapserver.
> But I'm not really sure that this is the correct string for multi
> command using the featurestyle spec.
>
> So I like to have any hint on this.
>
> If the sintax I'm using is correct and if there is some software or
> authoring that support it.
>
> Thx,
--
Spatialys - Geospatial professional services
http://www.spatialys.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: foo.png
Type: image/png
Size: 2662 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20140830/0c32e814/attachment.png>
More information about the gdal-dev
mailing list