I am using Spatialite version as following:
SPATIALITE_VERSION: 5.0.0-beta1
PROJ4_VERSION: Rel. 6.1.1
I am running the SpatiaLite transform
function in the android studio and it returns a null value during running. I did this command in SpatiaLite GUI and the result was correct. I did another SpatiaLite command in the Android Studio and there was no error.
I think the Transform function of SpatiaLite is not recognized in the Android Studio.
This is one part of the code that gets a null value in Android Studio:
String query="select
AsText(Transform(Makepoint(37.253453454,38.253453454,4326),32632));"
complete function that I used from spatialite tutorial is as follows:
public String doSimpleTransform() {
StringBuilder sb = new StringBuilder();
sb.append("Coordinate transformation...\n");
String query="select
AsText(Transform(Makepoint(37.253453454,38.253453454,4326),32632));";
sb.append("Execute query: ").append(query).append("\n");
try {
Stmt stmt = db.prepare(query);
if (stmt.step()) {
String pointStr = stmt.column_string(0);
sb.append(pointStr).append("...\n");
}
stmt.close();
} catch (Exception e) {
e.printStackTrace();
}
sb.append("Done...\n");
return sb.toString();
}
This is a command in Spatialite-GUI that return correct value: SELECT AsText(Transform(Makepoint(37.253453454,38.253453454,4326),32632))
select spatialite_version();
?