简体   繁体   English

Python:Mapnik - 读取 csv

[英]Python: Mapnik - reading csv

How can I use csv-files in mapnik?如何在 mapnik 中使用 csv 文件?

I found a csv-module for Mapnik but without good docs.我为 Mapnik 找到了一个 csv 模块,但没有好的文档。

I want to include csv-file with titles of countries and their population in years into Mapnik and render map with different colours using shapefile.我想将带有国家标题及其多年人口的 csv 文件包含在 Mapnik 中,并使用 shapefile 渲染具有不同颜色的地图。

How can I do it?我该怎么做?

And offtopic question: if I open shapefile in xml, how can I get some data in code (some parameters - print titles of countries in console, for example)?还有题外话:如果我在 xml 中打开 shapefile,我怎样才能在代码中获取一些数据(一些参数 - 例如在控制台中打印国家/地区的标题)?

Documentation for CSV plugin . CSV 插件的文档 It won't get any better.它不会变得更好。 If you used other plugins, you'll understand this one.如果您使用过其他插件,您就会明白这一点。

Now, other parts of your question do not make any sense.现在,您问题的其他部分没有任何意义。 I recommend installing TileMill and following its documentation, adding shape and csv layers from there and styling as you like.我建议安装TileMill并遵循其文档,从那里添加形状和 csv 图层并根据需要进行样式设置。 There are some examples for colouring countries.有一些着色国家的例子。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM