[Mapserver-users] SLD Problems

Bart van den Eijnden bartvde at xs4all.nl
Fri Mar 5 07:59:21 EST 2004


Hi Stefan,

don't think the problem is in the MAP file, but here it goes.

As for Studio, it is an OGC-centric application that allows you to create 
classes and styles for use in SLD documents. I am only doing a sort of 
beta test (0.99 version), but for sure if you ask DM Solutions, you can 
have a beta test copy as well. This would simplify the process you are 
going through now.

Best regards,
Bart

MAP
   EXTENT 10000 305000 280000 619000
   IMAGECOLOR 255 255 255
   IMAGETYPE png
   INTERLACE TRUE
   SHAPEPATH "../data"
   SIZE 860 590
   STATUS ON
   TRANSPARENT FALSE
   UNITS METERS
   NAME "DEMO"

   OUTPUTFORMAT
     NAME png
     MIMETYPE image/png
     DRIVER GD/PNG
     EXTENSION png
     IMAGEMODE PC256
     TRANSPARENT FALSE
   END

   PROJECTION
     "init=EPSG:28992"
   END
   LEGEND
       IMAGECOLOR 255 255 255
     KEYSIZE 18 12
     KEYSPACING 5 5
     LABEL
       SIZE MEDIUM
       TYPE BITMAP
       BUFFER 0
       COLOR 0 0 89
       FORCE FALSE
       MINDISTANCE -1
       MINFEATURESIZE -1
       OFFSET 0 0
       PARTIALS TRUE
     END
     POSITION LL
     STATUS ON
     #TEMPLATE 
"d:/ms4w/maplab-2.1-rc1/htdocs/mapbrowser/legend_template.html"
   END

   QUERYMAP
       COLOR 255 0 0
     SIZE -1 -1
     STATUS OFF
     STYLE HILITE
   END

   SCALEBAR
       BACKGROUNDCOLOR 0 0 0
       COLOR 255 255 255
     IMAGECOLOR 255 255 255
     INTERVALS 5
     LABEL
       SIZE SMALL
       TYPE BITMAP
       BUFFER 0
       COLOR 0 0 0
       FORCE FALSE
       MINDISTANCE -1
       MINFEATURESIZE -1
       OFFSET 0 0
       PARTIALS TRUE
       POSITION UL
     END
       OUTLINECOLOR 0 0 0
     POSITION LL
     SIZE 150 5
     STATUS OFF
     STYLE 0
     UNITS KILOMETERS
   END

   WEB
     IMAGEPATH "/ms4w/tmp/ms_tmp/"
     IMAGEURL "/ms_tmp/"
     METADATA
       WMS_TITLE "Gemeentes mapserver WMS"
       WMS_ABSTRACT "UMN MapServer Gemeentekaart"
       WMS_ACCESSCONSTRAINTS none
       WMS_SRS "EPSG:28992"
       WFS_TITLE "Gemeentes mapserver WFS"
			WFS_ONLINERESOURCE 
"http://www.vz.geodan.nl:1111/cgi-bin/mapserv.exe?map=/ms4w/apps/general/map/gemeentes.map"
			WFS_SRS "EPSG:28992"
			OWS_SCHEMAS_LOCATION "http://ogc.dmsolutions.ca"
     END
   END

   LAYER
       DATA "Nlge_r98"
         METADATA
           WMS_TITLE "Gemeentes"
           WMS_ABSTRACT "Gemeentes via UMN Mapserver"
           WMS_SRS "EPSG:28992"
           WFS_TITLE "Gemeentes"
         END
       NAME "Gemeentes"
       SIZEUNITS PIXELS
       STATUS ON
       TOLERANCE 0
       TOLERANCEUNITS PIXELS
       TYPE POLYGON
       DUMP TRUE
       TEMPLATE "blank.html"
       UNITS METERS
       CLASS
         NAME "Foreign Lands"
         STYLE
           MAXSIZE 100
           MINSIZE 1
             OUTLINECOLOR 255 0 0
           SIZE 1
           SYMBOL 0
         END
       END
     END

END

On Fri, 05 Mar 2004 13:47:47 +0100, Stefan Schwarzer 
<stefan.schwarzer at grid.unep.ch> wrote:

