15

万一有人不知道:制图是一种地图,其中一些与国家/地区相关的数字属性对各个区域进行缩放,以使该属性的密度(接近)恒定。一个例子是

示例图表

来自worldmapper.org。在此示例中,国家根据其人口进行缩放,从而导致人口密度接近恒定。

不用说,这真的很酷。有谁知道用于绘制此类地图的基于 Matplotlib 的库?worldmapper.org 使用的方法在 (1) 中进行了描述,所以如果还没有人实现它,我会感到惊讶......

我也有兴趣了解其他制图库,即使它们不是为 Matplotlib 制作的。

(1) Michael T. Gastner 和 MEJ Newman,基于扩散的密度均衡地图制作方法,Proc。纳特。学院派。科学。美国, 101, 7499-7504 (2004)。可在arXiv获得。

4

5 回答 5

3

这个,虽然它基于不同的算法(虽然它在 ESRI 站点上,但它不需要 ArcGIS)。当然,一旦你有了制图,你就可以在 matplotlib 中绘制它。

于 2010-11-22T04:53:56.950 回答
1

是一个使用 D3 制作地图的 Javascript 插件。如果您不太关心区域大小是否准确,这是一个很好的简单解决方案。如果准确性很重要,还有其他可用选项可以让您更自由地使用算法的参数以获得更准确的结果。

这是我知道的两个很棒的独立程序:

Scapetoad is very easy to use. Just give it a shapefile, tell it which attribute to use for the scaling, and set a few accuracy parameters. If there is any doubt, this post describes the process.

Carto3F is more complex and allows for greater accuracy, though it is a bit trickier to figure out - lots of parameter settings without much documentation explaining them.

There is also a QGIS cartogram plugin, written in Python. Though I have not been able to get it to work, so cannot comment on that one.

于 2016-06-05T13:07:49.787 回答
0

In short, no. But Newman has an excellent little implementation of his and Gastner's method on his website. Installing it is easy and it works from the command line. Here's an example of a workflow using this software that worked for me.

  1. Compute a grid of density estimates over some region, e.g. in Python. Store it as a matrix of numbers.
  2. Run the cart program with your density matrix as input from the command line or from as subprocess in Python.
  3. The program returns a list of new coordinates for each grid point.
  4. Pipe your shapefile points through the interp program and into a new shapefile to get the transformed map.

There are nice instructions on the main page.

于 2017-11-30T09:59:41.867 回答
0

The geoplot.cartogram function in Geoplot: geospatial data visualization — geoplot 0.2.0

says it is a high-level Python geospatial plotting library, and an extension to cartopy and matplotlib.

于 2019-03-20T17:55:40.570 回答
0

Try this library if you are using geopandas, it is quick and doesnt require much customization. https://github.com/mthh/cartogram_geopandas

于 2020-05-20T07:05:13.960 回答