Install the server:
sudo apt-get install postgresql-9.1 postgresql-contrib-9.1 pgadmin3
Execute the psql command under user postgres
(sudo -u postgres)
and connect to database postgres
(psql postgres):
def translateAttributes(attrs): | |
if not attrs: | |
return | |
tags = {} | |
if int(attrs['SPD_PST']) > 0: | |
tags.update({'maxspeed':attrs['SPD_PST'] + ' mph'}) | |
if attrs['FULLNAME']: | |
tags.update({'name:fullname':attrs['FULLNAME'],'source:maxspeed':'sign' }) |
./configure \ | |
--with-local=yes \ | |
--prefix=/usr/local/gdal191 \ | |
--with-threads \ | |
--with-libtool \ | |
--with-libtiff=internal \ | |
--with-geotiff=internal \ | |
--with-pcraster=internal \ | |
--with-pcidsk=internal \ | |
--with-bsb \ |
# Install prerequisites before compiling: | |
apt-get install build-essential | |
apt-get install libfuse-dev | |
apt-get install fuse-utils | |
apt-get install libcurl4-openssl-dev | |
apt-get install libxml2-dev | |
apt-get install mime-support | |
# Download and Install | |
wget http://s3fs.googlecode.com/files/s3fs-1.61.tar.gz |
sudo mkdir -p /Library/Frameworks/GDAL.framework/Versions/1.9/ | |
sudo ln -s /usr/local/lib/libgdal.dylib /Library/Frameworks/GDAL.framework/Versions/1.9/GDAL | |
sudo mkdir -p /Library/Frameworks/PROJ.framework/Versions/4/ | |
sudo ln -s /usr/local/Cellar/proj/4.8.0/lib/libproj.dylib /Library/Frameworks/PROJ.framework/Versions/4/PROJ | |
# did not work: sudo ln -s `pwd`/libgeos.dylib /Library/Frameworks/GEOS.framework/Versions/3/GEOS | |
# did work: | |
# $PWD is /usr/local/Cellar/geos/3.3.6/lib | |
sudo ln -s `pwd`/libgeos_c.1.dylib /Library/Frameworks/GEOS.framework/Versions/3/GEOS | |
sudo mkdir -p /Library/Frameworks/SQLite3.framework/Versions/3/ | |
sudo ln -s /usr/local/Cellar/sqlite/3.7.15/lib/libsqlite3.0.8.6.dylib /Library/Frameworks/SQLite3.framework/Versions/3/SQLite3 |
import urllib2 | |
import datetime | |
def timeStamped(fname, fmt='%Y-%m-%d-%H-%M-%S_{fname}'): | |
return datetime.datetime.now().strftime(fmt).format(fname=fname) | |
url = 'https://web.fulcrumapp.com/shares/6e158acd08cacfad.csv' | |
u = urllib2.urlopen(url) | |
localFile = open('fulcrum_data.csv', 'w') | |
localFile.write(u.read()) | |
localFile.close() | |
with open(timeStamped('fulcrum_data.csv'),'w') as outf: |