[OSM-dev] AND upload almost ready
Jon Burgess
jburgess777 at googlemail.com
Fri Aug 24 20:14:06 BST 2007
On Fri, 2007-08-24 at 19:56 +0200, Martijn van Oosterhout wrote:
> On 8/24/07, Tom Hughes <tom at compton.nu> wrote:
> > > Thanks, it's all XML right now, in either JOSM format or osmChange so
> > > I *think* we're all set. But we'll see...
> >
> > Not really, because we don't anything we can run on the server to
> > take such a file and load it into the database.
>
> After playing with osmosis on an local mysql database it does appear I
> overestimated the state of the art in database loading. It's kinda
> almost but not quite there.
>
> Are you ok with using osmosis to do it? Then it's time to exercise my
> java skills :)
>
I would think that the JOSM code might just as good or even a better
starting point. The trickiest things as I see them will be:-
1) Ensuring you allocate the correct new IDs for the objects you create
and create the correct DB entries. This is trivial if you upload via the
API since it takes care of this for you. Maybe slightly more difficult
if you have to import to the DB directly since you have to be consistent
with the API.
2) Updating all the future objects which references those which you've
just created.
i.e. when you create node(-100) and get returned ID=123456. You then
need to ensure that segment(-200) which has from="-100" gets uploaded
with from="123456".
I believe this means you'll have to maintain the ID mappings of all
nodes to rewrite from/to while uploading the segments. Similarly you'll
need to know the segment ID mappings to rewrite <seg id> while uploading
the ways.
JOSM is the only tool I know does this today, but maybe there are other
import scripts which I'm unaware of.
Jon
More information about the dev
mailing list