2

I have an Oracle Spatial 11g geodatabase connected to GeoServer 2.8 through Oracle plugin. Some feature classes have field names with % (percent) characters, e.g. NAME%EN or AREA%KM2.

The layer shows up correctly and all its attributes are passed with GetFeatureInfo request. However, I cannot use SLD styling that is based on those fields (e.g. creating thematic map based on AREA%KM2 field).

Does anyone have experience with tables using field names with % characters? They are accepted by Oracle naming standards so I hoped GeoServer will handle them too.

  • Can you add the error message from the log file. – Ian Turton Nov 1 '15 at 17:38
  • The basic error is as follows: 2015-11-01 20:57:11,475 INFO [geoserver.wms] - Request: getServiceInfo 2015-11-01 20:57:11,480 ERROR [geoserver.ows] - org.geoserver.platform.ServiceException: The requested Style can not be used with this layer. The style specifies an attribute of R$POP$DENSITY and the layer is: test:AREAS – jan_b Nov 1 '15 at 19:59
  • I tried also with SLD Rest Service (docs.geoserver.org/stable/en/user/community/sldservice/…), which returned the following errors: 2015-10-31 02:56:55,419 ERROR [geoserver.rest] - Error generating Classification! 2015-10-31 02:56:55,419 DEBUG [geoserver.filters] - Compressing output for mimetype: text/plain – jan_b Nov 1 '15 at 20:01
  • Your layer name must be a valid xml name see osgeo-org.1560.x6.nabble.com/… but % is illegal – Ian Turton Nov 1 '15 at 20:10
  • Layer name does not contain "%", only some field names do. "%" is accepted by Oracle. Moreover, SLD XML file created based on such field names also validates correctly in Geoserver... – jan_b Nov 1 '15 at 20:31
2

You might be affected by this ticket: https://osgeo-org.atlassian.net/browse/GEOT-5176 In other words, it might well be that we have to quote the attribute names when writing queries

  • Sounds like a similar issue. So far tried to quote the attributes inside SLD and it didn't help: <ServiceException>The requested Style can not be used with this layer. The style specifies an attribute of &quot;R$POP$DENSITY&quot; and the layer is: test:AREAS</ServiceException> – jan_b Nov 2 '15 at 9:42
  • Only a code change can add quotes around the attributes – Andrea Aime Nov 11 '15 at 7:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.