Mapnik 忽略我的经纬度边界框

发布于 2024-09-13 02:58:34 字数 1779 浏览 9 评论 0原文

谁能看出下面这组命令有什么问题吗?每次我运行这些 image.png 时都是英国的图像,而不是我导出的 JOSM 地图。我猜数据库导入有问题,但输出提到它正在处理我的坐标和数据。

步骤:

1 - 从 JOSM 或 Merkaator 导出 .osm 文件。

2 - 使用以下命令导入 psql:

osm2pgsql -m -d gis -S ~/mapnik/default.style -b 103,1.3,104,1.4 ion.osm  -v -c

输出如下所示:

    marshall@ubuntu:~/mapnik$ osm2pgsql -m -d gis -S ~/mapnik/default.style -b 103,1.3,104,1.4 ion.osm  -v -c
osm2pgsql SVN version 0.66-

Using projection SRS 900913 (Spherical Mercator)
Applying Bounding box: 103.000000,1.300000 to 104.000000,1.400000
Setting up table: planet_osm_point
Setting up table: planet_osm_line
Setting up table: planet_osm_polygon
Setting up table: planet_osm_roads
Mid: Ram, scale=100

Reading in file: ion.osm
Processing: Node(25k) Way(3k) Relation(0k)
Node stats: total(25760), max(844548651)
Way stats: total(3783), max(69993379)
Relation stats: total(27), max(536780)

Writing way(3k)

Writing rel(0k)
Committing transaction for planet_osm_point
Sorting data and creating indexes for planet_osm_point
Committing transaction for planet_osm_line
Committing transaction for planet_osm_roads
Sorting data and creating indexes for planet_osm_line
Committing transaction for planet_osm_polygon
Sorting data and creating indexes for planet_osm_roads
Sorting data and creating indexes for planet_osm_polygon
Completed planet_osm_polygon
Completed planet_osm_roads
Completed planet_osm_point
Completed planet_osm_line

我可以看到传入的正确纬度/经度坐标,我不确定如何在数据库中验证这一点

3 - ./generate_xml .py --accept-none --dbname gis --symbols ./symbols/ --world_boundaries ../world_boundaries/

4 - ./generate_image.py

此时 image.png是英国的地图,而不是我指定的新加坡的地图。

谁能看出这有什么问题吗?这是 ubuntu 上的 mapnik 0.71

Can anyone see anything wrong with the following set of commands? Every time I run these image.png is a image of the UK and not the JOSM map I exported. I'm guessing there's something awry with the db import however the output mentions that it's processing my coords and data.

Steps:

1 - Exported a .osm file from JOSM or Merkaator.

2 - Imported into psql using the following command:

osm2pgsql -m -d gis -S ~/mapnik/default.style -b 103,1.3,104,1.4 ion.osm  -v -c

The output for this looks like:

    marshall@ubuntu:~/mapnik$ osm2pgsql -m -d gis -S ~/mapnik/default.style -b 103,1.3,104,1.4 ion.osm  -v -c
osm2pgsql SVN version 0.66-

Using projection SRS 900913 (Spherical Mercator)
Applying Bounding box: 103.000000,1.300000 to 104.000000,1.400000
Setting up table: planet_osm_point
Setting up table: planet_osm_line
Setting up table: planet_osm_polygon
Setting up table: planet_osm_roads
Mid: Ram, scale=100

Reading in file: ion.osm
Processing: Node(25k) Way(3k) Relation(0k)
Node stats: total(25760), max(844548651)
Way stats: total(3783), max(69993379)
Relation stats: total(27), max(536780)

Writing way(3k)

Writing rel(0k)
Committing transaction for planet_osm_point
Sorting data and creating indexes for planet_osm_point
Committing transaction for planet_osm_line
Committing transaction for planet_osm_roads
Sorting data and creating indexes for planet_osm_line
Committing transaction for planet_osm_polygon
Sorting data and creating indexes for planet_osm_roads
Sorting data and creating indexes for planet_osm_polygon
Completed planet_osm_polygon
Completed planet_osm_roads
Completed planet_osm_point
Completed planet_osm_line

I can see the correct lat/lon coords being passed in, I'm not sure how to verify this within the database

3 - ./generate_xml.py --accept-none --dbname gis --symbols ./symbols/ --world_boundaries ../world_boundaries/

4 - ./generate_image.py

At this point image.png is a map of the UK, not Singapore which I have specified.

Can anyone see anything wrong with this? This is with mapnik 0.71 on ubuntu

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

难理解 2024-09-20 02:58:34

找到了解决方案。

问题在于,generate_image.py 脚本不会从数据库读取数据,而是将其硬编码在内部。我不确定这背后的原因。

解决方案是手动编辑generate_image.py并更改相关行:

ll = (103,1.3,104,1.4)

Found the solution.

The issue is that the generate_image.py script does not read the data from the database but rather has it hardcoded inside. I'm not sure the reasoning behind this.

The solution is to edit generate_image.py manually and change the relevant line:

ll = (103,1.3,104,1.4)
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文