Closed mharnold closed 9 years ago
I'd like another set of eyes on this. @mharnold, @itiboi, @johnjohndoe ? Comments?
I won't have time to review until next week.
My eyes have already been all over it. ;) I am concerned that the merge is getting more difficult as other changes are added but I guess what I did is pretty localized.
Cheers, Michael spiderOSM.org
On Wed, Nov 19, 2014 at 9:03 AM, Tobias Preuss notifications@github.com wrote:
I won't have time to review until next week.
— Reply to this email directly or view it on GitHub https://github.com/mvexel/overpass-api-python-wrapper/pull/17#issuecomment-63674583 .
@mharnold can you rebase and then I am ready to pull this in.
actually I have time to rebase now if that's OK with you?
It's fine with me but not sure what exactly is involved! This is my first time cloning/modifying and then issuing a pull request on github.
Cheers, Michael spiderOSM.org
On Mon, Nov 24, 2014 at 9:54 AM, Martijn van Exel notifications@github.com wrote:
actually I have time to rebase now if that's OK with you?
— Reply to this email directly or view it on GitHub https://github.com/mvexel/overpass-api-python-wrapper/pull/17#issuecomment-64234250 .
Please explain 'rebase.' If you can do it from your end without my intervention that is cool with me.
Cheers, Michael spiderOSM.org
On Mon, Nov 24, 2014 at 9:57 AM, Michael Arnold mha.hiker@gmail.com wrote:
It's fine with me but not sure what exactly is involved! This is my first time cloning/modifying and then issuing a pull request on github.
Cheers, Michael spiderOSM.org
On Mon, Nov 24, 2014 at 9:54 AM, Martijn van Exel < notifications@github.com> wrote:
actually I have time to rebase now if that's OK with you?
— Reply to this email directly or view it on GitHub https://github.com/mvexel/overpass-api-python-wrapper/pull/17#issuecomment-64234250 .
Rebasing is basically re-applying your changes on top of the updated head. It's pretty straightforward if there are no conflicts :)
One question though, simply passing out body geom
does not seem to
magically create actual GeoJSON output, it just adds lon/lat dicts to the
output - we'd still need to process the output into proper GeoJSON, or am I
missing something here?
On Mon Nov 24 2014 at 10:57:09 AM mharnold notifications@github.com wrote:
It's fine with me but not sure what exactly is involved! This is my first time cloning/modifying and then issuing a pull request on github.
Cheers, Michael spiderOSM.org
On Mon, Nov 24, 2014 at 9:54 AM, Martijn van Exel < notifications@github.com> wrote:
actually I have time to rebase now if that's OK with you?
— Reply to this email directly or view it on GitHub < https://github.com/mvexel/overpass-api-python-wrapper/pull/17#issuecomment-64234250>
.
— Reply to this email directly or view it on GitHub https://github.com/mvexel/overpass-api-python-wrapper/pull/17#issuecomment-64234665 .
I do that processing in API._asGeoJSON() Someone had created this method as a stub, and I filled it out.
def _asGeoJSON(self, elements):
features = []
for elem in elements:
elem_type = elem["type"]
if elem["type"] == "node":
geometry=geojson.Point((elem["lon"], elem["lat"]))
elif elem["type"] == "way":
points = []
for coords in elem["geometry"]:
points.append((coords["lon"], coords["lat"]))
geometry = geojson.LineString(points)
else:
continue
feature = geojson.Feature(
id=elem["id"],
geometry=geometry,
properties=elem.get("tags"))
features.append(feature)
return geojson.FeatureCollection(features)
Me and Mondays, just not a great combo... I apologize @mharnold ..
I'll test for myself, rebase and merge today. Thanks for all the work.
For me, this will be a major step in accomplishing a bridge between Overpass and MapRoulette. I will use this for creating a 'No-Name-Ways' challenge for Brazil (based on a query like this: http://overpass-turbo.eu/?Q=%5Bout%3Ajson%5D%3B%0Away(-22.9%2C-43.6%2C-22.8%2C-43.5)%0A%20%20%5Bhighway~%22.%22%5D%0A%20%20%5Bname!~%22.%22%5D%3B%0A(._%3B%3E%3B)%3B%0Aout%3B&C=-22.85234;-43.54874;12 )
No problem. :) Very cool that this has immediate application, thanks for sharing that.
BTW If you uncomment the two lines before the assert in TestAPI.test_geojson() you can look at the results for a tiny query in the Berkeley Marina. This is how I debugged.
TODO: retrieve missing nodes referenced in ways to get their coords.