Polygon border with marker line symbol

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Polygon border with marker line symbol

Anton Bakker
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). 

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):

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), 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@geocat 
tel. +31 318 416 664 




_______________________________________________
mapserver-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapserver-users
Reply | Threaded
Open this post in threaded view
|

Re: Polygon border with marker line symbol

Lars Schylberg-4

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" <[hidden email]>
Till: [hidden email]
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). 

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):

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), 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@geocat 
tel. +31 318 416 664 




_______________________________________________
mapserver-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapserver-users



--

 

_______________________________________________
mapserver-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapserver-users
Reply | Threaded
Open this post in threaded view
|

Re: Polygon border with marker line symbol

Havard Tveite-3
In reply to this post by Anton Bakker
If you duplicate the layer, one of the layers (type polygon) can provide
the polygon fill and the other (type line) the styled boundary.

Håvard

On 11. okt. 2017 17:45, Anton Bakker wrote:

> 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@geocat <http://www.geocat.net/>
> tel. +31 318 416 664
>
>
>
>
>
>
> _______________________________________________
> mapserver-users mailing list
> [hidden email]
> https://lists.osgeo.org/mailman/listinfo/mapserver-users
>
_______________________________________________
mapserver-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapserver-users
Reply | Threaded
Open this post in threaded view
|

Re: Polygon border with marker line symbol

Lars Schylberg-4

Hi again,


As Håvard points out You need to draw the polygon twice.  I have extended the example to show that.

In a real world example You will substitute the inline FEATURE with a DATA statement.


The new example can be found here.


https://gist.github.com/LarsSchy/9b697cb02c0a4637512a1b1026069352


and the result is shown here:


https://i.imgur.com/z0yXKdh.png


Good luck


Lars Schylberg


-----Originalmeddelande-----

> Från: "Håvard Tveite" <[hidden email]>
> Till: [hidden email]
> Datum: 2017-10-11 23:21
> Ämne: Re: [mapserver-users] Polygon border with marker line symbol
>
> If you duplicate the layer, one of the layers (type polygon) can provide
> the polygon fill and the other (type line) the styled boundary.
>
> Håvard
>
> On 11. okt. 2017 17:45, Anton Bakker wrote:
> > 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@geocat <http://www.geocat.net/>
> > tel. +31 318 416 664
> >
> >
> >
> >
> >
> >
> > _______________________________________________
> > mapserver-users mailing list
> > [hidden email]
> > https://lists.osgeo.org/mailman/listinfo/mapserver-users
> >
> _______________________________________________
> mapserver-users mailing list
> [hidden email]
> https://lists.osgeo.org/mailman/listinfo/mapserver-users


--

 

_______________________________________________
mapserver-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapserver-users
Reply | Threaded
Open this post in threaded view
|

Re: Polygon border with marker line symbol

Anton Bakker
In reply to this post by Lars Schylberg-4
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, [hidden email] 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" <[hidden email]>
Till: [hidden email]
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). 

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):

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), 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@geocat 
tel. +31 318 416 664 




_______________________________________________
mapserver-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapserver-users


--

 


_______________________________________________
mapserver-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapserver-users
Reply | Threaded
Open this post in threaded view
|

Re: Polygon border with marker line symbol

Anton Bakker
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 . 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 . 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 <[hidden email]> 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, [hidden email] 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" <[hidden email]>
Till: [hidden email]
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). 

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):

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), 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@geocat 
tel. +31 318 416 664 




_______________________________________________
mapserver-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapserver-users


--

 



_______________________________________________
mapserver-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapserver-users
Reply | Threaded
Open this post in threaded view
|

Re: Polygon border with marker line symbol

jratike80
In reply to this post by Anton Bakker

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:[hidden email]] Puolesta Anton Bakker
Lähetetty: 12. lokakuuta 2017 11:55
Vastaanottaja: [hidden email]
Kopio: [hidden email]
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 . 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 . 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 <[hidden email]> 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, [hidden email] 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" <[hidden email]>
Till: [hidden email]
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). 

 

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):

 

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), 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@geocat 

