Hi,

When using Spatialite/Geopackage as data source OpenJUMP seems to check the 
schema too literally. While this works
SELECT geom FROM test LIMIT 1;
the same query with a simple alias gives an error
SELECT geom AS geometry FROM test LIMIT 1;

java.lang.Exception: java.lang.Exception: Result Set Must Have a Geometry Column
                          at 
com.vividsolutions.jump.workbench.ui.plugin.datastore.RunDatastoreQueryPlugIn.createLayer(RunDatastoreQueryPlugIn.java:92)
                          at 
com.vividsolutions.jump.workbench.ui.plugin.datastore.RunDatastoreQueryPlugIn.createLayerable(RunDatastoreQueryPlugIn.java:41)
                          at 
com.vividsolutions.jump.workbench.ui.plugin.datastore.AbstractAddDatastoreLayerPlugIn.run(AbstractAddDatastoreLayerPlugIn.java:33)
                          at 
com.vividsolutions.jump.workbench.ui.task.TaskMonitorManager$TaskWrapper.run(TaskMonitorManager.java:151)
Caused by: java.lang.Exception: Result Set Must Have a Geometry Column
                          at 
com.vividsolutions.jump.datastore.spatialite.SpatialiteDSConnection.executeAdhocQuery(SpatialiteDSConnection.java:90)
                          at 
com.vividsolutions.jump.datastore.spatialdatabases.SpatialDatabasesDSConnection.execute(SpatialDatabasesDSConnection.java:56)
                          at 
com.vividsolutions.jump.workbench.ui.plugin.datastore.RunDatastoreQueryPlugIn$RunnableQuery.run(RunDatastoreQueryPlugIn.java:134)


The above query works with PostGIS datastore. Renaming geometry field is not 
the real problem but I think that the same part of code makes it impossible to 
utilize the SpatiaLite functions like
SELECT ST_Centroid(geom) from test; or just playing with on-the-fly generated 
geometries like in
SELECT ST_GeomFromText('POINT (1 1)')

The problem does not seem to be in the name of the geometry because SELECT 
ST_Centroid(geom) as geom fails as well.

-Jukka Rahkonen-
_______________________________________________
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel

Reply via email to