[Geoserver-users] SLD_BODY in URL GetMap request problem

I am working up to a GetMap URL request that has a filter that picks out one feature by it’s id number.

First, I try NamedLayer/NamedStyle, which works:

http://64.119.128.70/geoserver/wms?request=getmap&version=1.1.0&service=wms&SLD_BODY=<StyledLayerDescriptor+version=%221.0.0%22+xmlns%3Agml=%22http://www.opengis.net/gml%22+xmlns%3Aogc=%22http://www.opengis.net/ogc%22+xmlns=%22http://www.opengis.net/sld%22>massgis:GISDATA.C21E_PTGISDATA.C21E_PT%3A%3ADefault&bbox=249667,918553,250454,919353&format=image/png&width=400&height=400&SRS=EPSG%3A26986

Next, I try NamedLayer/UserStyle, in an attempt to use my own color, which doesn’t work:

http://64.119.128.70/geoserver/wms?request=getmap&version=1.1.0&service=wms&SLD_BODY=<StyledLayerDescriptor+version=%221.0.0%22+xmlns%3Agml=%22http://www.opengis.net/gml%22+xmlns%3Aogc=%22http://www.opengis.net/ogc%22+xmlns=%22http://www.opengis.net/sld%22>massgis:GISDATA.C21E_PT<UserStyle+xmlns=%22http://www.opengis.net/sld%22><PropertyName+xmlns=%22http://www.opengis.net/ogc%22>SHAPESQUARE<CssParameter+name=%22fill%22>#00FFFF5&bbox=249667,918553,250454,919353&format=image/png&width=400&height=400&SRS=EPSG%3A26986

I get:

<?xml version="1.0" encoding="UTF-8" standalone="no" ?> WIDTH and HEIGHT incorrectly specified

Using GeoServer 1.3
Do I have a syntax problem?
Does 1.3 support what I’m trying to do or is this coming in a later version?

Thanks for any hint.

Aleda Freeman
MassGIS
Office of Geographic and Environmental Information
251 Causeway St. 5th floor
Boston, MA 02114
phone: 617-626-1193
fax: 617-626-1249
http://www.mass.gov/mgis - MassGIS
http://maps.massgis.state.ma.us/biodiversity - Biodiversity Days

I imagine it has to do with URL escaping, my guess is that our URL decoder interprets everything after the # as part of something else, so it doesn't pick up the remaining values.

I think the way to do it is to just use the ascii code after a percent sign - %35 is #.

So try it with CssParameter+name=%22fill%22>%3500FFFF

(The > also needs to be escaped, but I imagine your browser is doing that automatically, but it's not automatically doing the #.)

Chris

Freeman, Aleda (ENV) wrote:

I am working up to a GetMap URL request that has a filter that picks out one feature by it's id number.

First, I try NamedLayer/NamedStyle, which works:

_http://64.119.128.70/geoserver/wms?request=getmap&version=1.1.0&service=wms&SLD_BODY=&lt;StyledLayerDescriptor\+version="1\.0\.0"\+xmlns%3Agml="http://www.opengis.net/gml"+xmlns%3Aogc="http://www.opengis.net/ogc"+xmlns="http://www.opengis.net/sld"&gt;&lt;NamedLayer&gt;&lt;Name&gt;massgis:GISDATA\.C21E\_PT&lt;/Name&gt;&lt;NamedStyle&gt;&lt;Name&gt;GISDATA\.C21E\_PT%3A%3ADefault&lt;/Name&gt;&lt;/NamedStyle&gt;&lt;/NamedLayer&gt;&lt;/StyledLayerDescriptor&gt;&amp;bbox=249667,918553,250454,919353&amp;format=image/png&amp;width=400&amp;height=400&amp;SRS=EPSG%3A26986\_ <http://64.119.128.70/geoserver/wms?request=getmap&version=1.1.0&service=wms&SLD_BODY=&lt;StyledLayerDescriptor\+version="1\.0\.0"\+xmlns%3Agml="http://www.opengis.net/gml"+xmlns%3Aogc="http://www.opengis.net/ogc"+xmlns="http://www.opengis.net/sld"&gt;&lt;NamedLayer&gt;&lt;Name&gt;massgis:GISDATA\.C21E\_PT&lt;/Name&gt;&lt;NamedStyle&gt;&lt;Name&gt;GISDATA\.C21E\_PT%3A%3ADefault&lt;/Name&gt;&lt;/NamedStyle&gt;&lt;/NamedLayer&gt;&lt;/StyledLayerDescriptor&gt;&amp;bbox=249667,918553,250454,919353&amp;format=image/png&amp;width=400&amp;height=400&amp;SRS=EPSG%3A26986&gt;

Next, I try NamedLayer/UserStyle, in an attempt to use my own color, which doesn't work:

_http://64.119.128.70/geoserver/wms?request=getmap&version=1.1.0&service=wms&SLD_BODY=&lt;StyledLayerDescriptor\+version="1\.0\.0"\+xmlns%3Agml="http://www.opengis.net/gml"+xmlns%3Aogc="http://www.opengis.net/ogc"+xmlns="http://www.opengis.net/sld"&gt;&lt;NamedLayer&gt;&lt;Name&gt;massgis:GISDATA\.C21E\_PT&lt;/Name&gt;&lt;UserStyle\+xmlns="http://www.opengis.net/sld"&gt;&lt;FeatureTypeStyle&gt;&lt;Rule&gt;&lt;PointSymbolizer&gt;&lt;Geometry&gt;&lt;PropertyName\+xmlns="http://www.opengis.net/ogc"&gt;SHAPE&lt;/PropertyName&gt;&lt;/Geometry&gt;&lt;Graphic&gt;&lt;Mark&gt;&lt;WellKnownName&gt;SQUARE&lt;/WellKnownName&gt;&lt;Fill&gt;&lt;CssParameter\+name="fill"&gt;\#00FFFF&lt;/CssParameter&gt;&lt;/Fill&gt;&lt;/Mark&gt;&lt;Size&gt;5&lt;/Size&gt;&lt;/Graphic&gt;&lt;/PointSymbolizer&gt;&lt;/Rule&gt;&lt;/FeatureTypeStyle&gt;&lt;/UserStyle&gt;&lt;/NamedLayer&gt;&lt;/StyledLayerDescriptor&gt;&amp;bbox=249667,918553,250454,919353&amp;format=image/png&amp;width=400&amp;height=400&amp;SRS=EPSG%3A26986\_

I get:

<?xml version="1.0" encoding="UTF-8" standalone="no" ?><!DOCTYPE ServiceExceptionReport SYSTEM "_http://localhost:8080/geoserver/schemas//wms/1.1.1/WMS_exception_1_1_1.dtd_&quot;&gt; <ServiceExceptionReport version="1.1.1"> <ServiceException code="">WIDTH and HEIGHT incorrectly specified</ServiceException> </ServiceExceptionReport>

Using GeoServer 1.3
Do I have a syntax problem?
Does 1.3 support what I'm trying to do or is this coming in a later version?

Thanks for any hint.

Aleda Freeman
MassGIS
Office of Geographic and Environmental Information
251 Causeway St. 5th floor
Boston, MA 02114
phone: 617-626-1193
fax: 617-626-1249
_http://www.mass.gov/mgis_ - MassGIS
_http://maps.massgis.state.ma.us/biodiversity_ - Biodiversity Days

!DSPAM:1003,451d5c98211831804284693!

------------------------------------------------------------------------

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

!DSPAM:1003,451d5c98211831804284693!

------------------------------------------------------------------------

_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

!DSPAM:1003,451d5c98211831804284693!

--
Chris Holmes
The Open Planning Project
http://topp.openplans.org

Hi Aleda,

if it's stiil a problem, try using 0x (Zero x) instead of # for the color.
This works for me and i've read this in some docs, but can't remember where.

HTH, Frank

Freeman, Aleda (ENV) wrote:

I am working up to a GetMap URL request that has a filter that picks out
one feature by it's id number.

First, I try NamedLayer/NamedStyle, which works:

http://64.119.128.70/geoserver/wms?request=getmap&version=1.1.0&service=
wms&SLD_BODY=<StyledLayerDescriptor+version=%221.0.0%22+xmlns%3Agml=%22h
ttp://www.opengis.net/gml%22+xmlns%3Aogc=%22http://www.opengis.net/ogc%2
2+xmlns=%22http://www.opengis.net/sld%22><NamedLayer><Name>massgis:GISDA
TA.C21E_PT</Name><NamedStyle><Name>GISDATA.C21E_PT%3A%3ADefault</Name></
NamedStyle></NamedLayer></StyledLayerDescriptor>&bbox=249667,918553,2504
54,919353&format=image/png&width=400&height=400&SRS=EPSG%3A26986

Next, I try NamedLayer/UserStyle, in an attempt to use my own color,
which doesn't work:

http://64.119.128.70/geoserver/wms?request=getmap&version=1.1.0&service=
wms&SLD_BODY=<StyledLayerDescriptor+version=%221.0.0%22+xmlns%3Agml=%22h
ttp://www.opengis.net/gml%22+xmlns%3Aogc=%22http://www.opengis.net/ogc%2
2+xmlns=%22http://www.opengis.net/sld%22><NamedLayer><Name>massgis:GISDA
TA.C21E_PT</Name><UserStyle+xmlns=%22http://www.opengis.net/sld%22><Feat
ureTypeStyle><Rule><PointSymbolizer><Geometry><PropertyName+xmlns=%22htt
p://www.opengis.net/ogc%22>SHAPE</PropertyName></Geometry><Graphic><Mark

<WellKnownName>SQUARE</WellKnownName><Fill><CssParameter+name=%22fill%2

2>#00FFFF</CssParameter></Fill></Mark><Size>5</Size></Graphic></PointSym
bolizer></Rule></FeatureTypeStyle></UserStyle></NamedLayer></StyledLayer
Descriptor>&bbox=249667,918553,250454,919353&format=image/png&width=400&
height=400&SRS=EPSG%3A26986

I get:

<?xml version="1.0" encoding="UTF-8" standalone="no" ?><!DOCTYPE
ServiceExceptionReport SYSTEM
"http://localhost:8080/geoserver/schemas//wms/1.1.1/WMS_exception_1_1_1.
dtd"> <ServiceExceptionReport version="1.1.1"> <ServiceException
code="">WIDTH and HEIGHT incorrectly specified</ServiceException>
</ServiceExceptionReport>

Using GeoServer 1.3
Do I have a syntax problem?
Does 1.3 support what I'm trying to do or is this coming in a later
version?

Thanks for any hint.

Aleda Freeman
MassGIS
Office of Geographic and Environmental Information
251 Causeway St. 5th floor
Boston, MA 02114
phone: 617-626-1193
fax: 617-626-1249
http://www.mass.gov/mgis - MassGIS
http://maps.massgis.state.ma.us/biodiversity - Biodiversity Days

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share
your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

--
View this message in context: http://www.nabble.com/SLD_BODY-in-URL-GetMap-request-problem-tf2358269.html#a7111576
Sent from the GeoServer - User mailing list archive at Nabble.com.