[Mapserver-users] SLD Problems for Win32

Yewondwossen Assefa assefa at dmsolutions.ca
Fri Apr 23 14:20:18 EDT 2004


Rene,

  I was trying to reproduce your problem with my own data. Here is what 
I have tested : sld containing 2 named layers and both named layers use 
LineSymbolizers. I was able to render the map without problem.

I have setup a quick demo (using mapserver 4.2b1) so you can see the slds.

http://www2.dmsolutions.ca/cgi-bin/mswms_world?SERVICE=WMS&VeRsIoN=1.1.1&Request=GetMap&LAYERS=WorldGen_Outline,WorldRoads&SLD=http://localhost/msapps/world_testdata/tests/sld_tests/sld_test_rene.xml&BBOX=-81.366241839,42.39269586,-77.8780568047,44.13861927

http://www2.dmsolutions.ca/cgi-bin/mswms_world?SERVICE=WMS&VeRsIoN=1.1.1&Request=GetMap&LAYERS=WorldGen_Outline,WorldRoads&SLD=http://localhost/msapps/world_testdata/tests/sld_tests/sld_test_rene2.xml&BBOX=-81.366241839,42.39269586,-77.8780568047,44.13861927

  From what I gathered this is the type of sld's that you are having 
problem with. Please have a look and let me know if that is the case.
(As you have seen I have not tested this using a wms client, but just a 
http call to a wms server. I do not think that It matters though).

  If you still have a problem, you might send me the wms server map 
fileand releted sld with tests URL's so I can set it up here.

Best Regards,


