Changeset 71
- Timestamp:
- 13.10.2009 11:05:51 (6 weeks ago)
- Location:
- OpenTrackMap
- Files:
-
- 19 added
- 8 removed
- 10 modified
-
. (modified) (1 prop)
-
bin (modified) (1 prop)
-
bin/full_update_osmosis.py (modified) (2 diffs)
-
bin/incremental_update_osm2pgsql.py (modified) (1 diff)
-
bin/relations2lines.py (modified) (1 diff)
-
mapnik/README (deleted)
-
mapnik/convert-fontset (deleted)
-
mapnik/convert-template (deleted)
-
mapnik/default.style (modified) (1 diff)
-
mapnik/generate_poster.py (added)
-
mapnik/generate_tiles.py (modified) (5 diffs)
-
mapnik/generate_tiles2.py (deleted)
-
mapnik/inc (added)
-
mapnik/inc/datasource-settings.xml.inc (added)
-
mapnik/inc/entities.xml.inc (added)
-
mapnik/inc/fontset-settings.xml.inc (added)
-
mapnik/inc/latlon-datasource-settings.xml.inc (added)
-
mapnik/inc/settings.xml.inc (added)
-
mapnik/openlayers.html (modified) (1 diff)
-
mapnik/osm-template-fontset.xml (deleted)
-
mapnik/osm-template.xml (deleted)
-
mapnik/osm.xml (added)
-
mapnik/osm.xml.diff (added)
-
mapnik/symbols/bus_station.n.16.png (added)
-
mapnik/symbols/bus_stop_small.png (added)
-
mapnik/symbols/caravan_park.p.24.png (added)
-
mapnik/symbols/embassy.png (added)
-
mapnik/symbols/guest_house.p.16.png (added)
-
mapnik/symbols/hostel.p.20.png (added)
-
mapnik/symbols/memorial.png (added)
-
mapnik/symbols/school.png (added)
-
mapnik/symbols/spring.png (added)
-
mapnik/symbols/traffic_light.png (added)
-
mapnik/uncustomize-mapnik-map (deleted)
-
mapnik/zoom-to-scale.txt (deleted)
-
usgs_srtm/srtm2contours.sh (modified) (1 diff)
-
usgs_srtm/srtm2shade.sh (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
OpenTrackMap
- Property svn:ignore
-
old new 1 demtools2 osm2pgsql3 1 commit.sh
-
- Property svn:ignore
-
OpenTrackMap/bin
-
Property
svn:ignore set
to
demtools
gdal
mapnik-*
osm_mapnik
osmosis-*
osm2pgsql
postgis-*
tiff-*
-
Property
svn:ignore set
to
-
OpenTrackMap/bin/full_update_osmosis.py
r70 r71 21 21 return system(command) 22 22 23 """for I in range(14):23 for I in range(14): 24 24 # Delete previous planet file. 25 25 execute("rm -rf %s" % (osm_data_file,)) … … 36 36 37 37 # Bound it with bonding region of CR. 38 #execute('bzcat %s | %s --read-xml file=- --bounding-box left="12.10"' 39 #' right="18.87" top="51.06" bottom="48.55" --write-xml file=%s' % ( 40 #osm_data_file, osmosis, otm_data_file)) 38 41 execute('bzcat %s | %s --read-xml file=- --bounding-box left="12.10"' 39 ' right="18.87" top="51.06" bottom="48.55" --write-xml file=%s' % ( 40 osm_data_file, osmosis, otm_data_file))""" 41 42 timestamp = '090902' 42 ' right="18.87" top="51.32" bottom="48.27" --write-xml file=%s' % ( 43 osm_data_file, osmosis, otm_data_file)) 43 44 44 45 # Import data to database. -
OpenTrackMap/bin/incremental_update_osm2pgsql.py
r70 r71 7 7 from re import match 8 8 9 bin_prefix="/home/blackhex/OpenTrackMap/" 9 10 prefix = "/mnt/data/OpenTrackMap/" 10 11 mirror = "http://planet.openstreetmap.org" 11 osmosis = prefix + "bin/osmosis-0.31/bin/osmosis"12 osm2pgsql = prefix + "bin/osm2pgsql/osm2pgsql"12 osmosis = bin_prefix + "bin/osmosis-0.31/bin/osmosis" 13 osm2pgsql = bin_prefix + "bin/osm2pgsql/osm2pgsql" 13 14 timestamp_filename = prefix + "opentrackmap.timestamp" 14 15 bbox = "12.10,48.55,18.87,51.06" -
OpenTrackMap/bin/relations2lines.py
r70 r71 16 16 17 17 # Clean previous tracks. 18 auxilary_cursor.execute("DELETE FROM planet_osm_track_rels") 18 auxilary_cursor.execute("DROP TABLE IF EXISTS planet_osm_track_rels") 19 auxilary_cursor.execute("CREATE TABLE planet_osm_track_rels AS SELECT * FROM planet_osm_line WHERE osm_id = 0") 20 auxilary_cursor.execute("INSERT INTO geometry_columns VALUES ('', 'public', 'planet_osm_track_rels', 'way', 2, 900910, 'LINESTRING')") 19 21 20 22 # Select all route relations. -
OpenTrackMap/mapnik/default.style
r70 r71 116 116 117 117 # International hiking tracks. 118 way network text linear 118 119 way iwn text linear 119 120 -
OpenTrackMap/mapnik/generate_tiles.py
r70 r71 8 8 import sys, os 9 9 10 os.environ['LD_LIBRARY_PATH'] = '/home/blackhex/local/Mapnik/lib'11 10 path = ['/home/blackhex/local/Mapnik/lib/python2.6/site-packages'] 12 11 path.extend(sys.path) … … 62 61 # Setup Mapnik 63 62 gprj = GoogleProjection(maxZoom + 1) 64 m = Map(2 * 256, 2 *256)65 load_map(m, mapFile )63 m = Map(256, 256) 64 load_map(m, mapFile, True) 66 65 prj = Projection("+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0" 67 66 " +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs +over") … … 104 103 105 104 bbox = Envelope(c0.x,c0.y,c1.x,c1.y) 106 bbox.width(bbox.width() * 2)107 bbox.height(bbox.height() * 2)108 105 m.zoom_to_box(bbox) 106 m.buffer_size = 64 109 107 110 108 str_y = "%s" % y 111 112 109 tileHQFile = os.path.join(tileHQDir, zoom, str_x, str_y + '.png') 113 110 tileSQFile = os.path.join(tileSQDir, zoom, str_x, str_y + '.png') … … 117 114 exists = "exists" 118 115 else: 119 im = Image(512, 512) 120 render(m, im) 121 view = im.view(128,128,256,256) # x,y,width,height 116 image = Image(256, 256) 117 render(m, image) 122 118 123 119 fsLock.acquire() 124 120 # We should check file existance aggain for atomicity. 125 121 if not os.path.exists(tileHQFile): 126 view.save(tileHQFile,'png')122 image.save(tileHQFile,'png') 127 123 fsLock.release() 128 124 … … 189 185 190 186 # Czech Republic 191 minZoom = 0187 minZoom = 1 192 188 maxZoom = 14 193 189 bbox = (12.10, 48.55, 18.87, 51.06) 194 190 195 191 # Sluknov 196 #minZoom = 0192 #minZoom = 1 197 193 #maxZoom = 15 198 194 #bbox = (14.16, 50.86, 14.40, 50.95) 199 195 200 196 # Brno 201 #minZoom = 0197 #minZoom = 1 202 198 #maxZoom = 15 203 199 #bbox = (16.4646, 49.1254, 16.7214, 49.3106) 204 200 205 201 # Ricany - Kostelec nad Cernymi Lesy 206 #minZoom = 9202 #minZoom = 1 207 203 #maxZoom = 17 208 204 #bbox = (14.62, 49.95, 14.91, 50.04) 209 205 210 206 # Beskydy - TravnÜ 211 #minZoom = 1 3207 #minZoom = 1 212 208 #maxZoom = 17 213 209 #bbox = (18.42, 49.49, 18.66, 49.62) 214 210 215 211 # KrkonoÅ¡e 216 #minZoom = 9212 #minZoom = 1 217 213 #maxZoom = 17 218 214 #bbox = (15.10, 50.76, 15.40, 50.88) 219 215 220 216 # TiÅ¡nov 221 #minZoom = 9217 #minZoom = 1 222 218 #maxZoom = 17 223 219 #bbox = (16.41, 49.34, 16.43, 49.36) -
OpenTrackMap/mapnik/openlayers.html
r57 r71 1 1 <html> 2 2 <head> 3 <title>OpenStreetMap</title> 4 5 <!-- bring in the OpenLayers javascript library 6 (here we bring it from the remote site, but you could 7 easily serve up this javascript yourself) --> 8 <script src="http://www.openlayers.org/api/OpenLayers.js"></script> 9 10 <!-- bring in the OpenStreetMap OpenLayers layers. 11 Using this hosted file will make sure we are kept up 12 to date with any necessary changes --> 13 <script src="http://www.openstreetmap.org/openlayers/OpenStreetMap.js"></script> 14 15 <script type="text/javascript"> 16 // Start position for the map (hardcoded here for simplicity, 17 // but maybe you want to get from URL params) 18 // (Though to get it from the URL it's simpler to use the Permalink and ArgParser controls) 19 var lat=49.19 20 var lon=16.61 21 var zoom=13 22 23 var map; //complex object of type OpenLayers.Map 24 25 //Initialise the 'map' object 26 function init() { 27 28 map = new OpenLayers.Map ("map", { 29 controls:[ 30 new OpenLayers.Control.Navigation(), 3 <title>OpenStreetMap</title> 4 5 <!-- bring in the OpenLayers javascript library 6 (here we bring it from the remote site, but you could 7 easily serve up this javascript yourself) --> 8 <script src="http://www.openlayers.org/api/OpenLayers.js"></script> 9 10 <!-- bring in the OpenStreetMap OpenLayers layers. 11 Using this hosted file will make sure we are kept up 12 to date with any necessary changes --> 13 <script src="http://www.openstreetmap.org/openlayers/OpenStreetMap.js"></script> 14 15 <script type="text/javascript"> 16 // Start position for the map (hardcoded here for simplicity, 17 // but maybe you want to get from URL params) 18 // (Though to get it from the URL it's simpler to use the Permalink and ArgParser controls) 19 var lat=49.7 20 var lon=15.2 21 var zoom=7 22 23 var map; //complex object of type OpenLayers.Map 24 25 function getTileURL(bounds) 26 { 27 var res = this.map.getResolution(); 28 var x = Math.round((bounds.left - this.maxExtent.left) / (res * this.tileSize.w)); 29 var y = Math.round((this.maxExtent.top - bounds.top) / (res * this.tileSize.h)); 30 var z = this.map.getZoom(); 31 var limit = Math.pow(2, z); 32 33 if (y < 0 || y >= limit) 34 { 35 return "404.png"; 36 } 37 else 38 { 39 x = ((x % limit) + limit) % limit; 40 return this.url + z + "/" + x + "/" + y + "." + this.type; 41 } 42 } 43 44 45 //Initialise the 'map' object 46 function init() 47 { 48 map = new OpenLayers.Map ("map", 49 { 50 controls : [new OpenLayers.Control.Navigation(), 31 51 new OpenLayers.Control.PanZoomBar(), 32 52 new OpenLayers.Control.Attribution(), 33 53 new OpenLayers.Control.LayerSwitcher({'div': OpenLayers.Util.getElement('layerswitcher')})], 34 maxExtent: new OpenLayers.Bounds(-20037508.34,-20037508.34,20037508.34,20037508.34),35 maxResolution: 156543.0399,36 numZoomLevels: 19,37 units: 'm',38 projection: new OpenLayers.Projection("EPSG:900913"),39 displayProjection: new OpenLayers.Projection("EPSG:4326")40 });54 maxExtent: new OpenLayers.Bounds(-20037508.34,-20037508.34,20037508.34,20037508.34), 55 maxResolution: 156543.0399, 56 numZoomLevels: 19, 57 units: 'm', 58 projection: new OpenLayers.Projection("EPSG:900913"), 59 displayProjection: new OpenLayers.Projection("EPSG:4326") 60 }); 41 61 42 var openTrackMap = new OpenLayers.Layer.OSM("OpenTrackMap", "tiles_hq/", {numZoomLevels: 18});43 map.addLayer(openTrackMap);62 var openTrackMap = new OpenLayers.Layer.OSM("OpenTrackMap", "tiles_hq/", {type: 'png', numZoomLevels: 18, getURL: getTileURL}); 63 map.addLayer(openTrackMap); 44 64 45 // Define the map layer46 // Note that we use a predefined layer that will be47 // kept up to date with URL changes48 // Here we define just one layer, but providing a choice49 // of several layers is also quite simple50 // Other defined layers are OpenLayers.Layer.OSM.Mapnik, OpenLayers.Layer.OSM.Maplint and OpenLayers.Layer.OSM.CycleMap51 mapnik = new OpenLayers.Layer.OSM.Mapnik("Mapnik");52 map.addLayer(mapnik);65 // Define the map layer 66 // Note that we use a predefined layer that will be 67 // kept up to date with URL changes 68 // Here we define just one layer, but providing a choice 69 // of several layers is also quite simple 70 // Other defined layers are OpenLayers.Layer.OSM.Mapnik, OpenLayers.Layer.OSM.Maplint and OpenLayers.Layer.OSM.CycleMap 71 mapnik = new OpenLayers.Layer.OSM.Mapnik("Mapnik"); 72 map.addLayer(mapnik); 53 73 54 if( ! map.getCenter() ){55 var lonLat = new OpenLayers.LonLat(lon, lat).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject());56 map.setCenter (lonLat, zoom);57 }58 }59 60 </script>74 if( !map.getCenter()) 75 { 76 var lonLat = new OpenLayers.LonLat(lon, lat).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()); 77 map.setCenter (lonLat, zoom); 78 } 79 } 80 </script> 61 81 </head> 62 82 -
OpenTrackMap/usgs_srtm/srtm2contours.sh
r70 r71 6 6 rm -f "${TILE%%.zip}" "${TILE%%.hgt.zip}.shp" "${TILE%%.hgt.zip}.shx" "${TILE%%.hgt.zip}.dbf" 7 7 8 echo "/home/blackhex/local/gdal/bin/gdal_contour -i 10 -snodata -32767 -a height ${TILE%%.hgt.zip}.tif ${TILE%%.hgt.zip}.shp"9 /home/blackhex/local/Mapnik/bin/gdal_contour -i 10 -snodata -32767 -a height "${TILE%%.hgt.zip}.tif" "${TILE%%.hgt.zip}.shp"8 echo "/home/blackhex/local/gdal/bin/gdal_contour -i 10 -snodata 32767 -a height ${TILE%%.hgt.zip}.tif ${TILE%%.hgt.zip}.shp" 9 /home/blackhex/local/Mapnik/bin/gdal_contour -i 10 -snodata 32767 -a height "${TILE%%.hgt.zip}.tif" "${TILE%%.hgt.zip}.shp" 10 10 if [ "$CREATE" == "1" ]; then 11 11 echo "/usr/lib/postgresql/8.4/bin/shp2pgsql -d -I -g way ${TILE%%.hgt.zip} contours | psql -q osm" -
OpenTrackMap/usgs_srtm/srtm2shade.sh
r70 r71 5 5 export LD_LIBRARY_PATH="${PREFIX}/lib" 6 6 7 #for TILE in N*E*.hgt.zip; do8 #yes | ./srtm_generate_hdr.sh ${TILE}9 #rm -f "${TILE%%.hgt.zip}.bil" "${TILE%%.hgt.zip}.hdr" "${TILE%%.hgt.zip}.prj" "${TILE%%.hgt.zip}.hgt"10 #done11 # 12 # ${PREFIX}/bin/gdal_merge.py -v -o srtm.tif -ul_lr 12.10 51.06 18.87 48.55N*E*.tif13 #${PREFIX}/bin/gdalwarp -of GTiff -co "TILED=YES" -co "BIGTIFF=YES" -srcnodata 32767 -dstnodata 0 -t_srs "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgris=@null +no_defs" \14 #-rcs -order 3 -tr 30 30 -wt Float32 -ot Float32 -wo SAMPLE_STEPS=100 -multi srtm.tif warped.tif7 for TILE in N*E*.hgt.zip; do 8 yes | ./srtm_generate_hdr.sh ${TILE} 9 rm -f "${TILE%%.hgt.zip}.bil" "${TILE%%.hgt.zip}.hdr" "${TILE%%.hgt.zip}.prj" "${TILE%%.hgt.zip}.hgt" 10 done 11 12 ${PREFIX}/bin/gdal_merge.py -v -o srtm.tif -ul_lr 12.10 51.32 18.86 48.27 N*E*.tif 13 ${PREFIX}/bin/gdalwarp -of GTiff -co "TILED=YES" -co "BIGTIFF=YES" -srcnodata 32767 -dstnodata 0 -t_srs "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgris=@null +no_defs" \ 14 -rcs -order 3 -tr 30 30 -wt Float32 -ot Float32 -wo SAMPLE_STEPS=100 -multi srtm.tif warped.tif 15 15 ./hillshade warped.tif hillshade.tif -s 0.2
