TL;DR: I spent too much time today trying to make the MapMappers road data 
clean enough to import into OSM and I haven't succeeded yet. I am afraid that I 
am running out of time to spend on this project. #osm rules.

I spent about 12 hours on this today. No luck yet, although I did learn an 
awful lot about cleaning up geometries so that JOSM won't complain about them.

1) You can fix the topology of a shapefile by importing it into GRASS and using 
v.clean. Unfortunately, there is a stupid bug in GRASS and v.out.ogr takes way 
way longer than it should.

2) You can de-dupe overlapping ways in PostGIS with variations on "select 
distinct geometry_field from roads" and then adding back the attributes later. 
You lose some data this way, but if you had overlapping roads in your source 
data to begin with... Who cares. Also, this doesn't seem to handle geometries 
that are reversed.

3) It's actually really tricky to identify line segments that are the same but 
reversed. I wound up hacking ogr2osm.py to detect and throw away the subsequent 
instances. There are probably better ways to do this.

4) I still don't have a good solution for this "double roads" problem:

  http://iconocla.st/hot/so/kill-me-now.png

Basically, the MadMappers roads data, on closer inspection, are a *bunch* of 
different road layers smooshed together into a single file. Someone has to sit 
down and figure out which values of the "layer" attribute actually mean 
anything. I'm wiped out and running out of available time to work on this -- if 
anyone else here has the time and energy to take over, let me know offlist; 
I'll be up in six hours or so. Otherwise I'll do the best I can to get it done 
when free time permits.

I will say this though: The denizens of the #osm IRC channel are awesome. Thank 
you to everyone on IRC who helped out with advice or code today.

SDE
_______________________________________________
HOT mailing list
[email protected]
http://lists.openstreetmap.org/listinfo/hot

Reply via email to