This file contains hidden or 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
{ | |
"_id":"0-12736", | |
"_rev":"1-b5615b9a2648d5518be35c9e2d47c42a", | |
"b":[ | |
[ | |
"-180", | |
"-16.1333333" | |
], | |
[ | |
"-179.9912754", |
This file contains hidden or 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
{ | |
"url": "http://www.cellmapper.net/api/v2/json.php?action=getTowers&data[MCC]=202&data[MNC]=1&data[LAC]=1002" | |
"action":"getTowers", | |
"data":[ | |
{ | |
"base":"33", | |
"visible":1, | |
"latitude":37.945139540016, | |
"longitude":23.658307831007 | |
}, |
This file contains hidden or 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
{ | |
"layers":{ | |
"0":{ | |
"name":"Perdix concolor", | |
"source":"aaron", | |
"type":"ecoregion" | |
}, | |
"1":{ | |
"name":"Perdix hodgsoniae", | |
"source":"cody", |
This file contains hidden or 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 subprocess | |
import shlex | |
import glob | |
command = "gdal_translate -of GTiff %s %s.tif" | |
for bil in glob.glob('*.bil'): | |
subprocess.call(shlex.split(command % (bil, bil))) |
This file contains hidden or 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
SELECT rid, band, (stats).* FROM (SELECT rid, band, ST_SummaryStats(rast, band) As stats FROM bioclim10_29 CROSS JOIN generate_series(1,3) As band WHERE rid=2) As foo; |
This file contains hidden or 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
# Rename .dbf file temporarily | |
dbf_filename = '%s.dbf' % sf | |
dbf_filename_temp = '%s~' % dbf_filename_temp | |
os.rename(dbf_filename, dbf_filename_temp) | |
# Create the .dbf blank (it has no fields) | |
w = shapefile.Writer(shapefile.POLYGONM) | |
w.poly(parts=[[[1,5],[5,5],[5,1],[3,3],[1,1]]]) | |
w.save(dbf_filename) |
This file contains hidden or 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 | |
import csv | |
import tempfile | |
def generator(reader): | |
"""Generates dictionaries from a DictReader that contain only 'a' and 'b' keys.""" | |
cols = ['a', 'b'] | |
for row in reader: | |
yield dict((key,val) for key,val in row.iteritems() if key in cols) |
This file contains hidden or 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
# npm install mapnik | |
> [email protected] install /usr/local/src/Windshaft/node_modules/mapnik | |
> node-waf -v configure build | |
Setting srcdir to : /usr/local/src/Windshaft/node_modules/mapnik | |
Setting blddir to : /usr/local/src/Windshaft/node_modules/mapnik/build | |
Checking for program g++ or c++ : /usr/bin/g++ | |
Checking for program cpp : /usr/bin/cpp | |
Checking for program ar : /usr/bin/ar |
This file contains hidden or 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 Windshaft = require('../lib/windshaft'), | |
config = { | |
base_url: '/database/:dbname/table/:table', | |
req2params: function(req, callback) | |
{ | |
req.params.geom_type = 'multipolygon'; | |
callback(null, req); | |
}, | |
grainstore: { | |
datasource: { |
This file contains hidden or 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
<PAMDataset> | |
<Metadata/> | |
<Metadata domain="ESRI"> | |
<MDI key="PyramidResamplingType">NEAREST</MDI> | |
</Metadata> | |
<PAMRasterBand band="1"> | |
<Histograms> | |
<HistItem> | |
<HistMin>-0.5</HistMin> | |
<HistMax>255.5</HistMax> |