Skip to content

Instantly share code, notes, and snippets.

OpenLayers.Util.QuickHull = (function() {
var buildConvexHull = function (baseLine, points, allBaseLines) {
var convexHullBaseLines = [],
maxDistance = 0,
maxPoint = [],
newPoints = [],
point, distance, i, vY, vX;
for (i = 0; i < points.length; i++) {
point = points[i];
vY = baseLine[1][0] - baseLine[0][0];
@neogis-de
neogis-de / xyz_vs_tms.md
Created October 16, 2015 10:34 — forked from tmcw/xyz_vs_tms.md
The difference between XYZ and TMS tiles and how to convert between them

The difference between XYZ and TMS tiles and how to convert between them

Lots of tile-based maps use either the XYZ or TMS scheme. These are the maps that have tiles ending in /0/0/0.png or something. Sometimes if it's a script, it'll look like &z=0&y=0&x=0 instead. Anyway, these are usually maps in Spherical Mercator.

Good examples are OpenStreetMap, Google Maps, MapBox, MapQuest, etc. Lots of maps.

Most of those are in XYZ. The best documentation for that is slippy map tilenames on the OSM Wiki, and Klokan's Tiles a la Google.

#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/
# run in the geoserver webapp dir:
cd geoserver/src/web/app/
# If you use SVN
rm -rf /tmp/release
svn export ../../../data/release/ /tmp/release/
mvn jetty:run -DGEOSERVER_DATA_DIR=/tmp/release/
# if you use git-svn
git clean -xdf -- ../../../data/release/
@neogis-de
neogis-de / proxy.php
Last active August 29, 2015 14:20 — forked from bmcbride/proxy.php
<?php
$ch = curl_init($_GET['url']);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$output = curl_exec($ch);
curl_close($ch);
echo $output;
?>
from PIL import Image
from PIL.ExifTags import TAGS, GPSTAGS
def get_exif_data(image):
"""Returns a dictionary from the exif data of an PIL Image item. Also converts the GPS Tags"""
exif_data = {}
info = image._getexif()
if info:
for tag, value in info.items():
decoded = TAGS.get(tag, tag)
ProxyRequests Off
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPass /geoserver http://localhost:8080/geoserver
ProxyPreserveHost On
ProxyStatus On
@neogis-de
neogis-de / voronoi.sql
Last active August 29, 2015 14:15 — forked from djq/voronoi.sql
/*
Feb 5, 2013
Original source from here: http://punkish.org/Voronoi-Diagrams-In-PostGIS
Updated old PostGIS function names to work with PostGIS2.0 (buffer, intersect, intersection and srid)
-djq
This function uses the deldir library in R to generate voronoi polygons for
an input set of points in a PostGIS table.
Original function by Mike Leahy mgleahy at alumni.uwaterloo.ca