Skip to content

Instantly share code, notes, and snippets.

View justb4's full-sized avatar

Just van den Broecke justb4

View GitHub Profile
@justb4
justb4 / test.html
Last active September 8, 2016 15:29 — forked from kdekooter/test.html
<html>
<head>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/proj4js/2.3.15/proj4.js"></script>
<script type="text/javascript" src="https://code.jquery.com/jquery-3.0.0.min.js"></script>
<script type="text/javascript">
var firstProjection = 'WGS84';
// See http://www.spatialreference.org/ref/epsg/28992/proj4/
// var secondProjection = '+proj=sterea +lat_0=52.15616055555555 +lon_0=5.38763888888889 +k=0.9999079 +x_0=155000 +y_0=463000 +ellps=bessel +units=m +no_defs';
var secondProjection = '+proj=sterea +lat_0=52.15616055555555 +lon_0=5.38763888888889 +k=0.9999079 +x_0=155000 +y_0=463000 +ellps=bessel +towgs84=565.417,50.3319,465.552,-\
@justb4
justb4 / imro1.sld
Created February 4, 2016 13:09
Test SLD IMRO
<?xml version="1.0" encoding="UTF-8" ?>
<sld:StyledLayerDescriptor version="1.0.0"
xmlns:sld="http://www.opengis.net/sld" xmlns:ogc="http://www.opengis.net/ogc"
xmlns:gml="http://www.opengis.net/gml"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:deegreeogc="http://www.deegree.org/ogc"
xmlns:app="http://www.deegree.org/app">
<sld:NamedLayer>
<sld:Name>BP:Bestemmingsplangebied</sld:Name>
<sld:LayerFeatureConstraints>
@justb4
justb4 / gist:f45de41856f3610e2869
Created October 18, 2015 14:08
Python: determine various dirs within executing script
import os,sys
print "CWD: ",os.getcwd()
print "Script: ",sys.argv[0]
print ".EXE: ",os.path.dirname(sys.executable)
print "Script dir: ", os.path.realpath(os.path.dirname(sys.argv[0]))
pathname, scriptname = os.path.split(sys.argv[0])
print "Relative script dir: ",pathname
print "Script dir: ", os.path.abspath(pathname)
@justb4
justb4 / postgis_schema_move.sql
Last active June 16, 2020 05:39
See http://justobjects.nl/moving-postgis-tables-from-the-public-schema-to-a-new-schema/ Instead of the default public schema where PostGIS and its meta-tables (geometry_columns and spatial_ref_sys) are installed one can use an explicit schema. One main reason, at least for me, is that PostgreSQL Schema’s allow me to make data dumps of the Schema…
-- Function to move all tables from old to new schema
CREATE OR REPLACE FUNCTION
public.postgis_schema_move(old_schema varchar(32),
new_schema varchar(32)) RETURNS void AS $$
DECLARE
row record;
BEGIN
FOR row IN SELECT tablename FROM pg_tables
WHERE schemaname = old_schema and tablename != 'spatial_ref_sys'
AND tablename != 'geometry_columns'