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 boto3 | |
def download_naips(self): | |
s3_client = boto3.client('s3') | |
filename = 'm_3807708_ne_18_1_20130924.tif' | |
s3_client.download_file('aws-naip', 'md/2013/1m/rgbir/38077/{}'.format(filename), filename, {'RequestPayer':'requester'}) |
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 | |
############################################################################### | |
# $Id$ | |
# | |
# Project: GDAL2Tiles, Google Summer of Code 2007 & 2008 | |
# Global Map Tiles Classes | |
# Purpose: Convert a raster into TMS tiles, create KML SuperOverlay EPSG:4326, | |
# generate a simple HTML viewers based on Google Maps and OpenLayers | |
# Author: Klokan Petr Pridal, klokan at klokan dot cz | |
# Web: http://www.klokan.cz/projects/gdal2tiles/ |
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/local/bin/python | |
import sys | |
import urllib | |
''' | |
make a URL that imports a TMS map source into Gaia GPS | |
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
on run {input, parameters} | |
tell application "Terminal" | |
set currentTab to do script ("ps ax | grep jekyll | grep -v grep | awk '{ print $1 }' | xargs kill") in front window | |
set currentTab to do script ("jekyll serve --detach;") in front window | |
end tell | |
tell application "Google Chrome" | |
activate | |
set theUrl to "http://0.0.0.0:4000/" | |
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
double latitude = self.mapView.mapCenter.latitude; | |
metersPerPixel *= cos(latitude * (M_PI / 180)); | |
double metersPerUnit = 1609.344; | |
int numberOfUnits = 1; | |
NSString *unitName = MILES_UNIT_STRING; | |
if (metersPerPixel < (1000/maxScaleSize)) { | |
unitName = METERS_UNIT_STRING; | |
metersPerUnit = 1; | |
} else { | |
unitName = KILOMETERS_UNIT_STRING; |
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
def get_point_photos(request, lat, lon, name): | |
'''takes a lat lon pair via an ajax request, and returns a list of photos''' | |
#create a Flickr API object | |
f = flickrapi.FlickrAPI(api_key) | |
#resolve a (lat,long) to a "Flickr Place" which can be used to search for photos. | |
place = f.places_findByLatLon(api_key = api_key, lat=lat, lon = lon) | |
#get the id of the Flickr Place returned | |
place_id = place.find('places').findall('place')[0].attrib['place_id'] | |
#returns an XML response that contains data to construct photo URLs | |
flickr_search = f.photos_search(api_key = api_key, place_id = place_id, content_type = '1', tags = 'nature, landscape, hiking, outdoors, |
NewerOlder