Geographic Information Systems Asked by user168505 on November 30, 2020
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. 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))
I changed the code and add new parameter using transform.Using the following code solved the error: query="SELECT AsText ( ST_Transform( MakePoint( 37.253453454 ,38.253453454, 4326 ) , 32632, NULL,(SELECT srtext FROM spatial_ref_sys WHERE srid = 4326),(SELECT srtext FROM spatial_ref_sys WHERE srid = 32632)));";
Answered by user168505 on November 30, 2020
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP