Revision: 4710
http://sourceforge.net/p/jump-pilot/code/4710
Author: elnico
Date: 2015-12-27 22:50:05 +0000 (Sun, 27 Dec 2015)
Log Message:
-----------
Added CastAutomagic wrap when GeoPackage layout + Spatialite extension are
detected: otherwise, geometric column is not recognize in OGC functions.
(Doc states CastAutomagic is not necessary for Spatialite >= 4.3, but does not
work on Mac OSX, Spatialite 4.3.0)
Modified Paths:
--------------
core/trunk/src/com/vividsolutions/jump/datastore/spatialite/SpatialiteDSMetadata.java
core/trunk/src/com/vividsolutions/jump/datastore/spatialite/SpatialiteSQLBuilder.java
Modified:
core/trunk/src/com/vividsolutions/jump/datastore/spatialite/SpatialiteDSMetadata.java
===================================================================
---
core/trunk/src/com/vividsolutions/jump/datastore/spatialite/SpatialiteDSMetadata.java
2015-12-27 20:33:26 UTC (rev 4709)
+++
core/trunk/src/com/vividsolutions/jump/datastore/spatialite/SpatialiteDSMetadata.java
2015-12-27 22:50:05 UTC (rev 4710)
@@ -135,7 +135,7 @@
} else if (gcType == GeometricColumnType.WKT) {
ret = String.format("select st_asBinary(extent(st_geomFromText(%s)))
from %s", attributeName, table);
} else if (gcType == GeometricColumnType.SPATIALITE) {
- ret = String.format("select st_asBinary(extent(%s)) from %s",
attributeName, table);
+ ret = String.format("select st_asBinary(extent(CastAutomagic(%s)))
from %s", attributeName, table);
} else {
// unknown geom type
// TODO: log
Modified:
core/trunk/src/com/vividsolutions/jump/datastore/spatialite/SpatialiteSQLBuilder.java
===================================================================
---
core/trunk/src/com/vividsolutions/jump/datastore/spatialite/SpatialiteSQLBuilder.java
2015-12-27 20:33:26 UTC (rev 4709)
+++
core/trunk/src/com/vividsolutions/jump/datastore/spatialite/SpatialiteSQLBuilder.java
2015-12-27 22:50:05 UTC (rev 4710)
@@ -98,7 +98,7 @@
query.getDatasetName().toLowerCase() + "." +
query.getGeometryAttributeName().toLowerCase());
// use Locale.US to enforce floating point number with a dot separator
if (gcType == GeometricColumnType.SPATIALITE) {
- ret = String.format(Locale.US, "st_envIntersects(%s,
%f,%f,%f,%f)", query.getGeometryAttributeName(), env.getMinX(),
+ ret = String.format(Locale.US,
"st_envIntersects(CastAutomagic(%s), %f,%f,%f,%f)",
query.getGeometryAttributeName(), env.getMinX(),
env.getMinY(), env.getMaxX(), env.getMaxY());
} else if (gcType == GeometricColumnType.WKB) {
ret = String.format(Locale.US,
"st_envIntersects(st_geomFromWkb(%s), %f,%f,%f,%f)",
query.getGeometryAttributeName(), env.getMinX(),
------------------------------------------------------------------------------
_______________________________________________
Jump-pilot-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel