Geographic Information Systems Asked by DonF. on August 26, 2021
I have a WFS 2.0 GetFeature request that works when I query a point layer but when I use essentially the same request on a line layer it throws the following error:
Error: JSON does not allow non-finite numbers
The problem seems to be with the srsName
option. If I remove the srsName
option, the polyline will return the JSON correctly. The points layer request works correctly with or without the srsName
option.
The features are stored in PostGIS database as a Multilinestring. The SRS I am trying to reproject to (4326) is included in the ‘Extra SRS codes for WFS capabilities generation‘ option in GeoServer’s WFS settings.
Doesn’t work with JSONP (or JSON) and srsName
:
http://<path>:8080/geoserver/Ramnode/ows?service=WFS&version=2.0&request=GetFeature&typeName=Ramnode%3Asimplifysurveyedsp&outputFormat=text%2Fjavascript&format_options=callback%3AgetJson&count=3&srsName=EPSG%3A3857&callback=getJson&_=1478180151772
Works as GML2 with srsName
(example 1) and as JSONP without srsName
(example2):
http://<path>:8080/geoserver/Ramnode/ows?service=WFS&version=2.0&request=GetFeature&typeName=Ramnode%3Asimplifysurveyedsp&outputFormat=GML2&format_options=callback%3AgetJson&count=3&srsName=EPSG%3A3857
http://<path>:8080/geoserver/Ramnode/ows?service=WFS&version=2.0&request=GetFeature&typeName=Ramnode%3Asimplifysurveyedsp&outputFormat=text%2Fjavascript&format_options=callback%3AgetJson&count=3&callback=getJson&_=1478180151772
Does anyone have any suggestions as to why this would work for points but not work on polylines?
2016-11-03 12:36:49,208 TRACE [org.geoserver.ows.OWSHandlerMapping] - No handler mapping found for [/Ramnode/ows]
2016-11-03 12:36:49,209 TRACE [org.geoserver.ows.OWSHandlerMapping] - No handler mapping found for [/Ramnode/ows]
2016-11-03 12:36:49,209 DEBUG [org.geoserver.ows.OWSHandlerMapping] - Mapping [/Ramnode/ows] to HandlerExecutionChain with handler [org.geoserver.ows.Dispatcher@6a432a5b] and 1 interceptor
2016-11-03 12:36:49,210 DEBUG [org.geoserver.ows] - Could not find kvp parser for: 'callback'. Storing as raw string.
2016-11-03 12:36:49,211 DEBUG [org.geoserver.config.impl] - Could not locate service of type interface org.geoserver.wfs.WFSInfo in workspace WorkspaceInfoImpl[Ramnode], available services were [WCSInfoImpl[WCS], WFSInfoImpl[WFS], WMSInfoImpl[WMS]]
2016-11-03 12:36:49,211 INFO [org.geoserver.wfs] -
Request: getServiceInfo
2016-11-03 12:36:49,211 DEBUG [org.geoserver.config.impl] - Could not locate service of type interface org.geoserver.wfs.WFSInfo in workspace WorkspaceInfoImpl[Ramnode], available services were [WCSInfoImpl[WCS], WFSInfoImpl[WFS], WMSInfoImpl[WMS]]
2016-11-03 12:36:49,212 DEBUG [org.geoserver.config.impl] - Could not locate service of type interface org.geoserver.wfs.WFSInfo in workspace WorkspaceInfoImpl[Ramnode], available services were [WCSInfoImpl[WCS], WFSInfoImpl[WFS], WMSInfoImpl[WMS]]
2016-11-03 12:36:49,213 DEBUG [org.vfny.geoserver.requests] - Query is org.geoserver.wfs.request.Query$WFS20@66dfbc2f
To gt2: Query:
feature type: simplifysurveyedsp
filter: Filter.INCLUDE
[properties: ALL ]
2016-11-03 12:36:49,217 INFO [org.geoserver.wfs] -
Request: getFeature
service = WFS
version = 2.0
baseUrl = http://<path>:8080/geoserver/
count = 3
outputFormat = text/javascript
resolve = none
resolveDepth = *
resolveTimeout = 300
resultType = results
formatOptions = {CALLBACK=getJson}
abstractQueryExpressionGroup[0] = wfs:abstractQueryExpression=net.opengis.wfs20.impl.QueryTypeImpl@5f91f2dd (handle: null) (abstractProjectionClause: null, abstractSelectionClause: null, abstractSortingClause: null, aliases: null, typeNames: [{ramnode}simplifysurveyedsp]) (featureVersion: null, srsName: EPSG:3857, filter: null, propertyNames: null, sortBy: null)
abstractQueryExpression[0]:
typeNames[0] = {ramnode}simplifysurveyedsp
srsName = EPSG:3857
2016-11-03 12:36:49,218 INFO [org.geoserver.wfs.json] - about to encode JSON
2016-11-03 12:36:49,218 DEBUG [org.geoserver.config.impl] - Could not locate service of type interface org.geoserver.wfs.WFSInfo in workspace WorkspaceInfoImpl[Ramnode], available services were [WCSInfoImpl[WCS], WFSInfoImpl[WFS], WMSInfoImpl[WMS]]
2016-11-03 12:36:49,219 ERROR [org.geoserver.ows] -
org.geoserver.platform.ServiceException: Error: JSON does not allow non-finite numbers
at org.geoserver.wfs.json.GeoJSONGetFeatureResponse.write(GeoJSONGetFeatureResponse.java:322)
at org.geoserver.wfs.WFSGetFeatureOutputFormat.write(WFSGetFeatureOutputFormat.java:191)
at org.geoserver.ows.Dispatcher.response(Dispatcher.java:990)
at org.geoserver.ows.Dispatcher.handleRequestInternal(Dispatcher.java:284)
at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:923)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:778)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.filters.CorsFilter.handleNonCORS(CorsFilter.java:439)
at org.apache.catalina.filters.CorsFilter.doFilter(CorsFilter.java:178)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.geoserver.filters.ThreadLocalsCleanupFilter.doFilter(ThreadLocalsCleanupFilter.java:28)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.geoserver.filters.SpringDelegatingFilter$Chain.doFilter(SpringDelegatingFilter.java:75)
at org.geoserver.wms.animate.AnimatorFilter.doFilter(AnimatorFilter.java:71)
at org.geoserver.filters.SpringDelegatingFilter$Chain.doFilter(SpringDelegatingFilter.java:71)
at org.geoserver.filters.SpringDelegatingFilter.doFilter(SpringDelegatingFilter.java:46)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.geoserver.platform.AdvancedDispatchFilter.doFilter(AdvancedDispatchFilter.java:50)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:311)
at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:69)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:116)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:73)
at org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:92)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:69)
at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)
at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:73)
at org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:92)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
at org.geoserver.security.filter.GeoServerAnonymousAuthenticationFilter.doFilter(GeoServerAnonymousAuthenticationFilter.java:54)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:69)
at org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:150)
at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:73)
at org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:92)
at org.geoserver.security.filter.GeoServerBasicAuthenticationFilter.doFilter(GeoServerBasicAuthenticationFilter.java:83)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:69)
at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)
at org.geoserver.security.filter.GeoServerSecurityContextPersistenceFilter$1.doFilter(GeoServerSecurityContextPersistenceFilter.java:53)
at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:73)
at org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:92)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:173)
at org.geoserver.security.GeoServerSecurityFilterChainProxy.doFilter(GeoServerSecurityFilterChainProxy.java:135)
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.geoserver.filters.LoggingFilter.doFilter(LoggingFilter.java:76)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.geoserver.filters.GZIPFilter.doFilter(GZIPFilter.java:42)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.geoserver.filters.SessionDebugFilter.doFilter(SessionDebugFilter.java:48)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.geoserver.filters.FlushSafeFilter.doFilter(FlushSafeFilter.java:44)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.vfny.geoserver.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:109)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1041)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:603)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
Caused by: net.sf.json.JSONException: JSON does not allow non-finite numbers
at net.sf.json.util.JSONUtils.testValidity(JSONUtils.java:586)
at net.sf.json.util.JSONUtils.numberToString(JSONUtils.java:453)
at net.sf.json.util.JSONUtils.valueToString(JSONUtils.java:657)
at net.sf.json.util.JSONBuilder.value(JSONBuilder.java:344)
at org.geoserver.wfs.json.GeoJSONBuilder.value(GeoJSONBuilder.java:301)
at org.geoserver.wfs.json.GeoJSONBuilder.value(GeoJSONBuilder.java:41)
at net.sf.json.util.JSONBuilder.value(JSONBuilder.java:320)
at org.geoserver.wfs.json.GeoJSONBuilder.writeCoordinate(GeoJSONBuilder.java:165)
at org.geoserver.wfs.json.GeoJSONBuilder.writeCoordinates(GeoJSONBuilder.java:146)
at org.geoserver.wfs.json.GeoJSONBuilder.writeGeom(GeoJSONBuilder.java:89)
at org.geoserver.wfs.json.GeoJSONGetFeatureResponse.write(GeoJSONGetFeatureResponse.java:223)
... 93 more
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP