This example belongs to the presentation made to the OSGeo local group in Barcelona Geoinquiets The example is an adaptation from Mike Bostock's Symbol Map example
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
public static class PasswordHelper | |
{ | |
public static readonly DependencyProperty PasswordProperty = | |
DependencyProperty.RegisterAttached("Password", | |
typeof(string), typeof(PasswordHelper), | |
new FrameworkPropertyMetadata(string.Empty, OnPasswordPropertyChanged)); | |
public static readonly DependencyProperty AttachProperty = | |
DependencyProperty.RegisterAttached("Attach", | |
typeof(bool), typeof(PasswordHelper), new PropertyMetadata(false, Attach)); |
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 custom projection example</title> | |
<meta charset="utf-8" /> | |
<link rel="stylesheet" href="//cdn.leafletjs.com/leaflet-0.7/leaflet.css" /> | |
<script src="//cdn.leafletjs.com/leaflet-0.7/leaflet-src.js"></script> | |
<script src="//cdnjs.cloudflare.com/ajax/libs/proj4js/2.0.0/proj4.js"></script> | |
<script src="//mapserv.utah.gov/cdn/examples/proj4leaflet.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> | |
<head> | |
<title>ESRI Leaflet Dynamic Map Layer With Map Tiles</title> | |
<meta charset="utf-8" /> | |
<link | |
rel="stylesheet" | |
href="http://cdn.leafletjs.com/leaflet-0.7/leaflet.css" | |
/> | |
</head> |
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
//Let's assume you read pixels of a band with width x height dimensions: | |
byte[] bits = new byte[width * height]; | |
band.ReadRaster(0, 0, width, height, bits, width, height, 0, 0); | |
//Now, you can calculate index of a pixel according to this formula: column + row * width | |
for (int col = 0; col < width; col++) | |
{ | |
for (int row = 0; row < height; row++) |
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
function distance(obj) { | |
var R = 6371; // km | |
var dLat = (obj.lat2 - obj.lat1) * Math.PI / 180; | |
var dLon = (obj.lon2 - obj.lon1) * Math.PI / 180; | |
var lat1 = obj.lat1 * Math.PI / 180; | |
var lat2 = obj.lat2 * Math.PI / 180; | |
var a = Math.sin(dLat/2) * Math.sin(dLat/2) + | |
Math.sin(dLon/2) * Math.sin(dLon/2) * Math.cos(lat1) * Math.cos(lat2); | |
var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a)); |
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
import httplib | |
from urlparse import urlparse | |
def checkUrl(url): | |
p = urlparse(url) | |
conn = httplib.HTTPConnection(p.netloc) | |
conn.request('HEAD', p.path) | |
resp = conn.getresponse() | |
return resp.status < 400 |
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
{ | |
"name" : "", | |
"children" : | |
[ | |
{ | |
"name" : "Softwoods", | |
"children" : | |
[ | |
{ | |
"order" : 1, |
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
{ | |
"name" : "", | |
"children" : | |
[ | |
{ | |
"name" : "Softwoods", | |
"children" : | |
[ | |
{ | |
"order" : 1, |
Simplest way to add pan/zoom to a d3js visualisation
NewerOlder