tel. +31 318 416 664 

 

 

 


_______________________________________________
mapserver-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapserver-users

 

 

--


 

 

 


_______________________________________________
mapserver-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapserver-users
Reply | Threaded
Open this post in threaded view
|

Re: Polygon border with marker line symbol

Björn Danielsson
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)" <[hidden email]>
To: Anton Bakker <[hidden email]>, "[hidden email]" <[hidden email]>
Cc: "[hidden email]" <[hidden email]>
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:[hidden email]] Puolesta Anton Bakker
Lähetetty: 12. lokakuuta 2017 11:55
Vastaanottaja: [hidden email]
Kopio: [hidden email]
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 . 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 . 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 <[hidden email]> 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, [hidden email] 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" <[hidden email]>
Till: [hidden email]
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). 
 
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):
 
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), 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@geocat 
tel. +31 318 416 664 
 
 
 

_______________________________________________
mapserver-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapserver-users
 
 
--

 
 
 

_______________________________________________
mapserver-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapserver-users
Reply | Threaded
Open this post in threaded view
|

Re: Polygon border with marker line symbol

Anton Bakker
In reply to this post by jratike80
Hi Jukka, 

I did not really think of that. I ended up using a line dataset, which solved all my issues. Thanks for thinking outside the polygon.

Cheers,
Anton


On 12 Oct 2017, at 10:59, Rahkonen Jukka (MML) <[hidden email]> wrote:

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 [[hidden email]] Puolesta Anton Bakker
Lähetetty: 12. lokakuuta 2017 11:55
Vastaanottaja: [hidden email]
Kopio: [hidden email]
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 . 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 . 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 <[hidden email]> 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, [hidden email] 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" <[hidden email]>
Till: [hidden email]
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). 
 
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):
 
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), 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@geocat 
tel. +31 318 416 664 
 
 
 

_______________________________________________
mapserver-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapserver-users
 
 
--


_______________________________________________
mapserver-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapserver-users
Reply | Threaded
Open this post in threaded view
|

Re: Polygon border with marker line symbol

jratike80
In reply to this post by Anton Bakker

 

Hi,

 

I do not know of any automatic method that prevents the duplicate drawing. With simple symbology of solid, opaque lines there is no need to do anything because the result looks the same anyway. For advanced symbology a simple rendering trick with a solid, opaque background may give good result for some kind of symbology but sometimes nothing else helps but to remove the overlapping segments permanently from the data that is used for rendering the borders.

 

I believe that there are some examples with images about the “line with white background and symbols above that trick” in gis.stackexchange but this answer is just literal

https://gis.stackexchange.com/questions/171182/how-to-make-dashed-lines-between-adjacent-polygons-render-correctly-in-qgis


The “convert polygons into polylines and clean overlapping segments workflow”  explained with images in an ESRI blog
https://blogs.esri.com/esri/arcgis/2007/09/26/excerpt-for-dash-dot-line-entry/

 

The operation “polygons into polylines without overlapping segments” can be performed by creating a planar graph or the GIS software may have a special tool for that purpose like my favorite OpenJUMP. However, it is rather common that polygon shapefiles are not topologically clean and borders between adjacent polygons do not match exactly. In that case the source data must be made to match first. Usually I do that with OpenJUMP and the Adjust Polygon Boundaries tool. Fine tuning can be tedious and next update from the data provider will have the same errors so I tend to use simple styles J.

 

-Jukka Rahkonen-

 

Lähettäjä: Björn Danielsson [[hidden email]]
Lähetetty: 12. lokakuuta 2017 13:03
Vastaanottaja: Rahkonen Jukka (MML) <[hidden email]>; Anton Bakker <[hidden email]>; [hidden email]
Kopio: [hidden email]
Aihe: Re: [mapserver-users] Polygon border with marker line symbol

 

Hi,

 

Jukka R,

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

 

Björn D

 

 

 


_______________________________________________
mapserver-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapserver-users