wcedmisten / wcedmisten.fyi

My personal blog
https://wcedmisten.fyi
Creative Commons Attribution 4.0 International
7 stars 0 forks source link

A few comments on Overpass API #1

Open mmd-osm opened 2 months ago

mmd-osm commented 2 months ago

Quick comment on the Overpass section in https://github.com/wcedmisten/wcedmisten.fyi/blob/e73fa7d431b506fb963129eea61a73015f2e4640/articles/how-to-query-osm.mdx#1-overpass-turbo:

Rate limits - since the service is provided to the public for free, it has limitations on the size and duration of each request.

    Queries that take longer than 180 seconds will be canceled
    Queries that use more than 512 MiB of RAM will be canceled
    Just for context, this means we can find all Italian restaurants in Virginia, but not in the whole US

180s and 512MB are only default settings for a query, which are used unless you override the settings in your query. They're not hard limits. The OSM wiki has some details on both settings, and how to tweak them:

So yes, you can request all Italian restaurants across the whole US, absolutely no issue with that:

[out:json][timeout:600];
area["ISO3166-1"="US"]->.searchArea;
nwr["amenity"="restaurant"]["cuisine"="italian"](area.searchArea);
out center;

By the way, this isn't directly related to rate limiting either, which is something different again for Overpass API. That's a story for another time...

wcedmisten commented 2 months ago

Thanks for clarifying that! Renamed to "resource limits" and clarified the behavior of Overpass:

https://github.com/wcedmisten/wcedmisten.fyi/commit/a6fe8e4437de7d060e91fa4288facaa6c76ccb85