Hey Dave,<br><br>It seems I was plugging away at the same problem at the same time. The attached ruby code does the same thing - converts a TIGER/line dataset into an osm.xml file for use in JOSM. I was waiting until the county I uploaded to the OSM has been rendered before announcing to the list, and it seems my tendency to release conservatively has cost us some duplicated work. It's just now starting to show up on Mapnik, so here it is:
<br><br>San Juan County, WA:<br><a href="http://www.openstreetmap.org/?lat=48.5665468249085&lon=-122.92443235588507&zoom=11">http://www.openstreetmap.org/?lat=48.5665468249085&lon=-122.92443235588507&zoom=11
</a><br>A little closer, with residential street names:<br><a href="http://www.openstreetmap.org/?lat=48.696391327319255&lon=-122.90743788324761&zoom=15">http://www.openstreetmap.org/?lat=48.696391327319255&lon=-122.90743788324761&zoom=15
</a><br><br>For bonus points, check out the metadata on each OSM feature. Includes address ranges and alternate names.<br><br>The code that produced this is attached. Here's what each file does:<br>tiger.rb - a model of TIGER data
<br>osm_model.rb - a model of OSM data<br>attr_map.rb - a mapping of TIGER CFCC data to OSM tags<br>to_osm.rb - extends the TigerLine::Dataset class with to_osm and to_osm_xml methods<br>tiger_to_osm.rb - a command-line function to convert a set of TIGER files into an
osm.xml file.<br><br>--==--<br><br>Let's put our heads together, combine the features of our two importers, and work on some of the outstanding issues like the _incredible slowness_ of the upload. The county in the above map took about 10 hours to upload. And it's a small, rural county.
<br><br>-B<br><br><br><br><div><span class="gmail_quote">On 6/13/07, <b class="gmail_sendername">Dave Hansen</b> <<a href="mailto:firstname.lastname@example.org">email@example.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I've hacked up the tiger import code a bit. Instead of having it upload<br>to osm directly, I decided to have it produce .osm files that JOSM could<br>open. I bet this might be a good approach in the future for other
<br>people, too. It allows you to make sure that the map "looks right", and<br>to run things like the JOSM validator plugin on it. At this point, the<br>only validator warnings that it produces are for untagged and unnamed
<br>ways. I need to verify that the TIGER db even _has_ names for these.<br><br>I've also created a couple of ruby classes to make handing the node,<br>segment, and way classes a bit easier. This is my first coding in ruby,
<br>ever, so please be gentle. :)<br><br>The node creation code will detect close nodes and merge them. This<br>uses raw lat/lon and pretends they're actual distance units for now.<br>I'm sure this can be easily fixed up to use real distances
<br><br>This will create ordered ways, and will coalesce all adjacent ways with<br>the same name into a single way. It will flip segments and ways as<br>necessary to make them fit. I had some performance problems with this,
<br>but I feel like it's running at a workable speed now.<br><br>One last thing... Do we really need the mysql database? After<br>importing a single zip code, the database only looks to me to be ~2MB.<br>I also don't see any SELECT statements which look too horribly complex.
<br>Any chance we could just build the DB's contents in-memory? We'd be<br>left with scripts that take TIGER .zip files and produce .osms. We<br>could post those individually somewhere and have people familiar with
<br>the area go over them before actually uploading them.<br><br>-- Dave<br><br><br><br>_______________________________________________<br>dev mailing list<br><a href="mailto:firstname.lastname@example.org">email@example.com</a>