Skip to content

Instantly share code, notes, and snippets.

View alexanno's full-sized avatar

Alexander Salveson Nossum alexanno

View GitHub Profile
wget --keep-session-cookies --save-cookies cookies.txt --post-data 'name={USERNAME}&pass={PASSWORD}&form_build_id=form-NaPSEn1C_qDxG4CVz3n0wf5wis4cZuSin2WrZJr68xY&form_id=user_login_block&op=Logg%20inn' http://data.kartverket.no/download/content/velkommen?destination=node/134
wget --load-cookies cookies.txt http://data.kartverket.no/download/mine/downloads
grep -o "http://data.kartverket.no/download/system/files/terrengdata/10m/utm33/Terrengdata.*zip" downloads > dllist
wget --load-cookies cookies.txt -i dllist
@alexanno
alexanno / FOSS4G-PDX-Notater.md
Last active August 29, 2015 14:06
FOSS4G-PDX-Notater
  • Portland:
    • Bryggerier og tap rooms overalt
    • Universitetsby
    • Kulturell/kunstnerisk
  • Animasjon
    • OL3, Mapbox GL, Leaflet continuous zoom, Torque.js/CartoDB
    • Klient-rendring
    • 3D
    • Cesium: kraftig og modent
  • OL3: 1.0
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
find ./ -name \*Elveg.SOS -execdir echo "ogr2ogr -update -append -f PostgreSQL PG:'host=localhost port=54321 dbname=sandbox user=postgres active_schema=sandbox' -progress -nln elveg {}" \;
find ./ -name \*Adresser.SOS -execdir ogr2ogr -update -append -f PostgreSQL PG:'host=localhost port=54321 dbname=sandbox user=postgres active_schema=sandbox' -progress -nln adresser {} \;
####################################################
#using shp2pgsql
#!/bin/bash
for f in *.shp
do
set search_path to "sandbox","public";
DROP VIEW IF EXISTS grid_test_001;
CREATE VIEW grid_test_001 as (
SELECT g.gid, g.the_geom, count(*) FROM hex_grid_001 g
JOIN n1000_turisthytte p
ON g.the_geom && st_transform(p.wkb_geometry,4326)
GROUP BY g.gid, g.the_geom
);
CREATE TABLE sandbox.t_grid_n1000_byggpkt_0125 AS
#!/usr/bin/env bash
COLOR="\033[;35m"
COLOR_RST="\033[0m"
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 php5-pgsql
READHOST=***
READUSER=***
READPASSWORD=***
WRITEHOST=***
WRITEPASSWORD=***
WRITEUSER=***
## vars need integration in commands with ex: host=$READHOST
ogr2ogr --config PG_USE_COPY YES -f GeoJSON testsql.geojson PG:'host=localhost dbname=alexanno user=alexanno' -progress -sql "SELECT * FROM sandbox.kommuner" -lco COORDINATE_PRECISION=5
@alexanno
alexanno / printing_python_qgis.py
Created March 8, 2015 07:32
Printing with Python and QGIS
#http://kartoza.com/how-to-create-a-qgis-pdf-report-with-a-few-lines-of-python/
# coding=utf-8
# A simple demonstration of to generate a PDF using a QGIS project
# and a QGIS layout template.
#
# This code is public domain, use if for any purpose you see fit.
# Tim Sutton 2015