【问题标题】:Mapnik ignoring my lat long bounding boxMapnik 忽略了我的 lat long 边界框
【发布时间】:2010-08-05 10:11:43
【问题描述】:

任何人都可以看出以下命令集有什么问题吗?每次我运行这些 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

【问题讨论】:

    标签: gis mapnik


    【解决方案1】:

    找到了解决办法。

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

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

    ll = (103,1.3,104,1.4)
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-01-12
      • 2021-04-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-07-23
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多