[Geoserver-jp] GetFeatureと日本語のパラメータ名

Mario Basa mario.basa @ gmail.com
2010年 10月 27日 (水) 10:58:55 EDT


Hello again.

I was really having problems with a Geoserver WFS request to a PostGIS
(UTF-8) feature that has Japanese parameterName, since  it seems that
Japanese characters are always converted to ISO-8559-1 encoding first.

So this  GetFeature request did not work for me:

http://localhost:8080/geoserver/wfs?request=GetFeature&typeName=m:census2005&propertyname=人口総数&maxfeatures=1

To fix this, I added a URIEncoding="UTF-8" and
useBodyEncodingForURI="true" into Tomcat's conf/server.xml Connector
setting:

<Connector port="8080" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" URIEncoding="UTF-8"
               useBodyEncodingForURI="true" />


and since I am using an ajp proxy, I added both parameters here as well:

<!-- Define an AJP 1.3 Connector on port 8009 -->

    <Connector port="8009" protocol="AJP/1.3" redirectPort="8443"
tomcatAuthentification="false"
                URIEncoding="UTF-8" useBodyEncodingForURI="true" />


So now, when I make the same GetFeature request I can now get this:

<gml:featureMembers>
   <m:census2005 gml:id="census2005.fid-386b25a0_12bee18cf90_-7ffe">
   <m:人口総数>202801</m:人口総数>
   </m:census2005>
</gml:featureMembers>



Hope that somebody might find this useful.

Regards,

Mario.


geoserver-jp メーリングリストの案内