对topojson安装进行故障排除 [英] Troubleshooting topojson installation

查看:192
本文介绍了对topojson安装进行故障排除的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新的在这里一个本质上有很少的想法我在做什么。
(我正在学习本教程:
http:// bost .ocks.org / mike / map /

I'm new at this an essentially have very little idea of what I'm doing. (FYI I'm working off of this tutorial: http://bost.ocks.org/mike/map/)

我想让topojson工作。
我已经成功安装了homebrew和节点。
我也做了
npm install -g topojson部分。

I'm trying to get topojson to work. I've successfully installed homebrew and node. I've done the "npm install -g topojson" part as well.

然后,当我尝试键入在which ogr2ogr等 - 只是,没有什么发生。
他说如果无法编辑路径变量环境。我只有一个含糊的想法,这意味着什么,不知道这是我的问题或不。

And then, after that, when I try to type in the "which ogr2ogr" etc -- just, nothing happens. He says if having trouble to edit path variable environments. I have only a vague idea of what that means, and not sure if that's my problem or not.

让我知道您需要什么其他信息。我真的只想制作一张地图。全局安装似乎已经工作。我只是不知道从这里做什么。

Let me know what other information you need. I really just want to make a map. The global install does seem to have worked. I just don't know what to do from here.

推荐答案

您链接到的教程是一个伟大的起点。我希望我看到它,然后试图把我自己的一切。 :)

The tutorial you linked to is a great starting point. I wish I'd seen it before trying to figure everything out on my own. :)

根据我的理解,你可能错过了安装 gdal 的步骤。

From what I understand, you probably missed the step in which you install gdal. If you're seeing some other errors, please post them in your question.

您可以通过运行

brew install gdal





b $ b

这里有一些背景信息,您可以更好地了解这里的情况。


Here's some background info for you, so you'll get a better understanding of what's going on there.

topojson ogr2ogr 是两个不同的实用程序。 ogr2ogr gdal 包,在本例中用于从shapefile生成GeoJSON。

topojson and ogr2ogr are two distinct utilities. ogr2ogr is part of the gdal package and in our case is used to generate GeoJSON from a shapefile.


GDAL是一个翻译库
在X / MIT样式下发布的光栅地理空间数据格式Open
源地理空间基金会开放源代码许可证。作为一个库,它为所有支持的
格式的调用应用程序提供一个
抽象数据模型。它还带有各种有用的命令行实用程序
用于数据转换和处理。

GDAL is a translator library for raster geospatial data formats that is released under an X/MIT style Open Source license by the Open Source Geospatial Foundation. As a library, it presents a single abstract data model to the calling application for all supported formats. It also comes with a variety of useful commandline utilities for data translation and processing.

TopoJSON用于压缩大GeoJSON输出从以前的GDAL转换。它通过使用弧而不是离散点指定路径来减少冗余。它非常整洁,实际上:

TopoJSON is used to compress the rather large GeoJSON output from the previous GDAL conversion. It reduces redundancy by specifying paths with arcs rather than discrete points. It's pretty neat, actually:


TopoJSON是GeoJSON的扩展,编码拓扑。而不是
表示几何离散,TopoJSON文件中的几何是
缝合在一起从共享的线段称为弧。 TopoJSON
消除了冗余,提供了比GeoJSON更紧凑的
几何体表示;典型的TopoJSON文件比他们的GeoJSON等同物
小80%。此外,TopoJSON还支持使用拓扑的
应用程序,例如拓扑保存形状
简化,自动地图着色和矩形图。

TopoJSON is an extension of GeoJSON that encodes topology. Rather than representing geometries discretely, geometries in TopoJSON files are stitched together from shared line segments called arcs. TopoJSON eliminates redundancy, offering much more compact representations of geometry than with GeoJSON; typical TopoJSON files are 80% smaller than their GeoJSON equivalents. In addition, TopoJSON facilitates applications that use topology, such as topology-preserving shape simplification, automatic map coloring, and cartograms.

这两个步骤( shapefile - > GeoJSON - > TopoJSON )的输出将是一个容易被JavaScript解释的JSON字符串。你需要在你的绘图代码中使用topojson转换回GeoJSON来实际绘制地图。

The output of these two steps (shapefile -> GeoJSON -> TopoJSON) will be a JSON string which is easily interpreted by JavaScript. You'll need to use topojson in your drawing code to convert back to GeoJSON for actually drawing the map.


从早期的两个密切相关的JSON地理数据
格式:GeoJSON和TopoJSON。虽然我们的数据可以在TopoJSON中有效地存储更多的
,我们必须转换回GeoJSON来显示。
打破这一步骤以使其显式:

Recall from earlier the two closely-related JSON geographic data formats: GeoJSON and TopoJSON. While our data can be stored more efficiently in TopoJSON, we must convert back to GeoJSON for display. Breaking this step out to make it explicit:

var subunits = topojson.object(uk,uk.objects.subunits);

这篇关于对topojson安装进行故障排除的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