Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
SpatialDev - vector tiling fra PostGIS
#!/usr/bin/env bash
sudo apt-get update
sudo apt-get -y install python-software-properties build-essential curl
#echo -e "${COLOR}--- Installing PHP5 ---${COLOR_RST}"
#sudo apt-get install -y php5 php5-curl
#sudo apt-get install -y libapache2-mod-php5
echo -e "${COLOR}--- Installing PGRestAPI ---${COLOR_RST}"
sudo apt-get update
sudo apt-get upgrade
sudo apt-get -y install g++ curl libssl-dev apache2-utils git-core
sudo apt-get -y install make
sudo apt-add-repository -y ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get -y install nodejs
sudo add-apt-repository -y ppa:mapnik/nightly-2.3
sudo apt-get update
sudo apt-get -y install libmapnik libmapnik-dev mapnik-utils python-mapnik
# also install datasource plugins if you need them
sudo apt-get -y install mapnik-input-plugin-gdal
sudo apt-get -y install mapnik-input-plugin-postgis
cd /home/vagrant
git clone
cd PGRestAPI
sudo npm install
##Change settings in /settings/settings.js
ln -s /home/vagrant/PGRestAPI/settings/settings.js /vagrant/settings.js
sudo locale-gen UTF-8
sudo locale-gen en_US en_US.UTF-8
sudo dpkg-reconfigure locales
export LC_ALL="en_US.UTF-8"
#start with:
#sudo node app.js
//Settings.js is not part of the repository. However, it should be deployed with the application and contain deployment-specific settings.
//there is a settings.js.example file that should match the structure and properties of this file that IS checked in to the repo.
var settings = {} = {};
settings.application = {};
settings.tilestream = {};
//application port settings
settings.application.port = 3001;
//settings.application.ip = "localhost"; //Typically localhost. If deploying on Amazon EC2 Ubuntu, comment out this line.
//SSL Settings
//settings.ssl = {};
//settings.ssl.pfx = 'mypfx.pfx';
//settings.ssl.password = 'foo';
//Settings for postgres DB = 'username'; = 'password'; = 'XXX.XX.XXX.XXX'; = '5432'; = 'dbname'; = 1000; //how many features to return by default
//settings.otherSchemas = ['sandbox']; //Optionally list postgres schemas other than 'public' to read
//Should the API display postgres views?
settings.displayViews = false;
//Should the API display postgres tables?
settings.displayTables = true;
//Should the API hide any postgres tables or views? = ["att_0"];
//The list of formats to be returned by the Table Query REST endpoint. If ogr2ogr is installed, .shp will be added automatically.
settings.application.formatList =[ 'html', 'GeoJSON', 'esriJSON'];
//Where to write out GeoJSON files?
settings.application.geoJsonOutputFolder = "/public/geojson/output/";
//Optional. If you're using port forwarding or URL rewriting, but need to display full URLs to your assets, this will stand in for the host.
settings.application.publichost = ""; //like Keep this empty if you want to use the default host
settings.application.publicport = "80";
//Epxress Session Secret
settings.epxressSessionSecret = "secret";
//MongoDB Authentication
settings.mongodb = {};
settings.mongodb.db = "mongodb://localhost/authentication";
//Facebook App ID
settings.facebook = {};
settings.facebook.appid = "12345";
settings.facebook.secret = "secret";
//Leaflet version reference
settings.leaflet = {};
settings.leaflet.js = '';
settings.leaflet.css = '';
settings.jquery = {};
settings.jquery.js = '';
// For middleware that checks the referrer header of incoming requests
settings.acceptableReferrers = [];
settings.referrerCheckHints = [];
module.exports = settings;
-- Alle tabeller må være i 4326 og VACUUM ANALYZED og registrert som geometritabeller i PostGIS
--registrere som postgis-geometri med srid
select updategeometrysrid('vector_n50_adminflate','geometri',3857)
--transformere til 4326
ALTER TABLE public.md_friluftomr
ALTER COLUMN wkb_geometry TYPE geometry(geometry,4326) USING ST_Transform(wkb_geometry,4326);
--kjører på hele databasen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment