This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
from shapely.geometry import Polygon | |
polygon = Polygon([(0, 0), (1, 1), (1, 0)]) | |
#print polygon.bounds | |
print "Areal før buffer: " , polygon.area | |
polygon2 = polygon.buffer(10) | |
print "Areal etter buffer: " , polygon2.area |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import pyproj | |
# Point | |
lon = 10 | |
lat = 60 | |
# Projections | |
fromProj = pyproj.Proj(init='epsg:4258') | |
toProj = pyproj.Proj(init='epsg:25832') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
from osgeo import gdal | |
# Read raster | |
source = gdal.Open('raster.tif') | |
nx, ny = source.RasterXSize, source.RasterYSize | |
band_array = source.GetRasterBand(1).ReadAsArray() | |
# Close raster | |
source = None |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
from fiona import collection | |
#c = collection("test.shp", "r") | |
#print "Projeksjon: " , c.crs | |
#print "Bounding box: " , c.bounds | |
#rec = c.next() | |
#print rec['properties']['AREAL'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.conf import settings | |
# Cache location set to file | |
CACHES = { | |
'default': { | |
'BACKEND': 'django.core.cache.backends.filebased.FileBasedCache', | |
'LOCATION': '/tmp/waymarkedtrails-cache', | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"units": "m", | |
"srs": "EPSG:32633", | |
"layout": "Normal(A4)", | |
"dpi": 60, | |
"layers": [{ | |
"type": "Vector", | |
"styles": { | |
"1": { | |
"fillColor": "orange", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Open a DEM, do a gaussian blur, then save it again | |
# Heavily based on: | |
# http://gis.stackexchange.com/questions/9431/what-raster-smoothing-generalization-tools-are-available | |
# | |
# Syntax for running snippet: | |
# python smoothDem.py input.tif output.tif 5 | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Leaflet example code</title> | |
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no' /> | |
<link href='http://api.tiles.mapbox.com/mapbox.js/v1.6.0/mapbox.css' rel='stylesheet' /> | |
<script src='http://api.tiles.mapbox.com/mapbox.js/v1.6.0/mapbox.js'></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="initial-scale=1,user-scalable=no,maximum-scale=1,width=device-width"> | |
<meta name="mobile-web-app-capable" content="yes"> | |
<meta name="apple-mobile-web-app-capable" content="yes"> | |
<meta name="description" content=""> | |
<meta name="author" content=""> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<script src='//api.tiles.mapbox.com/mapbox.js/v1.6.1/mapbox.js'></script> | |
<link href='//api.tiles.mapbox.com/mapbox.js/v1.6.1/mapbox.css' rel='stylesheet' /> | |
<script src='//api.tiles.mapbox.com/mapbox.js/plugins/leaflet-image/v0.0.3/leaflet-image.js'></script> | |
<script src='//api.tiles.mapbox.com/mapbox.js/plugins/leaflet-image/v0.0.3/leaflet-image.js'></script> | |
<style type="text/css"> | |
html, |
OlderNewer