[OSM-talk] k/v for import of list of gas stations of France?

Joerg Ostertag (OSM Munich/Germany) openstreetmap at ostertag.name
Fri Jan 12 19:15:57 GMT 2007


On Friday 12 January 2007 15:12, Nick Burch wrote:
> On Fri, 12 Jan 2007, Marcus Bauer wrote:
> > On Fri, 2007-01-12 at 12:02 +0000, Nick Burch wrote:
> >> Does your script check to see if the thing's already there? I should
> >> have some POI data to import into OSM shortly, but it's possible that
> >> some of the points are already in OSM. So, I'll want to check before
> >> each upload.
> >
> > No, it is just some few and simple lines of perl to take ascii and
> > convert it into .osm. The upload is done via JOSM. So if JOSM doesn't
> > check and the REST API doesn't check then there is no check for
> > duplicates.
>
> My data's from all over the world, so checking it in josm might be a bit
> tedious. I think I'll probably want something that warns of potential
> clashes, but still outputs a .osm file for josm upload.
>
> To avoid re-inventing the wheel, is there some existing OSM perl code to
> download nodes for a small area around a given point, and parse the xml
> into something useful?

Yes almost: You should have a real closer look at all tools under 
svn.openstreetmap.org/utils/*/*.pl
With these tools you should be able to do similar things.
osm2csv converts osm data to csv
these csv files or the original osm files can be used by osmfilter to check 
against existing segments.
If don't want to download always only small parts, but want to always use the 
most current planet.osm to check against. Then you should add something like
  svn.openstreetmap.org/utils/osm2csv/osm2csv --area=germany
to your crontab. This would automagically check if there is a newer planet.osm 
File which can be downloaded and dos if existing. Then it converts this to a 
csv File for the requested Area. The resulting files can be found in 
~/osm/...

This works great for me. Then I only have to filter with osmfilter against my 
already converted local planet.osm copy.
I found this in most cases here sufficient(at least for the last 2.4GB of 
Track Files I had). You still have to check against a current download 
anyhow, to update connecting junctions, missconverted segments, ...
So after converting all the tracks in a batch run I then load each converted 
Trackfile and adjust/check/correct it before uploading.

Hope this helps

-
Joerg






More information about the talk mailing list