문제

I'm using mapnik in my django app to display esri shapefiles on a map. When a user clicks on an object (polygon, point or line), a popup should appear with info on that particular object.

I'm able to search polygons by using the function 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

When I use above method to search in point/line files, I never get a result feature_set. So the question is: how do I implement a search function for points and lines for shapefiles?

Django 1.2.3, Mapnik 0.7.0 on ubuntu 10.04 64 bit.

도움이 되었습니까?

해결책

This is a bug in Mapnik, which we are aware of: http://trac.mapnik.org/ticket/503 and I am planning to work on soon for inclusion in Mapnik2. In the meantime you can try applying the patch listed their against Mapnik 0.7.x. If you have trouble please comment on that ticket.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top