![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
A client for the Overpass API, a read-only API that serves up custom selected parts of OpenStreetMap data.
The Overpass API is optimized for data consumers that need a few elements within a glimpse or up to roughly 10 million elements in some minutes, both selected by search criteria like location, type of objects, tag properties, proximity, or combinations of them. To make use of it, you should familiarize yourself with Overpass QL, the query language used to select the elements that you want.
There are three basic steps to fetch the spatial data you need:
Formulate a query
Query("node(5369192667); out;")
,Query
subclasses, f.e. SingleRouteQuery(relation_id=1643324)
.Call the Overpass API
client = Client(user_agent=...)
.await client.run_query(query)
to fetch the result set.Collect results
query.result_set
,collect_elements(query)
to get a list of typed Elements
.collect_routes
requires a RouteQuery
,
for instance.You may use the .result_set
property to get a list of all query results
without any extra processing:
from aio_overpass import Client, Query
query = Query('way["addr:housename"=Elbphilharmonie]; out geom;')
client = Client()
await client.run_query(query)
query.result_set
[
{
"type": "way",
"id": 24981342,
# ...
"tags": {
"addr:city": "Hamburg",
"addr:country": "DE",
"addr:housename": "Elbphilharmonie",
# ...
},
}
]
This will give you a user-friendly Python interface
for nodes,
ways,
and relations.
Here we use the .tags
property:
from aio_overpass.element import collect_elements
elems = collect_elements(query)
elems[0].tags
{
"addr:city": "Hamburg",
"addr:country": "DE",
"addr:housename": "Elbphilharmonie",
# ...
}
The processed elements can also easily be converted to GeoJSON:
import json
json.dumps(elems[0].geojson, indent=4)
{
"type": "Feature",
"geometry": {
"type": "Polygon",
"coordinates": [
[
[
9.9832434,
53.5415472
],
...
]
]
},
"properties": {
"id": 24981342,
"type": "way",
"tags": {
"addr:city": "Hamburg",
"addr:country": "DE",
"addr:housename": "Elbphilharmonie",
...
},
...
},
"bbox": [
9.9832434,
53.540877,
9.9849674
53.5416212,
]
}
This library can be installed with a number of optional extras.
Install no extras, if you're fine with dict
result sets.
Install the shapely
extra, if you would like the convenience of typed OSM elements.
It is also useful if you are interested in elements' geometries,
and either already use Shapely, or want a simple way to export GeoJSON.
pt
module to make it easier to interact with public transportation routes.
Something seemingly trivial like listing the stops of a route can have unexpected pitfalls,
since stops can have multiple route members, and may have a range of different tags and roles.
This submodule will clean up the relation data for you.Install the networkx
extra to enable the pt_ordered
module, if you want a route's path as a
simple line from A to B. It is hard to do this consistently, mainly because ways are not always
ordered, and stop positions might be missing. You can benefit from this submodule if you wish to
Install the joblib
extra to speed up pt_ordered.collect_ordered_routes()
, which can benefit
greatly from parallelization.
FAQs
Async client for the Overpass API
We found that aio-overpass demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.