我正在开发一个基于GIS的Android应用程序,我正在使用Spatialite Android jar lib,但是我遇到了一些问题,比如缺少需要GEOS模块的ST_Line_Locate_Point
,public Geometry splitHalf(Geometry linestring,Geometry closest_point) {
Geometry geo = null;
String query1 = "SELECT " +
"ST_AsBinary("+
"ST_Line_Substring(" +
"'"+linestring+"',0,ST_Line_Locate_Point('"+linestring+"','"+closest_point+"')));";
Stmt stmt1 = null;
Log.v(TAG,query1);
try {
stmt1 = db.prepare(query1);
WKBReader wkbReader = new WKBReader();
while (stmt1.step()) {
geo = wkbReader.read(stmt1.column_bytes(0));
}
stmt1.close();
} catch (Exception e) {
Log.e(TAG+":1",e.toString());
} catch (ParseException e) {
e.printStackTrace();
}
return geo;
}
这样的函数,查询返回null但在PostgreSQL中,查询工作正常。
{{1}}