[mapserver-users] Polygon border with marker line symbol
Anton Bakker
anton.bakker at geocat.net
Thu Oct 12 01:54:36 PDT 2017
Hi Lars,
On second thought setting the TYPE to LINE does not fit my usecase exactly. I would like to achieve the following for a polygon layer: https://i.imgur.com/3stwHw4.png <https://i.imgur.com/3stwHw4.png> . So the two requirements for the symbology are:
- Marker line symbol on border
- Polygon fill
With setting the type to line I can only achieve the marker line symbol, but I cannot specify a fill: https://i.imgur.com/tk6vJ4b.png <https://i.imgur.com/tk6vJ4b.png> . Do you know if there is a way of achieving this effect?
I guess it maybe could be done by grouping two layers, together and treating them as one, but preferably the solution is restricted to one layer.
Cheers,
Anton
> On 12 Oct 2017, at 10:22, Anton Bakker <anton.bakker at geocat.net> wrote:
>
> Hi Lars,
>
> The fill of the square was set to true, but I guess that is what happens when you only set the OUTLINECOLOR and a SYMBOL on a polygon type style.
>
> In any case setting the type of the polygon layer to LINE did the trick. I was not aware this was possible, but it does make sense. Thanks for the quick answer!
>
> Kind regards,
> Anton
>
>> On 11 Oct 2017, at 18:50, lars.schylberg at blixtmail.se <mailto:lars.schylberg at blixtmail.se> wrote:
>>
>> Hi,
>>
>> I guess that your symbol definition of square says filled false, it should be be filled true. Do another symbol.
>> Next thing is that if You would like to do fancy borders symbols along a polygon you could set LAYER - TYPE to line.
>> The syntax becomes easier. Last thing is to get the symbols to rotate with the line you should set gap to a negative value.
>>
>> I made a small example to show this. Save this to line-with-squares.map and run it with:
>> shp2img -m line-square-test.map -o line-square-test.png
>>
>> /Lars S.
>> _________________
>>
>> MAP
>> SIZE 1000 1000
>> IMAGETYPE png24
>> EXTENT -30 -10 60 30
>> UNITS DD
>>
>> SYMBOL
>> NAME "square_filled"
>> TYPE VECTOR
>> POINTS
>> 0 0
>> 0 1
>> 1 1
>> 1 0
>> 0 0
>> END
>> FILLED TRUE
>> END
>>
>> LAYER # Simple polygon
>> STATUS DEFAULT
>> TYPE LINE
>> FEATURE
>> POINTS
>> 5 25
>> 25 20
>> 45 20
>> 35 15
>> 50 0
>> 0 5
>> 5 25
>> END # Points
>> END # Feature
>>
>> CLASS
>> NAME "Symboltest"
>> STYLE
>> SYMBOL "square_filled"
>> COLOR 255 0 0
>> SIZE 12
>> INITIALGAP 15
>> GAP -30
>> OUTLINECOLOR 0 0 0
>> WIDTH 2.0
>> END #STYLE
>> END # CLASS
>> END # LAYER
>> END # MAP
>>
>> ---------------------------
>>
>> -----Originalmeddelande-----
>> Från: "Anton Bakker" <anton.bakker at geocat.net <mailto:anton.bakker at geocat.net>>
>> Till: mapserver-users at lists.osgeo.org <mailto:mapserver-users at lists.osgeo.org>
>> Datum: 2017-10-11 17:45
>> Ämne: [mapserver-users] Polygon border with marker line symbol
>>
>> Hi list,
>>
>> I am trying to create the following symbology in MapServer, a marker line symbol on the border of a polygon, see the following ArcMap screenshot (https://i.imgur.com/9qN16tx.png <https://i.imgur.com/9qN16tx.png>).
>>
>> I tried the two following options, but could not manage to recreate the above symbology:
>>
>> 1. Renders with marker fill on polygon (https://i.imgur.com/sFFznbq.png <https://i.imgur.com/sFFznbq.png>):
>>
>> CLASS
>> NAME "countries_europe"
>> STYLE
>> ANTIALIAS TRUE
>> COLOR 204 204 204
>> END
>> STYLE
>> ANTIALIAS TRUE
>> GAP 30
>> OUTLINECOLOR 0 0 0
>> COLOR 255 0 0
>> SIZE 6
>> SYMBOL 'square'
>> WIDTH 1.0
>> END
>> END
>>
>> 2. Renders with marker line symbol on polygon border (https://i.imgur.com/Qwrw8wP.png <https://i.imgur.com/Qwrw8wP.png>), but the marker is missing the fill:
>>
>> CLASS
>> NAME "countries_europe"
>> STYLE
>> ANTIALIAS TRUE
>> COLOR 204 204 204
>> END
>> STYLE
>> ANTIALIAS TRUE
>> GAP 30
>> OUTLINECOLOR 0 0 0
>> SIZE 6
>> SYMBOL 'square'
>> WIDTH 1.0
>> END
>> END
>>
>> Does anyone know whether it is possible to achieve this symbology? It seems the only way to set a picture line symbol on the border of a polygon is to only set the outlinecolor, but then there is no way to set the fill color for the marker. I could not find any any information about this in the documentation or the mailing list.
>>
>> Thanks and kind regards,
>> Anton Bakker
>>
>> software developer at geocat <http://www.geocat.net/>
>> tel. +31 318 416 664
>>
>>
>>
>> _______________________________________________
>> mapserver-users mailing list
>> mapserver-users at lists.osgeo.org <mailto:mapserver-users at lists.osgeo.org>
>> https://lists.osgeo.org/mailman/listinfo/mapserver-users <https://lists.osgeo.org/mailman/listinfo/mapserver-users>
>>
>>
>> --
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20171012/d2c63055/attachment.htm>
More information about the MapServer-users
mailing list