Am 2. Juli 2015 um 10:44 schrieb Leonard Penzer <[email protected]>:

>
>
> Am Mittwoch, 1. Juli 2015 schrieb Heiko Eckenreiter :
>
>> Hi Leonard,
>>
>> > Für Freifunk Stuttgart benötige ich die Stadtgrenze für Stuttgart (nicht
>> > Regierungsbezirk).
>>
>> > Ich bin jetzt nicht so der Overpass-Turbo Freak etc. - weiß jemand wie
>> > man an die Stadtgrenze ran kommt?
>>
>> So: http://www.openstreetmap.org/relation/2793104
>>
>> Die Relation oder ihre Mitglieder.
>
>
>>
> Ihr seid die Besten! Jetzt mein eigentliches Problem:
>
> Ich habe Koordinaten und muss feststellen, ob die Koordinate innerhalb von
> Stuttgart ist oder nicht.
>
>
> So - meine Lösung steht, die will ich ja nicht vorenthalten:

Das Python Modul shapely kann das.

from shapely.geometry import Point
from shapely.geometry.polygon import Polygon
point = Point(0.5, 0.5)
polygon = Polygon([(1,1),(0,0),(1,0),(0,1)])
result = polygon.contains(point)

Die GPX-Files habe ich unter
http://osmrm.openstreetmap.de/gpx.jsp?relation=... herunter geladen.

Gruß
Leonard
_______________________________________________
Stuttgart mailing list
[email protected]
http://lists.openstreetmap.de/mailman/listinfo/stuttgart

Antwort per Email an