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

问题描述

我是新的在这里一个本质上有很少的想法我在做什么。
(我正在学习本教程:

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 是包,在本例中用于从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.

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:

这两个步骤( 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.

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

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

08-26 04:10
查看更多