Bryan McBride bmcbride

View geojson-length.py
1 2 3 4 5 6 7 8 9 10
from osgeo import ogr
from osgeo import osr
 
source = osr.SpatialReference()
source.ImportFromEPSG(4326)
 
target = osr.SpatialReference()
target.ImportFromEPSG(3857)
 
transform = osr.CoordinateTransformation(source, target)
View routeshoot-kml-to-srt.py
1 2 3 4 5 6 7 8 9 10
import xml.etree.ElementTree as ET
 
metric = 0
kml = raw_input('Enter the KML file path and name: ')
srt = kml.replace('.kml', '.srt');
file = open(srt, 'w')
 
if metric == 1:
speedUnits = '(km/h)'
altitudeUnits = '(m)'
View fulcrum-get-records.py
1 2 3 4 5 6 7 8 9
import sys
import json
from fulcrum import Fulcrum
 
api_key = 'your_api_key'
form_id = 'your_form_id'
 
if api_key == '' or api_key == 'your_api_key' or form_id == '' or form_id == 'your_form_id':
sys.exit('api_key and form_id are required!')
View fulcrum-delete-all-records.py
1 2 3 4 5 6 7 8 9 10
import sys
from fulcrum import Fulcrum
 
api_key = 'your_api_key'
form_id = 'your_form_id'
 
if api_key == '' or api_key == 'your_api_key' or form_id == '' or form_id == 'your_form_id':
sys.exit('api_key and form_id are required!')
 
fulcrum = Fulcrum(key=api_key)
View fulcrum-device-delete-webhook.php
1 2 3 4 5 6 7 8 9 10
<?php
# Fulcrum Info
$form_id = 'my_form_id'; // Get from App URL: https://web.fulcrumapp.com/data/{my_form_id}#
$fulcrum_api_key = 'my_fulcrum_api_key'; // Get from Fulcrum settings page
 
//$input = file_get_contents('payload.json'); # local file for testing
$input = file_get_contents('php://input'); # POST data from webhook
$data = json_decode($input, TRUE);
 
# Make sure it's the form we want
View fulcrum-cartodb-webhook.php
1 2 3 4 5 6 7 8 9
<?php
# CartoDB Info
$cartodb_username = 'your-cartodb-username-goes-here';
$cartodb_api_key = 'your-cartodb-api-key-goes-here';
$table = 'your-cartodb-table-goes-here';
 
# Fulcrum Info
$form_id = 'your-fulcrum-form-id-goes-here';
$fulcrum_api_key = 'your-fulcrum-api-key-goes-here';
View gdal.txt
1 2 3 4 5 6 7 8 9 10
SINGLE FILE CONVERT
gdal_translate input_nysdop_ortho.jp2 output.tif -b 1 -b 2 -b 3 -mask 4 -co COMPRESS=JPEG -co JPEG_QUALITY=25 -co PHOTOMETRIC=YCBCR --config GDAL_TIFF_INTERNAL_MASK YES -a_srs EPSG:2260
 
BATCH CONVERT
for /r %g in (*.jp2) do gdal_translate -of GTiff "%g" "%~dpng.tif" -b 1 -b 2 -b 3 -mask 4 -co COMPRESS=JPEG -co JPEG_QUALITY=25 -co PHOTOMETRIC=YCBCR --config GDAL_TIFF_INTERNAL_MASK YES -a_srs EPSG:2260
 
BUILT VIRTUAL RASTER (CATALOG)
gdalbuildvrt catalog.vrt e_06811416_06_05000_4bd_2011.jp2 e_06811414_06_05000_4bd_2011.jp2 e_06781416_06_05000_4bd_2011.jp2 e_06781414_06_05000_4bd_2011.jp2
 
gdalbuildvrt -allow_projection_difference -hidenodata -vrtnodata "255 255 255" nysdop.vrt *.jp2 -a_srs EPSG:2260
View ImageMagick
1
convert glyphicons_195_circle_info.png -fuzz 100% -fill "rgb(187,187,187)" -opaque black glyphicons_195_circle_info-gray.png
View proxy.php
1 2 3 4 5 6 7 8
<?php
$ch = curl_init($_GET['url']);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$output = curl_exec($ch);
curl_close($ch);
echo $output;
?>
View ogr2ogr.txt
1
ogr2ogr -update -append -f SQLite mydb.sqlite -nln "newtable" -a_srs "EPSG:4326" shapefile.shp
Something went wrong with that request. Please try again.