[OSM-dev] how many api calls/time for an app allowed?

Ævar Arnfjörð Bjarmason avarab at gmail.com
Mon Jul 6 13:08:28 BST 2009


On Mon, Jul 6, 2009 at 1:15 AM, Eddy Petrișor<eddy.petrisor at gmail.com> wrote:
> We know there are multiple municipalities with the same name, so we
> can't easily use the country extract (also keeping the dom for the
> entire country in memory is probably not feasible) to detect data which
> already exists; even if we'd work with the country extract, we'd need to
>  query the places to get the current data, while race conditions could
> appear and we might end up with duplicate places.

I think you *can* use the country extracts, just download a daily dump
of Romania:

http://download.geofabrik.de/osm/europe/romania.osm.bz2

And import it into a PostgreSQL OSM DB with osmosis. You'll be able to
query the whole thing with SQL with no need to parse XML yourself or
keep anything in memory. A query like "give me all place=* nodes and
their coordinates" is trivial.

Then just import it and assume that what you have in your local
database is current. Going through all this trouble to be absolutely
certain you don't have duplicate data is IMO a bit silly. place=*
nodes aren't something people are adding *all the time* especially
within the scope of one country.

The day after you do the import you can just get another extract of
Romania, import it again and make an SQL query to find out if it
resulted in any duplicate data, there probably won't get any, but even
if there is it'll almost certainly be in the single digits and you can
just manually remove those offending nodes.

> Would such an import be considered over the limit? Should we rather
> query for the map for a wider area and reuse, than querying for small
> chunks?

You probably could convince the server admins not to ban you if you
run this slowly, or set up your own more current Planet mirror
yourself (or use somebody elses). But as stated above I think it's a
bit too much trouble over nothing.




More information about the dev mailing list