[mapserver-users] Apply style on osm layer using sld

vineet singh vini.vineetsingh at gmail.com
Wed Feb 1 02:53:04 PST 2017


Sorry for wrong title, I meant to say styling rather than sld.

Thanks
Vineet Singh

On Feb 1, 2017 3:34 PM, "Rahkonen Jukka (MML)" <
jukka.rahkonen at maanmittauslaitos.fi> wrote:

> Hi,
>
>
>
> Could you clarify which part of your problem has a connection with SLD?
>
>
>
> -Jukka Rahkonen-
>
>
>
> vineet singh wrote:
> [mapserver-users] Apply style on osm layer using sld
>
>
>
> Hi All,
>
>
>
>
>
> I'm trying style a vector layer containing OSM data (places) using the
> mapscript style shown below. It works so long as I don't add any styling
> entry pertaining to labels.
>
> However, adding label styling makes MapServer crash while making WMS calls.
>
> It shows a few points with labeled but shortly thereafter, the mapserver
> instance crashes. There is no error statement  in log file also.
>
> This how my layer looks like in  map file :
>
>     LAYER
>
>     CONNECTION "host=localhost port=5432 user=abc password=asdf123
> dbname=abc"
>
>     CONNECTIONTYPE POSTGIS
>
>     DATA 'geom from "OSM_places" using unique gid using srid=4326'
>
>     EXTENT 68.5094575 6.6791812 97.0315678 35.368417
>
>     FILTER ((( ("[type]" ="city") OR  ("[type]" ="town") OR  ("[type]"
> ="village") OR  ( ("[type]"  != "town") And ( ("[type]"  != "town") And
> ("[type]"  != "town")) ) )))
>
>     METADATA
>
>       "type"  "vector"
>
>       "wms_srs"                 "EPSG:4326 CRS:84"
>
>       "wfs_srs"                   "EPSG:4326"
>
>       "tinyows_retrievable"                     "1"
>
>       "ows_enable_request"                    "*"
>
>       "tinyows_table"        "OSM_places"
>
>       "wfs_namespace_prefix"                "abc"
>
>       "tinyows_writable"   "1"
>
>       "wfs_title"                 "OSM_places"
>
>       "wfs_namespace_uri"                     "http://www.abc.com/"
>
>       "wms_title"               "OSM_places"
>
>     END # METADATA
>
>     NAME "OSM_places"
>
>     PROJECTION
>
>       "proj=longlat"
>
>       "datum=WGS84"
>
>       "no_defs"
>
>     END # PROJECTION
>
>     STATUS OFF
>
>     TEMPLATE "tempalte.html"
>
>     TILEITEM "location"
>
>     TYPE POINT
>
>     UNITS METERS
>
>     CLASS
>
>       NAME "Unknown"
>
>       EXPRESSION ( ("[type]" ="city"))
>
>       LABEL
>
>         ANGLE AUTO
>
>         SIZE 12
>
>         COLOR 255 255 255
>
>         OFFSET 0 5
>
>         OUTLINECOLOR 0 0 0
>
>         POSITION LC
>
>         SHADOWSIZE 1 1
>
>       END # LABEL
>
>       MAXSCALEDENOM 7e+06
>
>       STYLE
>
>         COLOR 255 0 0
>
>         SIZE 6
>
>         SYMBOL "sld_mark_symbol_circle_filled"
>
>       END # STYLE
>
>       TEXT ("[name]")
>
>     END # CLASS
>
>     CLASS
>
>       NAME "Unknown"
>
>       EXPRESSION ( ("[type]" ="town"))
>
>       LABEL
>
>         ANGLE AUTO
>
>         SIZE 12
>
>         COLOR 255 255 255
>
>         OFFSET 0 5
>
>         OUTLINECOLOR 0 0 0
>
>         POSITION LC
>
>         SHADOWSIZE 1 1
>
>       END # LABEL
>
>       MAXSCALEDENOM 900000
>
>       STYLE
>
>         COLOR 255 0 0
>
>         SIZE 6
>
>         SYMBOL "sld_mark_symbol_circle_filled"
>
>       END # STYLE
>
>       TEXT ("[name]")
>
>     END # CLASS
>
>     CLASS
>
>       NAME "Unknown"
>
>       EXPRESSION ( ("[type]" ="village"))
>
>       LABEL
>
>         ANGLE AUTO
>
>         SIZE 12
>
>         COLOR 255 255 255
>
>         OFFSET 0 5
>
>         OUTLINECOLOR 0 0 0
>
>         POSITION LC
>
>         SHADOWSIZE 1 1
>
>       END # LABEL
>
>       MAXSCALEDENOM 500000
>
>       STYLE
>
>         COLOR 255 0 0
>
>         SIZE 6
>
>         SYMBOL "sld_mark_symbol_circle_filled"
>
>       END # STYLE
>
>       TEXT ("[name]")
>
>     END # CLASS
>
>      CLASS
>
>       NAME "Unknown"
>
>       EXPRESSION ( ( ("[type]"  != "town") And ( ("[type]"  != "town") And
> ("[type]"  != "town")) ) )
>
>       LABEL
>
>         ANGLE AUTO
>
>         SIZE 12
>
>         COLOR 255 255 255
>
>         OFFSET 0 5
>
>         OUTLINECOLOR 0 0 0
>
>         POSITION LC
>
>         SHADOWSIZE 1 1
>
>       END # LABEL
>
>       MAXSCALEDENOM 100000
>
>       STYLE
>
>         COLOR 255 0 0
>
>         SIZE 6
>
>         SYMBOL "sld_mark_symbol_circle_filled"
>
>       END # STYLE
>
>       TEXT ("[name]")
>
>     END # CLASS
>
>   END # LAYER
>
>
>
> After removing TEXT ("[name]") from each class it shows all points but
> with this TEXT ("[name]") in layer mapserver crashes.
>
> Log file :
>
>   [Wed Feb  1 13:04:19 2017].298440 msDrawMap(): Layer 12 (OSM_places),
> 0.012s
>
> [Wed Feb  1 13:04:19 2017].298478 setting outlinewidth to 1 (1, 10, 10)
>
> [Wed Feb  1 13:04:19 2017].298713 setting outlinewidth to 1 (1, 10, 10)
>
> [Wed Feb  1 13:04:19 2017].298923 setting outlinewidth to 1 (1, 10, 10)
>
> [Wed Feb  1 13:04:19 2017].299227 setting outlinewidth to 1 (1, 10, 10)
>
> [Wed Feb  1 13:04:19 2017].299415 setting outlinewidth to 1 (1, 10, 10)
>
> [Wed Feb  1 13:04:19 2017].299765 msDrawMap(): Drawing Label Cache, 0.001s
>
> [Wed Feb  1 13:04:19 2017].299772 msDrawMap() total time: 0.014s
>
> [Wed Feb  1 13:04:19 2017].302860 msSaveImage(stdout) total time: 0.003s
>
> [Wed Feb  1 13:04:19 2017].302888 mapserv request processing time
> (msLoadMap not incl.): 0.017s
>
> [Wed Feb  1 13:04:19 2017].302893 msFreeMap(): freeing map at 0x104c030.
>
> [Wed Feb  1 13:04:19 2017].318020 CGI Request 309 on process 7081
>
> [Wed Feb  1 13:04:19 2017].318575 msDrawMap(): rendering using
> outputformat named png (AGG/PNG).
>
> [Wed Feb  1 13:04:19 2017].318593 msDrawMap(): WMS/WFS set-up and query,
> 0.000s
>
> [Wed Feb  1 13:04:19 2017].318604 msDrawRasterLayerLow(world): entering.
>
> [Wed Feb  1 13:04:19 2017].319702 msDrawMap(): Layer 0 (world), 0.001s
>
> [Wed Feb  1 13:04:19 2017].319724 msDrawMap(): Drawing Label Cache, 0.000s
>
> [Wed Feb  1 13:04:19 2017].319728 msDrawMap() total time: 0.002s
>
> [Wed Feb  1 13:04:19 2017].324501 msSaveImage(stdout) total time: 0.005s
>
> [Wed Feb  1 13:04:19 2017].324533 mapserv request processing time
> (msLoadMap not incl.): 0.007s
>
> [Wed Feb  1 13:04:19 2017].324538 msFreeMap(): freeing map at 0x104c030.
>
> [Wed Feb  1 13:04:19 2017].326716 CGI Request 310 on process 7081
>
> [Wed Feb  1 13:04:19 2017].326980 msDrawMap(): rendering using
> outputformat named png (AGG/PNG).
>
> [Wed Feb  1 13:04:19 2017].326992 msDrawMap(): WMS/WFS set-up and query,
> 0.000s
>
> [Wed Feb  1 13:04:19 2017].327003 msDrawRasterLayerLow(world): entering.
>
> [Wed Feb  1 13:04:19 2017].328067 msDrawMap(): Layer 0 (world), 0.001s
>
> [Wed Feb  1 13:04:19 2017].328087 msDrawMap(): Drawing La
>
>
>
> I am using Mapserver 7.0.1 running as an fcgi process via nginx.
>
> Any idea on what could be wrong? Is there a way I can get a crash dump to
> help debug this better?
>
>
>
> Regards,
>
> Vineet SIngh
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20170201/ffd12e2a/attachment.htm>


More information about the MapServer-users mailing list