> Bart,
>
> thanks for the script. Don't see so much difference though to mine. Could
> you perhaps send as well the map file, or at least the necessary parts, 
> so
> that I can compare that as well? The uppercase didn't succeed...
>
> And what's the Studio? Haven't heard about it and haven't seen it either 
> on
> their web site.
>
> Thanks for your help,
>
> Stefan
>
>
>
>> Hi Stefan,
>>
>> below is an SLD document which works for me on Mapserver. I have just
>> created this SLD with a test version of Studio, the new product by DM
>> Solutions for creating SLD documents.
>>
>> Note that the NAME is all uppercase in my generated SLD, I don't know 
>> why
>> this is the case, because it is not according to spec as far as I know.
>> You could try changing that in your SLD. Also, is your Mapserver binary
>> new enough for this stuff?
>>
>> Best regards,
>> Bart
>>
>> <StyledLayerDescriptor version="1.0.0">
>> <NamedLayer>
>> <NAME>Gemeentes</NAME>
>> <UserStyle>
>> <FeatureTypeStyle>
>> <Rule>
>> <Filter><PropertyIsEqualTo><PropertyName>GEMNAAM</PropertyName><Literal>Deurne</Literal></PropertyIsEqualTo></Filter>
>> <PolygonSymbolizer>
>> <Fill>
>> <CssParameter name="fill">#8f0000</CssParameter>
>> <GraphicFill>
>> <Graphic>
>> <Size>1</Size>
>> <Mark>
>> <WellKnownName>cross</WellKnownName>
>> <Fill>
>> <CssParameter name="fill">#8f0000</CssParameter>
>> </Fill>
>> </Mark>
>> </Graphic>
>> </GraphicFill>
>> </Fill>
>> </PolygonSymbolizer>
>> </Rule>
>> </FeatureTypeStyle>
>> </UserStyle>
>> </NamedLayer>
>> </StyledLayerDescriptor>
>>
>> Best regards,
>> Bart
>>
>> On Fri, 05 Mar 2004 10:28:53 +0100, Stefan Schwarzer
>> <stefan.schwarzer at grid.unep.ch> wrote:
>>
>>> Hi there,
>>>
>>> I am trying to change the layer properties via SLD. Although I think I
>>> setup everything correctly, it just doesn't want to work. Could anyone
>>> perhaps give me a hint on what I do wrong? See below the URL, the SLD 
>>> and
>>> the MAP file. The map displays, but not with the desired changes in 
>>> fill
>>> and stroke.
>>>
>>> Thanks for any help,
>>>
>>> Stefan
>>>
>>>
>>> http://localhost/cgi-bin/mapserv_41.exe?SERVICE=WMS&VeRsIoN=1.1.1&Request=GetMap&map=E:/inetpub/wwwroot/wms_maps/wms.map&layers=boundaries&SLD=http//localhost/wms_maps/sld.xml
>>>
>>>
>>>
>>> <StyledLayerDescriptor version="1.0.0">
>>>          <NamedLayer>
>>>                  <Name>boundaries</Name>
>>>                  <UserStyle>
>>>                          <Title>xxx</Title>
>>>                          <FeatureTypeStyle>
>>>                                  <Rule>
>>>                                          <PolygonSymbolizer>
>>>                                                  <Fill>
>>>                                                          <CssParameter
>>> name="fill">#0000ff</CssParameter>
>>>                                                  </Fill>
>>>                                                  <Stroke>
>>>                                                          <CssParameter
>>> name="stroke">#ff0000</CssParameter>
>>>                                                  </Stroke>
>>>                                          </PolygonSymbolizer>
>>>                                  </Rule>
>>>                          </FeatureTypeStyle>
>>>                  </UserStyle>
>>>          </NamedLayer>
>>> </StyledLayerDescriptor>
>>>
>>>
>>>
>>> #
>>> # Start of map file
>>> #
>>>
>>> NAME boundaries
>>>          STATUS ON
>>>          SIZE 600 300
>>>          EXTENT -180 -90 180 90
>>>          UNITS DD
>>>          SHAPEPATH "data"
>>>          IMAGETYPE PNG
>>>          FONTSET etc/fonts.txt
>>>
>>>
>>>
>>>          # Projection definition ---------------------
>>>
>>>          PROJECTION
>>>                  "init=epsg:4326"
>>>                  proj=latlong
>>>                  ellps=WGS84
>>>          END
>>>
>>>          # End Projection definition ---------------------
>>>
>>>
>>>
>>>          # Web definition ---------------------
>>>
>>>          WEB
>>>                  HEADER demo_header.html
>>>                  TEMPLATE demo.html
>>>                  FOOTER demo_footer.html
>>>
>>>                  IMAGEPATH '../temp/'
>>>                  IMAGEURL 'temp/'
>>>
>>>                  METADATA
>>>                          "wms_title" "boundaries"
>>>                          "wms_onlineresource"
>>> "http://my_server/cgi-bin/mapserv_41.exe?map=E:/inetpub/wwwroot/wms_maps/wms.map?"
>>>                  END
>>>          END
>>>
>>>          # End Web definition ---------------------
>>>
>>>
>>>
>>>          LAYER
>>>                  NAME boundaries
>>>                  TYPE POLYGON
>>>                  STATUS ON
>>>                  DATA boundaries
>>>                  DUMP TRUE
>>>                  CLASSITEM CNTRY_NAME
>>>                  CLASS
>>>                          NAME 'boundaries'
>>>                          OUTLINECOLOR 0 0 0
>>>                          COLOR 100 100 100
>>>                          TEMPLATE 'dummy'
>>>                  END
>>>                  METADATA
>>>                          wms_title "boundaries"
>>>                  END
>>>          END
>>>
>>> END # Map File
>>>
>>>
>>>
>>>
>>>          _______________________________________
>>>
>>>          Stefan Schwarzer
>>>          Consultant on GEO
>>>
>>>          UNEP/DEWA/GRID-Geneva
>>>          Chemin des Anemones 11
>>>          CH - 1219 Chatelaine
>>>          Switzerland
>>>
>>>          Tel: (+41) 22.917.83.49
>>>          Fax: (+41) 22.917.80.29
>>>
>>>          Email: stefan.schwarzer at grid.unep.ch
>>>          Internet: http://geodata.grid.unep.ch/
>>>          _______________________________________
>>
>>
>>
>> --
>>
>
>          _______________________________________
>
>          Stefan Schwarzer
>          Consultant on GEO
>
>          UNEP/DEWA/GRID-Geneva
>          Chemin des Anemones 11
>          CH - 1219 Chatelaine
>          Switzerland
>
>          Tel: (+41) 22.917.83.49
>          Fax: (+41) 22.917.80.29
>
>          Email: stefan.schwarzer at grid.unep.ch
>          Internet: http://geodata.grid.unep.ch/
>          _______________________________________



-- 
  



More information about the mapserver-users mailing list