Skip to content

Commit

Permalink
Improved land cover rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
Ahlzen committed Sep 25, 2011
1 parent 724e73b commit 6482759
Show file tree
Hide file tree
Showing 5 changed files with 311 additions and 29 deletions.
11 changes: 6 additions & 5 deletions colors.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
4000 245 245 245
3000 235 220 175
2500 190 185 135
1700 240 250 150
1100 50 180 50
3000 240 240 240
2000 235 220 175
1500 190 185 135
1000 240 250 150
500 130 220 130
0 160 190 160
-32768 200 230 245
10 changes: 5 additions & 5 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@

<script type="text/javascript">

var tileroot = "tile/oakland"; var lat = 37.8 ; var lon = -122.2
//var tileroot = "tile/oakland"; var lat = 37.8 ; var lon = -122.2
//var tileroot = "tile/cadetail";var lat = 37.8 ; var lon = -122.2
//var tileroot = "tile/yosdetail"; var lat = 37.75 ; var lon = -119.64
var tileroot = "tile/yosdetail"; var lat = 37.75 ; var lon = -119.64

var zoom = 13;
var zoom = 12;

var levels = 16; // including level 0

Expand Down Expand Up @@ -44,15 +44,15 @@
tileroot+path,
{numZoomLevels: levels});
jpeg90h.setIsBaseLayer(true);
jpeg90h.setVisibility(true);
jpeg90h.setVisibility(false);
map.addLayer(jpeg90h);

path = "/jpeg90_l/${z}/${x}/${y}.jpg";
jpeg90l = new OpenLayers.Layer.OSM("NLCD Landcover - jpeg90",
tileroot+path,
{numZoomLevels: levels});
jpeg90l.setIsBaseLayer(true);
jpeg90l.setVisibility(false);
jpeg90l.setVisibility(true);
map.addLayer(jpeg90l);