Rene Teniere wrote:
> Hi All,
> 
> Thought version 4.2b1 would have solved my problems, however, they are
> still there. I can't seem to be able to add more than one NamedLayer for
> each symbolizer type (ie: line, polygon, etc.). It works fine as long as
> I don't have more than one layer per type. Example:
> 
> This works:
> <StyledLayerDescriptor version="1.0.0">
>   <NamedLayer>
>     <Name>Shoreline</Name>
>     <UserStyle>
>       <FeatureTypeStyle>
>         <Rule>
>           <LineSymbolizer>
>             <Stroke>
>               <CssParameter name="stroke">#000000</CssParameter>
>             </Stroke>
>           </LineSymbolizer>
>         </Rule>
>       </FeatureTypeStyle>
>     </UserStyle>
>   </NamedLayer>
>   <NamedLayer>
>     <Name>Lakes</Name>
>     <UserStyle>
>       <FeatureTypeStyle>
>         <Rule>
>           <PolygonSymbolizer>
>             <Fill>
>               <CssParameter name="fill">#000000</CssParameter>
>             </Fill>
>             <Stroke>
>               <CssParameter name="stroke">#000000</CssParameter>
>             </Stroke>
>           </PolygonSymbolizer>
>         </Rule>
>       </FeatureTypeStyle>
>     </UserStyle>
>   </NamedLayer>
> </StyledLayerDescriptor>
> 
> This doesn't:
> <StyledLayerDescriptor version="1.0.0">
>   <NamedLayer>
>     <Name>Shoreline</Name>
>     <UserStyle>
>       <FeatureTypeStyle>
>         <Rule>
>           <LineSymbolizer>
>             <Stroke>
>               <CssParameter name="stroke">#000000</CssParameter>
>             </Stroke>
>           </LineSymbolizer>
>         </Rule>
>       </FeatureTypeStyle>
>     </UserStyle>
>   </NamedLayer>
>   <NamedLayer>
>     <Name>Rivers</Name>
>     <UserStyle>
>       <FeatureTypeStyle>
>         <Rule>
>           <LineSymbolizer>
>             <Stroke>
>               <CssParameter name="stroke">#0000ff</CssParameter>
>             </Stroke>
>           </LineSymbolizer>
>         </Rule>
>       </FeatureTypeStyle>
>     </UserStyle>
>   </NamedLayer>
>   <NamedLayer>
>     <Name>Lakes</Name>
>     <UserStyle>
>       <FeatureTypeStyle>
>         <Rule>
>           <PolygonSymbolizer>
>             <Fill>
>               <CssParameter name="fill">#000000</CssParameter>
>             </Fill>
>             <Stroke>
>               <CssParameter name="stroke">#000000</CssParameter>
>             </Stroke>
>           </PolygonSymbolizer>
>         </Rule>
>       </FeatureTypeStyle>
>     </UserStyle>
>   </NamedLayer>
> </StyledLayerDescriptor>
> 
> Server Mapfile:
> MAP
>   NAME "Base Data WMS Map File"
>   SHAPEPATH "d:/GIS_Data/"
>   SYMBOLSET "c:/Inetpub/wwwroot/wms/etc/nsdnr_symbols.sym"
>   FONTSET "c:/Inetpub/wwwroot/wms/etc/fonts.txt"
>   STATUS ON
>   WEB
>     IMAGEPATH "c:/temp/tmp/"
>     IMAGEURL "/temp/tmp/"
>     METADATA
>       "wms_title"                        "Nova Scotia NFIS Server"
>       "wms_onlineresource"              
> "http://10.2.185.9/cgi-bin/mapserv41.exe?map=/inetpub/wwwroot/wms/basewms.map&"
>       "wms_srs"                          "EPSG:2038"
> 
>       #Optional wms entries:
>       "wms_contactperson"                "Richard Morash"
>       "wms_contactorganization"          "Nova Scotia Department of
> Natural Resources, Forestry Division"
>       "wms_contactposition"              "GIS Project Manager"
>       "wms_abstract"                     "Nova Scotia Department of
> Natural Resources Forestry Division. This is Nova Scotia's Base Data
> Open GIS Consortium Web Map Server for sustainable forest management."
>       "wms_keywordlist"                 
> "WAP,Forest,Information,System,gis,sustainable,management"
>       "wms_addresstype"                  "Postal"
>       "wms_address"                      "664 Prince Street PO BOX 68"
>       "wms_city"                         "Truro"
>       "wms_stateorprovince"              "Nova Scotia"
>       "wms_postcode"                     "B2N 5B8"
>       "wms_country"                      "CANADA"
>       "wms_contactvoicetelephone"        "(902) 893-5657"
>       "wms_contactfacsimiletelephone"    "(902) 893-6102"
>       "wms_contactelectronicmailaddress" "rmorash at gov.ns.ca"
>       "wms_accessconstraints"            "WMS image only"
>       "wms_fees"                         "None"
>     END 
>   END
>   PROJECTION
>     #UTM Zone 20 NAD83 for Nova Scotia
>     "init=epsg:2038" 
>   END
>   LAYER
>     NAME "Shoreline"
>     DATA "shoreutm/shoreutm"
>     TYPE LINE
>     GROUP "Base Data"
>     METADATA
>       "wms_title"       "Shoreline"
>       "wms_srs"         "EPSG:2038"
>       "wms_group_title" "Base Data"
>     END 
>     CLASS
>       STYLE
>         SYMBOL 0
>         COLOR 72 164 255
>         SIZE 2
>         MINSIZE 1
>         MAXSIZE 100
>       END
>     END
>   END
>   LAYER
>     NAME "Lakes"
>     #STATUS OFF
>     DATA "nslake83/nslake83.shp"
>     TYPE POLYGON
>     GROUP "Base Data"
>     METADATA
>       "wms_title"       "Lakes"
>       "wms_srs"         "EPSG:2038"
>       "wms_group_title" "Base Data"
>     END
>     CLASS
>       STYLE
>         SYMBOL 0
>         COLOR 132 193 255
>         OUTLINECOLOR 0 0 230
>         BACKGROUNDCOLOR 72 164 255
>         MINSIZE 1
>         MAXSIZE 100
>       END
>     END
>   END
>   LAYER
>     NAME "Rivers"
>     STATUS OFF
>     TYPE LINE
>     TILEINDEX "coindex/coindex"
>     TILEITEM "lorivers"
>     GROUP "Base Data"
>     CLASSITEM "rivers_id"
>     METADATA
>       "wms_title"          "Rivers"
>       "wms_srs"            "EPSG:2038"
>       "wms_group_title"    "Base Data"
>     END 
>     CLASS
>       EXPRESSION /./
>       STYLE
>         SYMBOL 0
>         COLOR 0 0 230
>         SIZE 1
>         MINSIZE 1
>         MAXSIZE 100
>       END
>     END
>   END
> 
> Client Mapfile:
> MAP
>   NAME "Nova Scotia WAP Page"
>   STATUS ON
>   EXTENT 180504 4786079 806737 5255785 
>   SIZE 400 300 
>   IMAGETYPE PNG24
>   IMAGECOLOR 255 255 255
>   UNITS METERS
>   RESOLUTION 90.714286
>   WEB
>     IMAGEPATH "c:/temp/tmp/"
>     IMAGEURL "/temp/tmp/"
>   END
>   QUERYMAP
>     STATUS ON
>     SIZE -1 -1 
>     COLOR 255 255 0
>     STYLE HILITE
>   END
>   PROJECTION
>     #UTM Zone 20 NAD83 for Nova Scotia
>     "init=epsg:2038" 
>   END
>   SCALEBAR
>     STATUS ON
>     COLOR 255 255 255
>     OUTLINECOLOR 0 0 0
>     BACKGROUNDCOLOR 0 0 0
>     IMAGECOLOR 255 255 255
>     UNITS METERS
>     INTERVALS 5
>     SIZE 250 5 
>     STYLE 0
>     POSITION LL
>     LABEL
>       TYPE BITMAP
>       SIZE SMALL
>       OFFSET 0 0 
>       BUFFER 0
>       MINDISTANCE -1
>       MINFEATURESIZE -1
>       COLOR 0 0 0
>       PARTIALS TRUE
>       FORCE FALSE
>     END
>   END
>   OUTPUTFORMAT
>     NAME "PNG24"
>     MIMETYPE "image/png"
>     DRIVER "GD/PNG"
>     EXTENSION "png"
>     IMAGEMODE RGB
>   END
>   REFERENCE
>     IMAGE "d:/www/gmap/wap/images/keymap.png"
>     EXTENT 180504 4786079 806737 5255785 
>     SIZE 175 131
>     STATUS ON
>     COLOR -1 -1 -1
>     OUTLINECOLOR 255 0 0
>   END
>   LEGEND
>     STATUS ON
>     KEYSIZE 18 12
>     TEMPLATE "d:/www/gmap/wap/templates/legend_template_all.html"
>     LABEL
>       TYPE BITMAP
>       SIZE SMALL
>       COLOR 0 0 89
>     END
>   END
>   LAYER
>     NAME "Shoreline"
>     GROUP "Base Data"
>     STATUS ON
>     TYPE LINE
>     UNITS METERS
>     SIZEUNITS PIXELS
>     TOLERANCE 0
>     TOLERANCEUNITS PIXELS
>     CONNECTIONTYPE WMS
>     CONNECTION
> "http://10.2.185.9/cgi-bin/mapserv41.exe?map=/inetpub/wwwroot/wms/basewms.map&"
>     METADATA
>       "wms_srs"               "EPSG:2038"
>       "wms_name"              "Shoreline"
>       "wms_server_version"    "1.1.1"
>       "wms_formatlist"       
> "image/png,image/gif,image/jpeg,image/wbmp"
>       "wms_format"            "image/png"
>       "wms_connectiontimeout" "45"
>       "wms_sld_url"          
> "http://10.2.185.9/wms/sld/basewms_sld.xml"
>     END
>   END
>   LAYER
>     NAME "Lakes"
>     GROUP "Base Data"
>     STATUS ON
>     TEMPLATE "d:/www/gmap/wap/templates/blank.html"
>     TYPE POLYGON
>     MAXSCALE 500000
>     TOLERANCE 10
>     TOLERANCEUNITS PIXELS
>     CONNECTIONTYPE WMS
>     CONNECTION
> "http://10.2.185.9/cgi-bin/mapserv41.exe?map=/inetpub/wwwroot/wms/basewms.map&"
>     METADATA
>       "wms_srs"               "EPSG:2038"
>       "wms_name"              "Lakes"
>       "wms_server_version"    "1.1.1"
>       "wms_formatlist"       
> "image/png,image/gif,image/jpeg,image/wbmp"
>       "wms_format"            "image/png"
>       "wms_connectiontimeout" "45"
>       "wms_sld_url"          
> "http://10.2.185.9/wms/sld/basewms_sld.xml"
>     END
>   END
>   LAYER
>     NAME "Rivers"
>     GROUP "Base Data"
>     STATUS ON
>     TEMPLATE "d:/www/gmap/wap/templates/blank.html"
>     TYPE LINE
>     MAXSCALE 500000
>     TOLERANCE 10
>     TOLERANCEUNITS PIXELS
>     CONNECTIONTYPE WMS
>     CONNECTION
> "http://10.2.185.9/cgi-bin/mapserv41.exe?map=/inetpub/wwwroot/wms/basewms.map&"
>     METADATA
>       "wms_srs"               "EPSG:2038"
>       "wms_name"              "Rivers"
>       "wms_server_version"    "1.1.1"
>       "wms_formatlist"       
> "image/png,image/gif,image/jpeg,image/wbmp"
>       "wms_format"            "image/png"
>       "wms_connectiontimeout" "45"
>       "wms_sld_url"          
> "http://10.2.185.9/wms/sld/basewms_sld.xml"
>     END
>   END
> 
> Thanks,
> Rene
> _______________________________________________
> Mapserver-users mailing list
> Mapserver-users at lists.gis.umn.edu
> http://lists.gis.umn.edu/mailman/listinfo/mapserver-users
> 


-- 
----------------------------------------------------------------
Assefa Yewondwossen
Software Analyst

Email: assefa at dmsolutions.ca
http://www.dmsolutions.ca/

Phone: (613) 565-5056 (ext 14)
Fax:   (613) 565-0925
----------------------------------------------------------------





More information about the mapserver-users mailing list