Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support parsing of <center> element for ways (XML only) #27

Merged
merged 7 commits into from
Nov 21, 2016

Conversation

gregrs-uk
Copy link
Contributor

The 'out center' Overpass QL option provides a centroid for each way in a

element. I've added support for parsing the element, but N.B. only for ways (not relations) and only for XML (not JSON).

I've also corrected a mistake in the 'Unknown element end' KeyError message.

@coveralls
Copy link

Coverage Status

Coverage decreased (-1.4%) to 92.893% when pulling ebaba3e on gregrs-uk:way-center into b6e2cb1 on DinoTools:master.

@phibos
Copy link
Member

phibos commented Apr 11, 2016

Thanks for your contribution. Some tests failed with the following error message.

UnboundLocalError: local variable 'center_lat' referenced before assignment

Can you please provide a query to test your changes and/or write a test.

@phibos phibos self-assigned this Apr 11, 2016
Conflicts:
	overpy/__init__.py
@gregrs-uk gregrs-uk closed this Apr 13, 2016
@gregrs-uk gregrs-uk deleted the way-center branch April 13, 2016 16:20
@gregrs-uk gregrs-uk reopened this Apr 13, 2016
@coveralls
Copy link

Coverage Status

Coverage decreased (-1.2%) to 93.086% when pulling 0df600d on gregrs-uk:way-center into 9698898 on DinoTools:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-1.2%) to 93.086% when pulling 0df600d on gregrs-uk:way-center into 9698898 on DinoTools:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.03%) to 94.266% when pulling b40afd5 on gregrs-uk:way-center into 9698898 on DinoTools:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.03%) to 94.266% when pulling 82c2339 on gregrs-uk:way-center into 9698898 on DinoTools:master.

@gregrs-uk
Copy link
Contributor Author

I've fixed __init__.py in a few places.

I've also added a test involving another XML file. This represents the same way used in another test, but is what would be returned if the out center Overpass QL option is used.

N.B. the query I used also included the (._;>;); option, which means that the XML includes <node> elements. This is probably good because it means we can test the overpy.Way.nodes property. However, it's not compulsory to return <node> elements in the XML if the out center option is used on its own.

@phibos phibos added this to the 0.4 milestone Apr 14, 2016
@phibos
Copy link
Member

phibos commented Apr 14, 2016

Thanks for your contribution. I had a quick look at your code. But I will do some more tests before merging it.

@Gloix
Copy link
Contributor

Gloix commented Aug 1, 2016

Hi, @phibos could you test this PR?

@kelvan kelvan mentioned this pull request Nov 3, 2016
@phibos phibos merged commit 82c2339 into DinoTools:master Nov 21, 2016
phibos added a commit that referenced this pull request Nov 21, 2016
Support parsing of <center> element for ways (XML only)
This fixes #27 and fixes #44
@phibos
Copy link
Member

phibos commented Nov 21, 2016

I have merged the source with the latest master branch and have created a new pull request #47

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants