source: subversion/applications/utils/coastcheck/doit @ 29902

Last change on this file since 29902 was 6729, checked in by martinvoosterhout, 12 years ago

Initial commit of the coastline checker. It's been used for a while now

  • Property svn:executable set to *
File size: 1.4 KB
1#!/bin/sh -xe
3export PERL5LIB="$HOME/perl/share/perl/5.8/:$HOME/perl/share/perl/5.8.8/:$HOME/perl/lib/perl/5.8.8"
4export TZ=UTC
5DATE=`date +%y%m%d`
7cd /home/kleptog
9# Extract any and all data relating to coastlines
10if [ planet/planet-$DATE.osm.gz -nt data/coastline.osm.gz ] ; then
11  nice ./osm2coast planet/planet-$DATE.osm.gz | gzip --rsyncable >data/coastline.osm.gz
13# Go through this file and combine the ways as much as possible
14nice ./ data/coastline.osm.gz >data/coast-merged.txt
15# Convert to shapefiles:
16# coastline_p  - points with errors
17# coastline_i  - incomplete sections of coastline
18# coastline_c  - complete sections
19LD_PRELOAD=$HOME/ nice ./coast2shp data/coast-merged.txt data/coastline.osm.gz data/coastline >/dev/null
20# divide the areas into 100km x 100km blocks and close them
21nice ./closeshp data/coastline_{c,i} data/processed >/dev/null
22# Make indexes
23nice shapeindex data/coastline_{c,i,p} data/processed_{p,i}
24# Copy over
25mv data/processed_* coastlines/
26mv data/coastline_p.* coastlines/
27# Reset the cache
28rm -rf /var/lib/tilecache/coastline-error/*
29find /var/lib/tilecache/coastline/ -depth -mindepth 2 -mmin +1500 -print0 |xargs -0 -r rm -r  # 36 hours
30rm -rf /var/lib/tilecache/coastline/0[01234]/*/*
31for i in coastline_p processed_{p,i} ; do
32  zip public_html/$ -p coastlines/$i.*
33  mv public_html/$ public_html/$
Note: See TracBrowser for help on using the repository browser.