apt-get update apt-get install postgresql-8.3-postgis libapache2-mod-python python-gdal apt-get install python-mapnik osm2pgsql python-setuptools tilecache gdal-bin apt-get install less zip unzip screen vim imagemagick easy_install nik2img mkdir /var/www/etech && ln -s /var/www/etech ~/etech
cd ~/etech && mkdir -p 01-shapefiles/start 01-shapefiles/end && cd 01-shapefiles/start curl -O http://www2.census.gov/geo/tiger/TIGER2007FE/fe_2007_us_state.zip unzip fe_2007_us_state.zip ogr2ogr -t_srs "+proj=latlong +datum=WGS84 +no_defs" states.shp fe_2007_us_state.shp
New end of /etc/postgresql/8.3/main/pg_hba.conf:
# Database administrative login by UNIX sockets local all postgres trust # TYPE DATABASE USER CIDR-ADDRESS METHOD # "local" is for Unix domain socket connections only local all all trust # IPv4 local connections: host all all 127.0.0.1/32 trust # IPv6 local connections: host all all ::1/128 trust # everyone everywhere host all all 0.0.0.0/0 trust
New listen addresses in /etc/postgresql/8.3/main/postgresql.conf:
listen_addresses = '*' # what IP address(es) to listen on;
# comma-separated list of addresses;
# defaults to 'localhost', '*' = all
Steps, for them:
cd ~/etech && mkdir -p 02-postgis/start 02-postgis/end && cd 02-postgis/start cd /usr/share/postgresql-8.3-postgis && createdb -U postgres etech_02_start && createlang -U postgres plpgsql etech_02_start && psql -U postgres etech_02_start < lwpostgis.sql cd /usr/share/postgresql-8.3-postgis && createdb -U postgres etech_02_end && createlang -U postgres plpgsql etech_02_end && psql -U postgres etech_02_end < lwpostgis.sql cd ~/etech/02-postgis/start && cp -v ../../01-shapefiles/end/states.* ./
Steps, for them:
cd ~/etech && mkdir -p 03-osm/start 03-osm/end && cd 03-osm/start cd /usr/share/postgresql-8.3-postgis && createdb -U postgres etech_03_start && createlang -U postgres plpgsql etech_03_start && psql -U postgres etech_03_start < lwpostgis.sql cd /usr/share/postgresql-8.3-postgis && createdb -U postgres etech_03_end && createlang -U postgres plpgsql etech_03_end && psql -U postgres etech_03_end < lwpostgis.sql cd ~/etech/03-osm/start # && cp -v ../../02-postgis/end/style.xml ./ osm2pgsql --create --latlong -U postgres -d etech_03_end sanjose.osm.xml # for later
Steps, for them:
cd ~/etech && mkdir -p 04-gdal/start 04-gdal/end && cd 04-gdal/start
For them:
gdal_translate -a_srs "+proj=latlong +datum=WGS84 +no_defs" \ -gcp 1012 7172 -121.992359 37.262953 \ -gcp 5122 7147 -121.808896 37.2636876 \ -gcp 2779 1556 -121.91408 37.46358387 \ -gcp 5328 1856 -121.799412 37.4526486 \ -gcp 3532 4491 -121.879920959 37.35862842 \ -of VRT sanjose1961a.jpg sanjose1961a.vrt
gdalwarp -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 +nadgrids=@null +no_defs" -of GTiff sanjose1961a.vrt sanjose1961a.tif
gdalwarp -te -13574855.3048 4482411.40257 -13568287.4548 4488979.25253 -ts 500 500 sanjose1961a.tif map-small.tif && convert map-small.tif map-small.jpg
<Layer 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 +nadgrids=@null +no_defs"> <StyleName>Raster</StyleName> <Datasource> <Parameter name="type">raster</Parameter> <Parameter name="file">sanjose1961a.tif</Parameter> <Parameter name="lox">-13585226.492</Parameter> <Parameter name="loy">4469036.036</Parameter> <Parameter name="hix">-13549981.670</Parameter> <Parameter name="hiy">4511736.878</Parameter> </Datasource> </Layer>
nik2img.py -v -m style.xml -e "-121.945,37.312,-121.886,37.355" -s 500,500 -o map-sanjose.png nik2img.py -v -m style.xml -e "-125.5,31.7,-113.3,42.6" -s 500,500 -o map-raster-cali.png