[mapserver-users] symbol circle (ellipse) rendered not round but oval

Stephen Woodbridge woodbri at swoodbridge.com
Thu Jan 14 09:11:13 EST 2010


Hi guys,

I haven't followed this whole thread but I think it should be better 
documented so people can understand how to use this. Please write a doc 
bug and put as much information in the bug about how this works as you 
have been able to discover.

Thanks,
   -Steve W

Oliver Christen wrote:
> 
> Thank you Håvard
> I see you have changed "points 1 1 end" by "points 8 8 end".
> Tell me if im wrong, but these values are only used to render the 
> proportions of the elipse but not it's size, is that correct?
> so if I understand correctly, using larger values for the elipse 
> width/height refine the rendering of the vectorised dot geometry ?
> 
> regards
> Oliver
> 
>> Dear Oliver Christen,
>>
>> Using Mapserver 5.6.0 and AGG rendering, you can achieve what
>> you want by using a combination of ellipse size and gap size
>> in the symbol definition.
>> There is something strange in the calculations (a gap of
>> about half the ellipse size seems to produce touching symbols),
>> so in your case, you could try to use 8 as the diameter of the
>> ellipses, and 20 + 4 (half the ellipse size) = 24 as the
>> gap:
>>
>> symbol
>>  name dots
>>  type ellipse
>>  points 8 8 end
>>  gap 24
>> end
>>
>>
>> Håvard
>>
>> Oliver Christen wrote:
>>> thank you Thomas
>>>
>>> so if I have a dot of, for example, 8px and I want a space pf 20px 
>>> between the dots, I need a gap of 20/8 =  2.5
>>>
>>> but as far as I can see, Mapserver doesnt like none-integer value for 
>>> gap.
>>>
>>> what should I do? :(
>>>
>>> 2010/1/12 thomas bonfort <thomas.bonfort at gmail.com 
>>> <mailto:thomas.bonfort at gmail.com>>
>>>
>>>     gap in pixels = symbol->gap * style->size
>>>
>>>
>>>     On Tue, Jan 12, 2010 at 16:52, Oliver Christen
>>>     <oliver.christen at camptocamp.com
>>>     <mailto:oliver.christen at camptocamp.com>> wrote:
>>>
>>>         GAP 20 is really giving unwanted result:
>>>          http://dev.camptocamp.com/~ochriste/tilecache9.png
>>>         <http://dev.camptocamp.com/%7Eochriste/tilecache9.png>
>>>          though using only one style instead of two seems to solve the
>>>         oval problem (but why ???)
>>>          style
>>>              symbol "dots"
>>>              size 8
>>>              color 204 102 0
>>>              outlinecolor  102 51 0
>>>             end
>>>          I dont understand how GAP is supposed working:
>>>          with GAP 2, I had ~10px between dots,
>>>         with GAP 3, I had ~18px between dots,
>>>         with GAP 4, I had ~26px between dots
>>>          whats the logic ?
>>>
>>>             ----- Original Message -----
>>>             *From:* thomas bonfort <mailto:thomas.bonfort at gmail.com>
>>>             *To:* Oliver Christen 
>>> <mailto:oliver.christen at camptocamp.com>
>>>             *Cc:* mapserver-users at lists.osgeo.org
>>>             <mailto:mapserver-users at lists.osgeo.org>
>>>             *Sent:* Tuesday, January 12, 2010 4:36 PM
>>>             *Subject:* Re: [mapserver-users] symbol circle (ellipse)
>>>             rendered not round but oval
>>>
>>>             symbol
>>>              name dots
>>>              type ellipse
>>>              points 1 1 end
>>>              gap 20
>>>             end
>>>
>>>             ...
>>>
>>>             style
>>>              symbol "dots"
>>>              size 8
>>>              color r g b
>>>              outlinecolor  r g b
>>>             end
>>>
>>>
>>>
>>>
>>>             On Tue, Jan 12, 2010 at 16:31, Oliver Christen
>>>             <oliver.christen at camptocamp.com
>>>             <mailto:oliver.christen at camptocamp.com>> wrote:
>>>
>>>                 Hi Thomas :)
>>>                  thanks for the answer, but sadely it didnt solve my 
>>> problem:
>>>                  here are a few tests I did:
>>>                  using GAP 20 gave me really weird result:
>>>                 
>>> http://dev.camptocamp.com/~ochriste/tilecache6_gap_20.png
>>>
>>> <http://dev.camptocamp.com/%7Eochriste/tilecache6_gap_20.png>
>>>                  using PATTERN 1 22 END gave me better result, but the
>>>                 dot are still slightly oval:
>>>
>>> http://dev.camptocamp.com/~ochriste/tilecache7_pattern.png
>>>
>>> <http://dev.camptocamp.com/%7Eochriste/tilecache7_pattern.png>
>>>                  I wondered if the visual effect may have come from the
>>>                 fact im pilling up two circle one over the other, but
>>>                 even when trying to display only the outer or inner
>>>                 circles, the circle are still slightly off:
>>>
>>> http://dev.camptocamp.com/~ochriste/tilecache4_outercircle.png
>>>
>>> <http://dev.camptocamp.com/%7Eochriste/tilecache4_outercircle.png>
>>>
>>> http://dev.camptocamp.com/~ochriste/tilecache5_innercircle.png
>>>
>>> <http://dev.camptocamp.com/%7Eochriste/tilecache5_innercircle.png>
>>>                 (both at once
>>>
>>> http://dev.camptocamp.com/~ochriste/tilecache3_bothcircle.png
>>>
>>> <http://dev.camptocamp.com/%7Eochriste/tilecache3_bothcircle.png>)
>>>                  any other idea? ^_^
>>>
>>>                     ----- Original Message -----
>>>                     *From:* thomas bonfort
>>>                     <mailto:thomas.bonfort at gmail.com>
>>>                     *To:* Oliver Christen
>>>                     <mailto:oliver.christen at camptocamp.com>
>>>                     *Cc:* mapserver-users at lists.osgeo.org
>>>                     <mailto:mapserver-users at lists.osgeo.org>
>>>                     *Sent:* Tuesday, January 12, 2010 3:18 PM
>>>                     *Subject:* Re: [mapserver-users] symbol circle
>>>                     (ellipse) rendered not round but oval
>>>
>>>                     hi Oliver :)
>>>
>>>                     try with GAP 20 instead of STYLE 1 20 END (which is
>>>                     deprecated btw, use PATTERN now)
>>>
>>>                     cheers,
>>>                     thomas
>>>
>>>                     On Tue, Jan 12, 2010 at 15:04, Oliver Christen
>>>                     <oliver.christen at camptocamp.com
>>>                     <mailto:oliver.christen at camptocamp.com>> wrote:
>>>
>>>                         hello
>>>
>>>                         I have a weird problem with symbology.
>>>                         Im rendering a line with dots, but the dots are
>>>                         not round but slightly oval, see image
>>>                         
>>> http://dev.camptocamp.com/~ochriste/tilecache.png
>>>
>>> <http://dev.camptocamp.com/%7Eochriste/tilecache.png>
>>>
>>>                         Any idea what could be the cause ?
>>>
>>>                         Here is my symbol definition:
>>>
>>>                         SYMBOL
>>>                          NAME "linie-gepunkt10"
>>>                          TYPE ELLIPSE
>>>                          POINTS
>>>                           1 1
>>>                          END
>>>                          STYLE
>>>                           1 20
>>>                          END
>>>                          FILLED TRUE
>>>                         END
>>>
>>>                         and my layer's class definition:
>>>
>>>                          CLASS
>>>                           EXPRESSION "3"
>>>                           MAXSCALEDENOM 200001
>>>                           STYLE
>>>                             SYMBOL "linie-gepunkt10"
>>>                             SIZE 10
>>>                             COLOR 102 51 0
>>>                           END
>>>                           STYLE
>>>                             SYMBOL "linie-gepunkt10"
>>>                             SIZE 8
>>>                             COLOR 204 102 0
>>>                           END
>>>                          END
>>>
>>>                         and the map outputformat:
>>>
>>>                         OUTPUTFORMAT
>>>                          NAME png
>>>                          DRIVER "AGG/PNG"
>>>                          MIMETYPE "image/png"
>>>                          IMAGEMODE RGBA
>>>                          EXTENSION "png"
>>>                          FORMATOPTION "INTERLACE=OFF"
>>>                         END
>>>                         _______________________________________________
>>>                         mapserver-users mailing list
>>>                         mapserver-users at lists.osgeo.org
>>>                         <mailto:mapserver-users at lists.osgeo.org>
>>>
>>> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>>>
>>>
>>>
>>>
>>>
>>
>> -- 
>> Håvard Tveite
>> Department of Mathematical Sciences and Technology, UMB
>> Drøbakveien 31, POBox 5003, N-1432 Ås, NORWAY
>> Phone: +47 64965483 Fax: +47 64965401 http://www.umb.no/imt/
>>
> 
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users



More information about the mapserver-users mailing list