[OSM-talk] US County and State Borders Was: Re: TIGER, which states next?
Ted Mielczarek
ted.mielczarek at gmail.com
Thu Dec 6 18:59:50 GMT 2007
On Dec 5, 2007 11:41 AM, Adam Schreiber <sadam at clemson.edu> wrote:
>
> On Oct 24, 2007 12:14 PM, Ted Mielczarek <ted at mielczarek.org> wrote:
> >
> > On 10/24/07, Dave Hansen <dave at sr71.net> wrote:
> > > On Wed, 2007-10-24 at 10:31 -0400, Ted Mielczarek wrote:
> > > >
> > > > Yep, they're all TIGER data, provided as shapefiles by the Census
> > > > bureau. I've already imported the state boundaries for the northeast
> > > > of the US, you can see them in mapnik as dashed red lines. I didn't
> > > > just throw them all in willy-nilly, I split the borders into sections
> > > > so I could label them left:state and right:state, and I deleted
> > > > overlapping border sections.
> > >
> > > Manually, or programatically?
> > >
> > > We'll probably have to automate it to get county boundaries. There are
> > > just too many of them to do manually.
> >
> > Manually. It's not so bad for states since they have nice large
> > borders and large overlapping areas. It would be tedious for
> > counties. There's probably an algorithm you could use to find the
> > common borders, but I haven't looked at all.
>
> Could you provide a thumbnail sketch of the procedure you're using to
> extract the state boundaries? I have some free time of from school
> and would be interested in doing some of the Southeastern states.
I'll tell you what I did, and I'll upload the state boundary OSM files
I have to save you some time.
I took the TIGER state boundary files from here:
http://www.census.gov/geo/www/cob/st2000.html, ran them through
ogr2ogr to get GML, and then used a quick hack of a Python script
(which I can make available if anyone is interested, but it's pretty
hackish) to turn them into OSM files. (The script makes ways of 250
points max.)
I then opened the OSM files in JOSM and hand-edited the boundaries to
delete overlapping sections of neighboring states, and tag them with
left:state and right:state tags as appropriate. This is sort of
tedious, but the overlapping sections are pretty large, so it's not
terrible.
Once I had done a bunch of states, I combined them into one large OSM
file and used the bulk uploader to upload the result. Overall not the
best process, but it's workable for this data set. If someone wanted
to do the county data they'd definitely need to automate the process.
Anyway, my state border OSM files are available at:
http://ted.mielczarek.org/code/osm/state-osm/, and I've included the
Python converter script there as well.
Regards,
-Ted
More information about the talk
mailing list