Skip to content

Instantly share code, notes, and snippets.

View mvexel's full-sized avatar

Martijn van Exel mvexel

View GitHub Profile
@mvexel
mvexel / gist:2646988
Created May 9, 2012 17:31
Angle calculation in PostGIS
DROP TABLE IF EXISTS angletmp;
CREATE TABLE angletmp AS
WITH
intersections AS
(
SELECT
ST_Transform
(
(ST_Dump
(
@mvexel
mvexel / gist:2356599
Created April 11, 2012 03:09
problematic postgis query
SET search_path TO us,postgis,hstore;
DROP TABLE IF EXISTS candidates;
CREATE TABLE candidates AS
WITH agg_intersections AS
(
WITH intersection_nodes_wayrefs AS
(
WITH intersection_nodes AS
(
SELECT
@mvexel
mvexel / gist:2185839
Created March 24, 2012 18:19
osmosis JRE crash log
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00007fba2048fa3f, pid=24448, tid=140437278418688
#
# JRE version: 6.0_20-b20
# Java VM: OpenJDK 64-Bit Server VM (19.0-b09 mixed mode linux-amd64 compressed oops)
# Derivative: IcedTea6 1.9.13
# Distribution: Ubuntu 10.04.1 LTS, package 6b20-1.9.13-0ubuntu1~10.04.1
# Problematic frame:
@mvexel
mvexel / gist:2185826
Created March 24, 2012 18:17
osmosis crashes JRE
mvexel@lima$ osmosis --rb us.osm.pbf --wpd directory=/osm/tmp
Mar 24, 2012 12:11:51 PM org.openstreetmap.osmosis.core.Osmosis run
INFO: Osmosis Version 0.40.1
Mar 24, 2012 12:11:51 PM org.openstreetmap.osmosis.core.Osmosis run
INFO: Preparing pipeline.
Mar 24, 2012 12:11:51 PM org.openstreetmap.osmosis.core.Osmosis run
INFO: Launching pipeline execution.
Mar 24, 2012 12:11:51 PM org.openstreetmap.osmosis.core.Osmosis run
INFO: Pipeline executing, waiting for completion.
#
@mvexel
mvexel / nbi_osm_conflation_try1.txt
Created February 29, 2012 18:44
NBI <> OSM conflation first try
Query: select a.gid as nbi_id, a.facility_ca as nbi_name, a.route_numbe as nbi_ref, b.tags->'name' as osm_name, b.tags->'ref' as osm_ref from nbi_all_viaducts a, ways b where ST_Buffer(a.the_geom, 0.001) && b.linestring LIMIT 200;
nbi_id | nbi_name | nbi_ref | osm_name | osm_ref
--------+--------------------+---------+----------------------------+-------------------------
43993 | I-471 NC | 00471 | Daniel Carter Beard Bridge | I 471
43993 | I-471 NC | 00471 | Daniel Carter Beard Bridge | I 471
43994 | I-471 | 00471 | Daniel Carter Beard Bridge | I 471
43994 | I-471 | 00471 | Daniel Carter Beard Bridge | I 471
44019 | I-471 | 00471 | |
44019 | I-471 | 00471 | Daniel Carter Beard Bridge | I 471
@mvexel
mvexel / gist:1602882
Created January 12, 2012 20:21
draft us license email
Hi all,
The final phase of the license changeover to the Open Database
License[1] from our current CC-BY-SA is drawing near. From April 1[2],
current OpenStreetMap data will only be available under the new
license. This means that all data that was contributed by those who
did not agree to the new Contributor Terms (CT) will be removed by
then. Although the vast majority of contributors have agreed to the
CT, some 'tainted' data is jeopardy of being lost. Have a look at the
CleanMap[3] and Acceptance Statistics[4] tools to get a sense of what
@mvexel
mvexel / gist:1602876
Created January 12, 2012 20:21
draft license change email
Hi all,
The final phase of the license changeover to the Open Database License[1] from our current CC-BY-SA is drawing near. From April 1[2], current OpenStreetMap data will only be available under the new license. This means that all data that was contributed by those who did not agree to the new Contributor Terms (CT) will be removed by then. Although the vast majority of contributors have agreed to the CT, some 'tainted' data is jeopardy of being lost. Have a look at the CleanMap[3] and Acceptance Statistics[4] tools to get a sense of what we're talking about. There's even significant stretches of interstate among the jeopardized data.
There are several things we can do together to minimize the data loss and ensure a smooth changeover to the new license:
* Contact mappers who have declined or not agreed yet. Use the OSM Inspektor[5] to identify those users in your area and contact them using the messaging function on the OSM web site. I'd highly recommend to start doing that first. Mappers who are no l