【发布时间】: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。
【问题讨论】: