View countTiles.py
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
#!/usr/bin/python | |
# This script should be considered CC0 licensed | |
# the deg2num function is from http://wiki.openstreetmap.org/wiki/Slippy_map_tilenames#lon.2Flat_to_tile_numbers_2 | |
import math | |
def deg2num(lat_deg, lon_deg, zoom): | |
lat_rad = math.radians(lat_deg) | |
n = 2.0 ** zoom | |
xtile = int((lon_deg + 180.0) / 360.0 * n) |
View dict_zip
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
var keys = ['AB', 'CD', 'EF', 'GH']; | |
var values = [1, 2, 3, 4]; | |
// Equivalent to python dict(zip(['AB', 'CD', 'EF', 'GH'],[1, 2, 3, 4])) in javascript | |
function dictZip(key_array, val_array) { | |
if (key_array.length === val_array.length) { | |
return key_array.reduce((acc, curr, index) => { | |
acc[curr] = val_array[index]; | |
return acc; | |
}, {}); |
View get_ortho_nantes.py
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
#!/usr/bin/env python | |
# -*- coding: UTF-8 -*- | |
import requests, re, os | |
def download_file(url, fileName=None): | |
def getFileName(url, req): | |
h = req.headers | |
file = None; | |
if h.has_key("content-disposition") and h.get("content-disposition")!= None and 'filename=' in h.get("content-disposition"): |
View liste_ortho_nantes_2005.txt
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
http://data.nantes.fr/fileadmin/data/datastore/3-publication/_orthophoto_/nantesmetropole_ortho_2005_1327_6243.zip | |
http://data.nantes.fr/fileadmin/data/datastore/3-publication/_orthophoto_/nantesmetropole_ortho_2005_1328_6242.zip | |
http://data.nantes.fr/fileadmin/data/datastore/3-publication/_orthophoto_/nantesmetropole_ortho_2005_1328_6243.zip | |
http://data.nantes.fr/fileadmin/data/datastore/3-publication/_orthophoto_/nantesmetropole_ortho_2005_1328_6244.zip | |
http://data.nantes.fr/fileadmin/data/datastore/3-publication/_orthophoto_/nantesmetropole_ortho_2005_1329_6241.zip | |
http://data.nantes.fr/fileadmin/data/datastore/3-publication/_orthophoto_/nantesmetropole_ortho_2005_1329_6242.zip | |
http://data.nantes.fr/fileadmin/data/datastore/3-publication/_orthophoto_/nantesmetropole_ortho_2005_1329_6243.zip | |
http://data.nantes.fr/fileadmin/data/datastore/3-publication/_orthophoto_/nantesmetropole_ortho_2005_1329_6244.zip | |
http://data.nantes.fr/fileadmin/data/datastore/3-publication/_orthophoto_/nantesmetropole_ortho_2005_133 |
View postgis_geojson.php
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
<?php | |
header('Content-Type: application/json; charset=UTF-8'); | |
/** | |
* PostGIS to GeoJSON | |
* Query a PostGIS table or view and return the results in GeoJSON format, suitable for use in OpenLayers, Leaflet, etc. | |
* | |
* @param string $geotable The PostGIS layer name *REQUIRED* | |
* @param string $geomfield The PostGIS geometry field *REQUIRED* | |
* @param string $srid The SRID of the returned GeoJSON *OPTIONAL (If omitted, EPSG: 4326 will be used)* | |
* @param string $fields Fields to be returned *OPTIONAL (If omitted, all fields will be returned)* NOTE- Uppercase field names should be wrapped in double quotes |
View index.html
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> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"> | |
<meta name="apple-mobile-web-app-capable" content="yes"> | |
<title>OpenLayers Basic OSM Example with zoom level display</title> | |
<link rel="stylesheet" href="http://www.openlayers.org/dev/theme/default/style.css" type="text/css"> | |
<link rel="stylesheet" href="http://www.openlayers.org/dev/examples/style.css" type="text/css"> | |
<style> |
View rename_invalid_characters_linux.sh
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
## Reminder to deal with renaming invalid UTF8 characters (if you are using latin-1 also called iso-8859-1) | |
## Sources: http://unix.stackexchange.com/questions/6460/bulk-rename-or-correctly-display-files-with-special-characters | |
## To use it, do a chmod +x rename_invalid_characters_linux.sh; and after do ./rename_invalid_characters_linux.sh your_dir_where_you_want_to_scan_and_rename | |
# First command to add | |
grep-invalid-utf8 () { | |
perl -l -ne '/^([\000-\177]|[\300-\337][\200-\277]|[\340-\357][\200-\277]{2}|[\360-\367][\200-\277]{3}|[\370-\373][\200-\277]{4}|[\374-\375][\200-\277]{5})*$/ or print' | |
} |
View dem_eu
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
http://published-files.eea.europa.eu/eudem/jrc_r_3035_25_m_gsgrda-eudem-dem-europe_2012_rev1/eudem_tiles_1000km/EUD_CP-DEMS_2500015000-AA.tif | |
http://published-files.eea.europa.eu/eudem/jrc_r_3035_25_m_gsgrda-eudem-dem-europe_2012_rev1/eudem_tiles_1000km/EUD_CP-DEMS_2500025000-AA.tif | |
http://published-files.eea.europa.eu/eudem/jrc_r_3035_25_m_gsgrda-eudem-dem-europe_2012_rev1/eudem_tiles_1000km/EUD_CP-DEMS_2500035000-AA.tif | |
http://published-files.eea.europa.eu/eudem/jrc_r_3035_25_m_gsgrda-eudem-dem-europe_2012_rev1/eudem_tiles_1000km/EUD_CP-DEMS_2500045000-AA.tif | |
http://published-files.eea.europa.eu/eudem/jrc_r_3035_25_m_gsgrda-eudem-dem-europe_2012_rev1/eudem_tiles_1000km/EUD_CP-DEMS_2500055000-AA.tif | |
http://published-files.eea.europa.eu/eudem/jrc_r_3035_25_m_gsgrda-eudem-dem-europe_2012_rev1/eudem_tiles_1000km/EUD_CP-DEMS_3500015000-AA.tif | |
http://published-files.eea.europa.eu/eudem/jrc_r_3035_25_m_gsgrda-eudem-dem-europe_2012_rev1/eudem_tiles_1000km/EUD_CP-DEMS_7500015000-AA.tif | |
http://published-files.eea.eur |
View index.html
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="chrome=1"> | |
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width"> | |
<title>proj4js v2 example </title> | |
</head> | |
<body> | |
<script src="//cdnjs.cloudflare.com/ajax/libs/proj4js/2.2.2/proj4.js" type="text/javascript"></script> |
View shapely_benchmarks.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
OlderNewer