Russ Nelson's blog
rants and raves
http://blog.russnelson.com/gis/index.atomRuss Nelsonhttp://blog.russnelson.com/gis/index.atomme@russnelson.comCopyright 2021 Russ Nelson
Pyblosxom hhttp://pyblosxom.github.com/ 1.5.4.dev
2006-02-26T03:14:00ZWorld Wind and shapefileshttp://blog.russnelson.com/2006/02/26/ww-and-shapefiles2006-02-26T03:14:00Z2006-02-26T03:14:00Z
<p>How should NASA's <a href="http://worldwindcentral.com/">World
Wind</a> handle the introduction of a shapefile layer? Well, I can
think of two reasonable ways to do this.
<ol>
<li>somewhere there exists a .zip file containing the three component
files of the shapefile. A third party has written an XML which
describes how they want that shapefile drawn (e.g. with and without
labels). Their XML file specifies the URL of the shapefile.</li>
<li>somebody wants to publish a shapefile directly usable by WW. They
create the .zip with the three shapefile files, and add to it the .xml
needed by WW.</li.></p>
<p>I can think of only one benefit to #2: you don't have to deal with
telling your webserver that a .xml file is an XML file rather than
some kind of mutant HTML. A big advantage of #1 is that anybody can
describe anybody else's file for use in WW, *and* they don't have to
host that shapefile.</p>
<p>We could support both formats, of course. If you tell WW to use a
shapefile, WW could look at the filetype / extension. If it's XML,
then the XML specifies the shapefile with a URL. If it's .zip, then
the .zip contains the XML file.</p>
<p>Now, the second question is how to handle versions. Is there any
reason to keep permanently a shapefile given that WW doesn't
permanently keep any imagery data? Basically, WW is an online data
viewer and only caches imagery data. Why should it save a shapefile?
Thus, whenever you turn on a shapefile, WW should re-fetch the
shapefile (checking the HEAD just as a web browser does). If somebody
*really* wants to display local data, they can specify file:// as the
URL.</p>
LatLonUTMconversionhttp://blog.russnelson.com/2005/03/17/lat-lon-utm2005-03-17T22:51:00Z2005-03-17T22:51:00Z
<p>I've been doing a lot of work lately on mapping. If you go look at
the <a href="http://blog.russnelson.com/bicycling/">bicycling</a> category, you'll see some of it.
I need to improve the programs that make those maps, but once I'm satisfied
with them I'll publish them here. Most generally I want to do GIS-style
analysis of maps, only without using a GIS package. The most capable
open source GIS package is GRASS, but it has an incredibly steep
learning curve. I've tried to learn to use it twice now, and can't
get up the slope. It's easier to write my own software than to learn
to use GRASS. So that's what I'm doing, and you'll find all of my
Python GIS software at <a href="http://pygps.org/">pygps</a>.</p>
<p>In particular, today I'm releasing the LatLonUTMconversation library.
It converts (predictably enough) between latitude and longitude and
UTM coordinates. A GPS receiver will give you lat/lon, but UTM
(Universal Transverse Mercator) coordinates are more useful. For one,
you can compute distances using them, since each integer UTM tick is one
meter. For another, you can locate a point on a map by simple subtraction
and division by the scale of the map.</p>
Color Ortho Quads in NYhttp://blog.russnelson.com/2005/03/12/ny-color-quads2005-03-12T16:31:00Z2005-03-12T16:31:00Z
<p>I recently found out that (somebody) created color orthographic
quads of New York State. Look for <a href="ftp://www.nysgis.state.ny.us/pub/nysdop1">your county</a> on the
<a href="http://www.nysgis.state.ny.us/">NYS GIS</a> site. Naturally,
instead of publishing them in a lossless open format, they're
published in the proprietary MrSID format. This is a wavelet form of
compression similar to JPEG2000. There's a decoder called mrsiddecode
which creates .tiff or .jpg files as you wish.</p>
<p>I'm in St. Lawrence County (below left). They have complete
coverage for 60<abbr title="centimeters per pixel">cmpp</abbr>
colorized infrared (cir) quads (below middle). Unfortunately, they
only have partial coverage for 30cmpp color quads (below right). For
St. Lawrence County, they only cover Potsdam, Canton, Massena and
Ogdensburgh. A friend of mine, Simon St.Laurent, is another map geek.
He <a href="http://livingindryden.org/">lives in Dryden, NY</a>,
located in Tompkins County. I notice that <a href="ftp://www.nysgis.state.ny.us/pub/nysdop1/tompkins/utm/tiles">Tompkins
only has</a> 30cm cir <em>and</em> 20cm cir coverage, and no color quads at
all. So apparently the phrase "your mileage may vary" applies in
spades.
<br><table><tr><td><a href="http://mapper.acme.com/?lat=44.523633&long=-75.167922&scale=16&theme=Topo&width=8&height=9" border="0"><img src="http://blog.russnelson.com/images/stlawco.jpg"></a></td><td><a href="http://blog.russnelson.com/images/ir-coverage.jpg" border="0"><img src="http://blog.russnelson.com/images/ir-coverage-tn.jpg"></a></td><td><a href="http://blog.russnelson.com/images/color-coverage.jpg" border="0"><img src="http://blog.russnelson.com/images/color-coverage-tn.jpg"></a></td></tr></table></p>
<p>In order to use those images, I turned them into 200x200 pixel
tiles similar to those published by <a href="http://www.terraserver-usa.com/">Terraserver</a>. Those tiles
get thrown into an in-filesystem database which is a sparse local copy
of Terraserver. Whenever any of my <a href="http://pygps.org/">mapping software</a> fetches a map from
terraserver, it populates the database with it. I've only published
pygps and mapview. I haven't yet published maptracks (makes a map
with a GPS track overlaid), make-tiles (which splits up the color
ortho quads), nor make-tiles-index (which creates the coverage
maps above). They need improvement before they're seriously
usable.</p>
<p>These datasets get very large, by the way. I've recently
discovered the magic of external hard drives using USB 2.0. I picked
up a 120GB Western Digital drive from Office Max for $60. The ortho
quads amount to 3.9GB, but if you uncompress them all to .tiffs,
you'll fill up all 120GB. I need to uncompress on the fly with
make-tiles.</p>