Logu d'OpenStreetMap OpenStreetMap

Merging names

Pubblicatu di h4ck3rm1k3 lu 3 August 2009 n English

Ok. My large merge of all kosovo points is running.

I have made a perl script, and of course it is checked in to bzr on launchpad, that will parse the xml node points into a multidimensional hash structure.

It is keyed by lat,long and then the keys and values

like this
$node_data{"$lat,$long"}{$keyname}=$value;

the values of the node headers are stored verbatim.
$node_data{"$lat,$long"}{"node_decl"}="xml of node header"

If i have a node header already, I append the rest to the "decldel" to be deleted.
so we have only one node per x,y coordinate.

I mean, lets say you have a spring and a town, what are the chances of the spring being in the same location of the middle of the town?

In anycase, the data is uploading.

We now have perl scripts to process all the datapoints from GSN and could add them in for other countries as well.

I still have problems with points like
farms, bridges, sheepfold and others, they need to be ways...

mike

Email icon Bluesky Icon Facebook Icon LinkedIn Icon Mastodon Icon Telegram Icon X Icon

Discussion

Cummentu di lyx lu 3 August 2009 ê 15:15

It might be better to just list the duplicate nodes and let a human being decide which one to delete or to merge (taking tags from one of them or both). I guess you have already thought of points that are part of a way, where they have to be replaced with the remaining node if a node gets deleted.

Cummentu di h4ck3rm1k3 lu 3 August 2009 ê 15:31

Thanks Lyx,
I did a quick scan of the changes. The points that have the exact same decimal position are the ones I imported. I sorted them ascending by id first so that the old ones get kept. Basically, this can be used to import datasets on top of each other.

In the future, I will update nodes directly instead of creating new ones. So this should be a one off.

it is still uploading,
osm.org/api/0.6/changeset/2025575

Cummentu di h4ck3rm1k3 lu 5 August 2009 ê 17:00

Here is my splitting script,
it is not working yet fully, i mean the area is too small.
------
use strict;
use warnings;

my $startx = 41.78;
my $stopx = 43.30;

my $starty= 20.04;
my $stopy = 21.80;

my $steps = 5;

my $stepx = 0.25;
my $stepy = $stepx;

#GET osm.org/api/0.6/trackpoints?bbox=20.456542968749996,41.81636125072054,20.846557617187504,42.134894984239224&page=0

#GET osm.org/api/0.6/trackpoints?bbox=20.456542968749996,41.81636125072054,20.846557617187504,42.134894984239224&page=1

#osm.org/api/0.6/map?bbox=43.33,43.486,21.8,21.98
warn $stepx . "\n";
warn $stepy . "\n";
my $step = 0;

for( my $x = $startx; $x <= $stopx; $x += $stepx)
{

warn "x is now $x\n";

for(my $y = $starty; $y <= $stopy; $y += $stepy)
{
warn "y is now $y\n";
my $y2=$y + $stepy ;
my $x2=$x + $stepx ;
$step++;
my $y1=$y-$stepy;
my $x1=$x-$stepx;
print "wget osm.org/api/0.6/map?bbox=$x1,$y1,$x2,$y2 -O ${step}.osm\n";
print "wget osm.org/api/0.6/trackpoints?bbox=$x1,$y1,$x2,$y2 -O ${step}.gpx\n";
}
}

Cummentu di h4ck3rm1k3 lu 5 August 2009 ê 17:08

bzr branch lp:~kosova/+junk/openstreetmapkosova
here is the branch script.

there is an kosova.osm in there you can update that in josm
and there is a small section in dukajini that is not in there. Please add it in and then check in the new version.

Mergenames will scan the file and produce a new osm file that contains only the duplicates.

the you run mergenamessorted.pl to create the deletes in a new osmfile
and then you can upload that with josm.

Pi lassari cummenti trasi