WorldWindServerKit
WorldWindServerKit copied to clipboard
Adding a vector GeoPackage layer threw an exception
The Web Admin's Edit Layer dialog threw an exception when attempting to compute the bounding box from the data.
Caused by: java.io.IOException: Error occured calculating bounds for Road at
org.geotools.jdbc.JDBCDataStore.getBounds(JDBCDataStore.java:1336) at
org.geotools.jdbc.JDBCFeatureSource.getBoundsInternal(JDBCFeatureSource.java:534) ... 119 more
Caused by: java.io.IOException: com.vividsolutions.jts.io.ParseException: Unknown WKB type 234 at
gov.nasa.worldwind.geopkg.geom.GeoPkgGeomReader.read(GeoPkgGeomReader.java:93) at
gov.nasa.worldwind.geopkg.geom.GeoPkgGeomReader.get(GeoPkgGeomReader.java:72) at
gov.nasa.worldwind.geopkg.GeoPkgDialect.geometry(GeoPkgDialect.java:153) at
gov.nasa.worldwind.geopkg.GeoPkgDialect.geometry(GeoPkgDialect.java:158) at
gov.nasa.worldwind.geopkg.GeoPkgDialect.decodeGeometryEnvelope(GeoPkgDialect.java:116) at
org.geotools.jdbc.JDBCDataStore.getBounds(JDBCDataStore.java:1322) ... 120 more
Caused by: com.vividsolutions.jts.io.ParseException: Unknown WKB type 234 at
com.vividsolutions.jts.io.WKBReader.readGeometry(WKBReader.java:206) at
com.vividsolutions.jts.io.WKBReader.read(WKBReader.java:152) at
gov.nasa.worldwind.geopkg.geom.GeoPkgGeomReader.read(GeoPkgGeomReader.java:89) ... 125 more
Workaround: manually enter the bounding box coordinates
I tried adding a vector GeoPackage layer, and the Edit Layer dialog threw this exception when attempting to compute the bounding box from the data:
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.GeneratedMethodAccessor207.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.wicket.RequestListenerInterface.internalInvoke(RequestListenerInterface.java:258)
... 111 more
Caused by: java.lang.RuntimeException: java.io.IOException: Error occured calculating bounds for Building
at org.geotools.jdbc.JDBCFeatureSource.getBoundsInternal(JDBCFeatureSource.java:541)
at org.geotools.jdbc.JDBCFeatureStore.getBoundsInternal(JDBCFeatureStore.java:190)
at org.geotools.data.store.ContentFeatureSource.getBounds(ContentFeatureSource.java:444)
at org.geotools.data.store.ContentFeatureSource.getBounds(ContentFeatureSource.java:380)
at org.vfny.geoserver.global.GeoServerFeatureSource.getBounds(GeoServerFeatureSource.java:660)
at org.geoserver.catalog.CatalogBuilder.getNativeBounds(CatalogBuilder.java:565)
at org.geoserver.catalog.CatalogBuilder.getNativeBounds(CatalogBuilder.java:547)
at org.geoserver.web.data.resource.BasicResourceConfig$1.onSubmit(BasicResourceConfig.java:129)
at org.apache.wicket.ajax.markup.html.form.AjaxSubmitLink$1.onSubmit(AjaxSubmitLink.java:111)
at org.apache.wicket.ajax.form.AjaxFormSubmitBehavior$AjaxFormSubmitter.onSubmit(AjaxFormSubmitBehavior.java:215)
at org.apache.wicket.markup.html.form.Form.onFormSubmitted(Form.java:787)
at org.apache.wicket.ajax.form.AjaxFormSubmitBehavior.onEvent(AjaxFormSubmitBehavior.java:171)
at org.apache.wicket.ajax.AjaxEventBehavior.respond(AjaxEventBehavior.java:155)
at org.apache.wicket.ajax.AbstractDefaultAjaxBehavior.onRequest(AbstractDefaultAjaxBehavior.java:601)
... 115 more
Caused by: java.io.IOException: Error occured calculating bounds for Building
at org.geotools.jdbc.JDBCDataStore.getBounds(JDBCDataStore.java:1350)
at org.geotools.jdbc.JDBCFeatureSource.getBoundsInternal(JDBCFeatureSource.java:534)
... 128 more
Caused by: java.io.IOException: com.vividsolutions.jts.io.ParseException: Unknown WKB type 235
at gov.nasa.worldwind.geopkg.geom.GeoPkgGeomReader.read(GeoPkgGeomReader.java:93)
at gov.nasa.worldwind.geopkg.geom.GeoPkgGeomReader.get(GeoPkgGeomReader.java:72)
at gov.nasa.worldwind.geopkg.GeoPkgDialect.geometry(GeoPkgDialect.java:153)
at gov.nasa.worldwind.geopkg.GeoPkgDialect.geometry(GeoPkgDialect.java:158)
at gov.nasa.worldwind.geopkg.GeoPkgDialect.decodeGeometryEnvelope(GeoPkgDialect.java:116)
at org.geotools.jdbc.JDBCDataStore.getBounds(JDBCDataStore.java:1336)
... 129 more
Caused by: com.vividsolutions.jts.io.ParseException: Unknown WKB type 235
at com.vividsolutions.jts.io.WKBReader.readGeometry(WKBReader.java:206)
at com.vividsolutions.jts.io.WKBReader.read(WKBReader.java:152)
at gov.nasa.worldwind.geopkg.geom.GeoPkgGeomReader.read(GeoPkgGeomReader.java:89)
... 134 more
I was able to publish the layer by using the workaround and manually entering the bounding box coordinates. However, when I tried to preview the layer, it failed.
I checked my IDE log for exceptions and stack traces. The stack traces were like those mentioned above, and there was an error "Unknown WKB type 235".
I attempted to add another vector GeoPackage layer, but I was met with an unknown WKB type 233.
Here is the exception thrown by the Web Admin's Edit Layer dialog when it attempted to compute the bounding box from the data:
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.wicket.RequestListenerInterface.internalInvoke(RequestListenerInterface.java:258)
... 111 more
Caused by: java.lang.RuntimeException: java.io.IOException: Error occured calculating bounds for Tower
at org.geotools.jdbc.JDBCFeatureSource.getBoundsInternal(JDBCFeatureSource.java:541)
at org.geotools.jdbc.JDBCFeatureStore.getBoundsInternal(JDBCFeatureStore.java:190)
at org.geotools.data.store.ContentFeatureSource.getBounds(ContentFeatureSource.java:444)
at org.geotools.data.store.ContentFeatureSource.getBounds(ContentFeatureSource.java:380)
at org.vfny.geoserver.global.GeoServerFeatureSource.getBounds(GeoServerFeatureSource.java:660)
at org.geoserver.catalog.CatalogBuilder.getNativeBounds(CatalogBuilder.java:565)
at org.geoserver.catalog.CatalogBuilder.getNativeBounds(CatalogBuilder.java:547)
at org.geoserver.web.data.resource.BasicResourceConfig$1.onSubmit(BasicResourceConfig.java:129)
at org.apache.wicket.ajax.markup.html.form.AjaxSubmitLink$1.onSubmit(AjaxSubmitLink.java:111)
at org.apache.wicket.ajax.form.AjaxFormSubmitBehavior$AjaxFormSubmitter.onSubmit(AjaxFormSubmitBehavior.java:215)
at org.apache.wicket.markup.html.form.Form.onFormSubmitted(Form.java:787)
at org.apache.wicket.ajax.form.AjaxFormSubmitBehavior.onEvent(AjaxFormSubmitBehavior.java:171)
at org.apache.wicket.ajax.AjaxEventBehavior.respond(AjaxEventBehavior.java:155)
at org.apache.wicket.ajax.AbstractDefaultAjaxBehavior.onRequest(AbstractDefaultAjaxBehavior.java:601)
... 116 more
Caused by: java.io.IOException: Error occured calculating bounds for Tower
at org.geotools.jdbc.JDBCDataStore.getBounds(JDBCDataStore.java:1350)
at org.geotools.jdbc.JDBCFeatureSource.getBoundsInternal(JDBCFeatureSource.java:534)
... 129 more
Caused by: java.io.IOException: com.vividsolutions.jts.io.ParseException: Unknown WKB type 233
at gov.nasa.worldwind.geopkg.geom.GeoPkgGeomReader.read(GeoPkgGeomReader.java:93)
at gov.nasa.worldwind.geopkg.geom.GeoPkgGeomReader.get(GeoPkgGeomReader.java:72)
at gov.nasa.worldwind.geopkg.GeoPkgDialect.geometry(GeoPkgDialect.java:153)
at gov.nasa.worldwind.geopkg.GeoPkgDialect.geometry(GeoPkgDialect.java:158)
at gov.nasa.worldwind.geopkg.GeoPkgDialect.decodeGeometryEnvelope(GeoPkgDialect.java:116)
at org.geotools.jdbc.JDBCDataStore.getBounds(JDBCDataStore.java:1336)
... 130 more
Caused by: com.vividsolutions.jts.io.ParseException: Unknown WKB type 233
at com.vividsolutions.jts.io.WKBReader.readGeometry(WKBReader.java:206)
at com.vividsolutions.jts.io.WKBReader.read(WKBReader.java:152)
at gov.nasa.worldwind.geopkg.geom.GeoPkgGeomReader.read(GeoPkgGeomReader.java:89)
... 135 more
As mentioned in the previous comment, I was able to publish the layer by manually entering the bounding box coordinates, but the layer preview failed. When checking my IDE server log, it showed the error "unknown WKB 233"
If you're creating the Geopackage with ogr2ogr adding "-dim 2" as an option will create XY instead of XYZ WKB objects which JTS (or GEOS) can apparently read.