提取高程到点:extractvaluestopoints
提取高程到线呢?线->折点转点->extractvaluestopoints->点转线。
for(){//遍历每一条线
//获取每条线的转折点
//提取转折点对应的高程
//点再转线,保存到新的shp中。
}
参考1:https://zhuanlan.zhihu.com/p/344221724
参考2:https://www.cnblogs.com/2008nmj/p/17168157.html
tif大小(5919, 25369)=150,159,111个像素
读取一张tif需要的时间:
新的tif大小(14401, 21601)=311,076,001个像素
读取一张新的tif需要的时间:应该是前者的两倍。。
>>geotools提取tif高程:
参考一:https://blog.csdn.net/yhzrf/article/details/112912236(地形高度采样的几种方式)
try { DirectPosition position = new DirectPosition2D(crs, lon, lat); int[] results = (int[]) coverage.evaluate(position); results = coverage.evaluate(position, results); LatLngModel model = new LatLngModel(); model.lng = lon; model.lat = lat; model.dem = results[0]; list.add(model); } catch(Exception e) { system.out.println(e.getMessage()); continue;
参考二:https://blog.csdn.net/GISShiXiSheng/article/details/78880135(geotools获取给定点的DEM高程值)