Shapefile文件的可视化与编辑
ArcGIS Runtime 100.2.0的正式发布带来个更多移动端的处理地图的能力,例如支持WMS图层、支持海图(ENC)图层,再如基于场景相机(Camera)的视域分析。同时还提供了新的统计查询API(总和,平均值,计数,最小值,最大值,标准差或方差)。而今天要描述的重点是ArcGIS Runtime 100.2.0对Shapefile数据格式的支持,当然ArcGIS Runtime 100.2.0还增加了对OGC GeoPackage格式的支持。
Shapefile文件的可视化
我们都知道Shapefile文件是Esri创造的开源空间数据格式,简单的介绍如下。
在安卓端加载Shapefile文件的关键是ShapefileFeatureTable(com.esri.arcgisruntime.data.ShapefileFeatureTable)。代码如下
private void showShapefile() {
mainMapView = (MapView) findViewById(R.id.mapView);
mainMapView.setAttributionTextVisible(false);
mainArcGISMap = new ArcGISMap(new Basemap().createImageryWithLabelsVector());
mainMapView.setMap(mainArcGISMap);
final ShapefileFeatureTable shapefileFeatureTable = new ShapefileFeatureTable(
getResources().getString(R.string.shapefile_path)
);
shapefileFeatureTable.loadAsync();
shapefileFeatureTable.addDoneLoadingListener(new Runnable() {
@Override
public void run() {
GeometryType gt = shapefileFeatureTable.getGeometryType();
String name = shapefileFeatureTable.getTableName();
String name1 = name;
mainShap