[Talk-us] I have created an API for creating GeoJSON extracts of the Microsoft US buildings dataset
Alexander Maiorov
alexander.mmaiorov at gmail.com
Sun Apr 11 02:31:56 UTC 2021
Good Evening,
I have taken an interest in the US buildings dataset by microsoft and I
have created an API to create small extracts(say of individual
neighborhoods or blocks) so that people can import small bits of the
dataset so that they don't have to trace it, but also have it be small
enough that they can manually go over it and make sure they don't destroy
any data or run into any of the other pitfalls of imports. I have hosted
this API on my website. The usage is very simple, you GET the url
https://3twenty2.xyz/us-buildings-api/api with a JSON polygon formatted as
the following in the body:
{"coordinates": [[-74.61936, 40.31205], [-74.6274, 40.31277], [-74.63214,
40.30419], [-74.61754, 40.30821], [-74.61936
, 40.31205]]}
And valid GEOJSON is returned from this. I will also paste a simple python
script that fetches the data as an example below. I have two questions.
First off, is there anyone who is good at developing JOSM plugins want to
develop a plugin that fetches from the API and downloads the layers
directly into JOSM? Second off, would I be within my rights to start using
my API personally in order to carefully import areas that I have local
knowledge in, and therefore would be able to fix any issues?
Thank you,
Alex Maiorov
Appendix: Python Script.
#!/usr/bin/env python3
import requests
import json
body = {
"coordinates": [[40.31205, -74.61936], [40.31277, -74.62740],
[40.30419, -74.63214], [40.30821, -74.61754], [40.31205, -74.61936]]
}
for p in body['coordinates']:
p.reverse()
text = json.dumps(body)
response = requests.request(method='get', url='
https://3twenty2.xyz/us-buildings-api/api', data=text)
print(str(response.text))
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/talk-us/attachments/20210410/d52a541f/attachment.htm>
More information about the Talk-us
mailing list