arcgis runtime android查看shapefile几何类型

标签 :


【参考链接】
http://zhihu.esrichina.com.cn/question/19622

【问题描述】

调用ShapefileFeatureTable.getGeometryType返回几何类型是Unknown。

【解决办法】:
这一问题和ArcGIS Runtime SDK 100系列中的Loadable异步加载机制有关系,需要在加载完成的回调函数中进行判断

1
2
3
4
5
6
7
8
shapefileFeatureTable = new ShapefileFeatureTable(Environment.getExternalStorageDirectory().getAbsolutePath() + /ArcGIS/shapefile/center.shp);
shapefileFeatureTable.loadAsync();
shapefileFeatureTable.addDoneLoadingListener(new Runnable() {

public void () {
System.out.println(shapefileFeatureTable.getGeometryType());
}
});