【发布时间】:2013-06-20 07:16:15
【问题描述】:
如何将栅格 GIS 文件 (tiff) 转为 .json?
Bostock's example 用some JSON data 喂他的D3.geom.contour plugin。但是如何将 GIS 栅格(比如 11px/15px 的 tiff 图像)转换为 JSON。
最终的 .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:已经有a tutorial on how turning shapefiles into lighter topojson,但是在这里没用。
【问题讨论】:
-
“更轻”是什么意思?
-
.tiff 文件可能会非常庞大。我在这里问如何将光栅(tiff)转换为 json,然后我可以使用 d3.geom.contour 找到轮廓。但文件大小也将是一个问题。欢迎提供见解。
-
听起来您想在转换之前在 GIS 程序中简化栅格。
-
我可能确实需要两者。我可以在我的 GIS 软件中进行简化。但是如何将栅格转换为 JSON?
标签: d3.js maps gis gdal topojson