【问题标题】:how to search in line/point shapefile using mapnik?如何使用 mapnik 在线/点 shapefile 中搜索?
【发布时间】:2011-05-05 00:09:00
【问题描述】:

我在我的 django 应用程序中使用 mapnik 在地图上显示 esri shapefile。当用户单击一个对象(多边形、点或线)时,应该会出现一个弹出窗口,其中包含有关该特定对象的信息。

我可以使用函数 query_point 来搜索多边形:

mapnik_map = mapnik.Map(400, 400)
mapnik_map.layers.append(layer)
mapnik_map.append_style(style)
feature_set = mapnik_map.query_point(0, x, y)
for feature in feature_set.features:
    print feature

当我使用上述方法搜索点/线文件时,我从来没有得到结果特征集。那么问题来了:如何实现 shapefile 的点线搜索功能?

Ubuntu 10.04 64 位上的 Django 1.2.3、Mapnik 0.7.0。

【问题讨论】:

    标签: python shapefile mapnik


    【解决方案1】:

    这是 Mapnik 中的一个错误,我们知道:http://trac.mapnik.org/ticket/503 我计划尽快将其包含在 Mapnik2 中。同时,您可以尝试将列出的补丁应用于 Mapnik 0.7.x。如果您遇到问题,请对该票发表评论。

    【讨论】:

    • 谢谢,去看看。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-01-15
    • 2011-04-22
    • 2015-08-19
    • 2022-09-26
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多