[Xastir] split_gnis script

Jack Twilley jmt at twilley.org
Fri Mar 19 17:01:16 EST 2004


WARNING: Unsanitized content follows.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

>>>>> "Curt" == Curt Mills <archer at eskimo.com> writes:

Jack> I have finished the script, and it looks good to me.  It has
Jack> been added to the repository -- please play with it and let me
Jack> know how it goes.  The only significant difference between my
Jack> script and the bash script is that I use _ in place of space in
Jack> file names -- names like WI_St._Claire.gnis look better to me
Jack> visually.

Curt> And are a bit easier to deal with from the command-line.

A bit, yeah.  

Jack> The WI_deci file is 12822732 characters in length.  The sum
Jack> total of the county files is 4444905 characters -- hard to
Jack> believe that two-thirds of the file is wasted space!  The number
Jack> of lines in the WI_deci file is the same as the sum of county
Jack> files, so no lines were lost.

Curt> Crap.  That's not good.  I knew the lines were long, but not
Curt> THAT long!

Curt> I wonder if we should add code to Xastir to create these smaller
Curt> files automatically, or at least trim off the excess?  The first
Curt> is probably not a good idea, but that second one might be.

The first is definitely not a good idea -- keep in mind that some
folks want to be able to switch maps by switching CDs so actually
modifying the maps (not just the indices) inside xastir is probably
bad.

I would suggest a variant of the second idea -- modify the printf()
statement that reads in the file to discard any spaces after the last
field in the line.

My script as submitted isn't *perfect*, but it's damned close.  Here's
a list by state of the lines that don't get filed properly:

      12 AS/_.gnis
       1 CA/_.gnis
      26 GU/_.gnis
    2604 HI/_.gnis
       2 IA/_.gnis
       3 Pop_places/_.gnis
    2648 total

With the islands (AS, GU, HI), it's all eight-bit stuff.  Same for
California.  For Iowa, it's because the folks who created the file
used these two lines:

"IA","James "Tame Jim" Wilson State Historical Marker","park","Tama",19,171,"421126N","0922751W",42.19056,-92.46417,"","",,,,,"","Traer"
"IA","Site of Former "Old" Buckingham Historical Marker","park","Tama",19,171,"UNKNOWN","UNKNOWN",,,"","",,,,,"","Traer"

It's field two in both cases, and I think it's an error, so I'm going
to contact the GNIS Manager in accordance to the geonames FAQ.  Maybe
xastir will be noticed by the higher-ups as a force for good!

Jack.
- -- 
Jack Twilley
jmt at twilley dot org
http colon slash slash www dot twilley dot org slash tilde jmt slash
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (FreeBSD)

iD8DBQFAW22yGPFSfAB/ezgRAiKBAKDALl4tOS2Cpm4iLD7M6iYr70yhqwCgruCz
JY2KJudv9Py5pDUPryUpwug=
=yRCU
-----END PGP SIGNATURE-----



More information about the Xastir mailing list