[mapserver-users] Polygon border with marker line symbol

Björn Danielsson bjorn.danielsson at falubo.se
Thu Oct 12 03:02:36 PDT 2017


Hi,

Jukka R,
I would love to learn how to prevent polygon borders to be drawn twice.

Björn D


-----Original Message-----
From: "Rahkonen Jukka (MML)" <jukka.rahkonen at maanmittauslaitos.fi>
To: Anton Bakker <anton.bakker at geocat.net>, "lars.schylberg at blixtmail.se" 
<lars.schylberg at blixtmail.se>
Cc: "mapserver-users at lists.osgeo.org" <mapserver-users at lists.osgeo.org>
Date: Thu, 12 Oct 2017 08:59:28 +0000
Subject: Re: [mapserver-users] Polygon border with marker line symbol


Hi,

I fear that you will run into another problem later because polygons are 
closed rings and therefore common borders will be drawn two times.  Because 
of that rendering with sparse symbols may look ugly.

I would consider preprocessing the data so that you will have a clean line 
data where duplicate sections of the borders have been removed for rendering 
the borders and polygon layer for the rest.

-Jukka Rahkonen-

Lähettäjä:mapserver-users 
[mailto:mapserver-users-bounces at lists.osgeo.org] PuolestaAnton Bakker
Lähetetty: 12. lokakuuta 2017 11:55
Vastaanottaja: lars.schylberg at blixtmail.se
Kopio: mapserver-users at lists.osgeo.org
Aihe: Re: [mapserver-users] Polygon border with marker line symbol

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 
[mailto: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]


--<!--{cke_protected}{C}%3C!%2D%2D%0A%2F*%20Font%20Definitions%20*%2F%0A%40font-face%0A%09%7Bfont-family%3A%22Cambria%20Math%22%3B%0A%09panose-1%3A2%204%205%203%205%204%206%203%202%204%3B%7D%0A%40font-face%0A%09%7Bfont-family%3ACalibri%3B%0A%09panose-1%3A2%2015%205%202%202%202%204%203%202%204%3B%7D%0A%40font-face%0A%09%7Bfont-family%3ATahoma%3B%0A%09panose-1%3A2%2011%206%204%203%205%204%204%202%204%3B%7D%0A%2F*%20Style%20Definitions%20*%2F%0Ap.MsoNormal%2C%20li.MsoNormal%2C%20div.MsoNormal%0A%09%7Bmargin%3A0cm%3B%0A%09margin-bottom%3A.0001pt%3B%0A%09font-size%3A12.0pt%3B%0A%09font-family%3A%22Times%20New%20Roman%22%2Cserif%3B%7D%0Aa%3Alink%2C%20span.MsoHyperlink%0A%09%7Bmso-style-priority%3A99%3B%0A%09color%3Ablue%3B%0A%09text-decoration%3Aunderline%3B%7D%0Aa%3Avisited%2C%20span.MsoHyperlinkFollowed%0A%09%7Bmso-style-priority%3A99%3B%0A%09color%3Apurple%3B%0A%09text-decoration%3Aunderline%3B%7D%0Aspan.Shkpostityyli17%0A%09%7Bmso-style-type%3Apersonal-reply%3B%0A%09font-family%3A%22Calibri%22%2Csans-serif%3B%0A%09color%3A%231F497D%3B%7D%0A.MsoChpDefault%0A%09%7Bmso-style-type%3Aexport-only%3B%0A%09font-size%3A10.0pt%3B%7D%0A%40page%20WordSection1%0A%09%7Bsize%3A612.0pt%20792.0pt%3B%0A%09margin%3A70.85pt%202.0cm%2070.85pt%202.0cm%3B%7D%0Adiv.WordSection1%0A%09%7Bpage%3AWordSection1%3B%7D%0A%2D%2D%3E-->
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20171012/ab207530/attachment.htm>


More information about the MapServer-users mailing list