map.addControl(new OpenLayers.Control.LayerSwitcher());
Expand Down
276 changes: 276 additions & 0 deletions nlcd2006.vrt
Original file line number Diff line number Diff line change
@@ -0,0 +1,276 @@
<VRTDataset rasterXSize="11687" rasterYSize="7328">
<SRS>PROJCS[&quot;Google Maps Global Mercator&quot;,GEOGCS[&quot;WGS 84&quot;,DATUM[&quot;WGS_1984&quot;,SPHEROID[&quot;WGS 84&quot;,6378137,298.2572235630016,AUTHORITY[&quot;EPSG&quot;,&quot;7030&quot;]],AUTHORITY[&quot;EPSG&quot;,&quot;6326&quot;]],PRIMEM[&quot;Greenwich&quot;,0],UNIT[&quot;degree&quot;,0.0174532925199433],AUTHORITY[&quot;EPSG&quot;,&quot;4326&quot;]],PROJECTION[&quot;Mercator_1SP&quot;],PARAMETER[&quot;central_meridian&quot;,0],PARAMETER[&quot;scale_factor&quot;,1],PARAMETER[&quot;false_easting&quot;,0],PARAMETER[&quot;false_northing&quot;,0],UNIT[&quot;metre&quot;,1,AUTHORITY[&quot;EPSG&quot;,&quot;9001&quot;]]]</SRS>
<GeoTransform> -1.3692000000000000e+07, 3.8075624383059910e+01, 0.0000000000000000e+00, 4.5790000000000000e+06, 0.0000000000000000e+00, -3.8075624383059910e+01</GeoTransform>
<Metadata>
<MDI key="AREA_OR_POINT">Area</MDI>
</Metadata>
<VRTRasterBand dataType="Byte" band="1">
<Metadata/>
<ColorInterp>Palette</ColorInterp>
<ColorTable>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="71" c2="107" c3="161" c4="255"/>
<Entry c1="209" c2="222" c3="250" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="205" c2="205" c3="205" c4="255"/>
<Entry c1="190" c2="190" c3="190" c4="255"/>
<Entry c1="160" c2="160" c3="160" c4="255"/>
<Entry c1="125" c2="125" c3="125" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="186" c2="202" c3="204" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="110" c2="204" c3="70" c4="255"/>
<Entry c1="71" c2="130" c3="77" c4="255"/>
<Entry c1="161" c2="196" c3="94" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="211" c2="191" c3="122" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="224" c2="224" c3="191" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="230" c2="227" c3="105" c4="255"/>
<Entry c1="212" c2="201" c3="98" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="186" c2="217" c3="235" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="112" c2="163" c3="186" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
<Entry c1="0" c2="0" c3="0" c4="255"/>
</ColorTable>
<SimpleSource>
<SourceFilename relativeToVRT="1">nlcd2006.tif</SourceFilename>
<SourceBand>1</SourceBand>
<SourceProperties RasterXSize="11687" RasterYSize="7328" DataType="Byte" BlockXSize="11687" BlockYSize="1"/>
<SrcRect xOff="0" yOff="0" xSize="11687" ySize="7328"/>
<DstRect xOff="0" yOff="0" xSize="11687" ySize="7328"/>
</SimpleSource>
</VRTRasterBand>
</VRTDataset>
31 changes: 18 additions & 13 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ $ cd demtools
$ make
$ mkdir -p ~/bin
$ cp bin/* ~/bin
NOTE: You may need to make the following changes:
NOTE: To build these, you may need to make the following changes:
* Makefile: GDAL_LIB=-lgdal1.6.0
* Makefile: CPP=g++ -O3 -I/usr/include/gdal
* stringtok.h may require a "using namespace std;" since it's
Expand All @@ -47,14 +47,15 @@ to the scons configure step:
BOOST_LIBS=$HOME/lib

Download required data files:
http://tile.openstreetmap.org/world_boundaries-spherical.tgz
http://tile.openstreetmap.org/processed_p.tar.bz2
http://tile.openstreetmap.org/shoreline_300.tar.bz2
http://www.naturalearthdata.com/download/10m/cultural/10m-populated-places.zip
http://www.naturalearthdata.com/download/110m/cultural/110m-admin-0-boundary-lines.zip
All NHD shapefiles: http://www.openstreetmap.us/nhd/
USGS NED data, as needed: http://openstreetmap.us/ned/13arcsec/grid/
Planet.osm or other OSM dataset: http://planet.openstreetmap.org/
* http://tile.openstreetmap.org/world_boundaries-spherical.tgz
* http://tile.openstreetmap.org/processed_p.tar.bz2
* http://tile.openstreetmap.org/shoreline_300.tar.bz2
* http://www.naturalearthdata.com/download/10m/cultural/10m-populated-places.zip
* http://www.naturalearthdata.com/download/110m/cultural/110m-admin-0-boundary-lines.zip
* USGS NHD shapefiles: http://www.openstreetmap.us/nhd/
* USGS NED data, as needed: http://openstreetmap.us/ned/13arcsec/grid/
* NLCD 2006 (Land cover) data: http://www.mrlc.gov/nlcd06_data.php
* Planet.osm or other OSM dataset: http://planet.openstreetmap.org/

Modify set-toposm-env, specifying file paths, settings and the
area of interest. Data imports will be limited to the specified
Expand All @@ -75,15 +76,19 @@ $ cd <hillshade dir>
$ for f in *.tif ; do gdaladdo -r gauss $f 2 4 8 16 32 ; done
$ (repeat for colormap, hypsorelief)

Prepare landcover data:
TODO: Translate NLCD to GeoTIFF and reproject to 900913
TODO: Build overviews
Copy nlcd2006.vrt to the NLCD directory, making sure it references
the landcover GeoTIFF. The VRT file is only used to modify the
color table.

Add a shortcut for your area(s) of interest to areas.py.

Generate the mapnik style files from templates:
$ ./generate_xml

Generate raster layers for color-relief tiles:
$ ./generate_colorrelief_include > colorrelieflayers.inc

Setup contour tables and generate contour lines, for example:
Create contour tables and generate contour lines, for example:
$ ./prep_contours_table
$ ./toposm.py prep WhiteMountains

Expand Down
Loading

0 comments on commit 6482759

Please sign in to comment.