如何将栅格GIS文件(tiff)转换为.json?
Bostock's example使用some JSON data为D3.geom.contour plugin提供数据。但是如何将GIS栅格(比如一个11 px/15 px的小tiff图像)转换为JSON。
final.JSON代码这样:[编辑:这不是topojson格式]
[
[103,104,104,105,105,106,106,106,107,107,106],
[104,104,105,105,106,106,107,107,107,107,107],
[104,105,105,106,106,107,107,108,108,108,108],
[105,105,106,106,107,107,108,108,109,109,109],
[105,106,106,107,107,108,108,109,109,110,110],
[106,106,107,107,107,108,109,109,110,110,111],
[106,107,107,108,108,108,109,110,110,111,112],
[107,107,108,108,109,109,110,110,112,113,114],
[107,108,108,109,109,110,111,112,114,115,116],
[107,108,109,109,110,110,110,113,115,117,118],
[107,108,109,109,110,110,110,112,115,117,119],
[108,108,109,109,110,110,110,112,115,118,121],
[108,109,109,110,110,111,112,114,117,120,124],
[108,109,110,110,110,113,114,116,119,122,126],
[108,109,110,110,112,115,116,118,122,124,128]
]
注意:.shp到.json:已经有一个教程是关于如何将shapefile变成更轻的topojson的,但对这里没有用。
1条答案
按热度按时间cngwdvgl1#
我不认为你能直接做到这一点,它可能是一个几个步骤的过程:
流程
转换
.tiff
-〉.shp
转换
.shp
-〉.json
(* 拓扑 *)资源
gdal_contour
根据光栅高程模型构建矢量等高线。