Skip to content

Instantly share code, notes, and snippets.

View timwaters's full-sized avatar
💭
Set your status

Tim Waters timwaters

💭
Set your status
View GitHub Profile
gdalinfo IRL-DUB-22-1937-_Rathfarnham.tif
Driver: GTiff/GeoTIFF
Files: IRL-DUB-22-1937-_Rathfarnham.tif
Size is 12337, 10629
Coordinate System is `'
Metadata:
TIFFTAG_DATETIME=2016:03:30 18:29:24
TIFFTAG_DOCUMENTNAME=IRL-DUB-22-1937-_Rathfarnham.tif
TIFFTAG_RESOLUTIONUNIT=2 (pixels/inch)
TIFFTAG_SOFTWARE=Microsoft Windows Photo Viewer 10.0.10586.0
import os
import sys
from osgeo import gdal, ogr, osr
sr_wkt = 'LOCAL_CS["arbitrary"]'
sr = osr.SpatialReference( sr_wkt )
geotiff_filename = "treasure_island.tif"
ds = gdal.Open(geotiff_filename, gdal.GA_Update)

#Wikmaps Warper API Documentation

** Note: This has Wikimaps specific implementation details, for interacting with Wikimedia Commons as an image repository, and so will differ with the standard mapwarper.net API. http://warper.wmflabs.org

Welcome to the documentation for the Wikimaps Warper API! MapWarper is a free application that assigns the proper geographic coordinates to scanned maps in image formats. Users can upload images, then assign ground control points to match them up with a base map. Once MapWarper warps or stretches the image to match the corresponding extent of the base map, it can be aligned and displayed with other maps, and used for digital geographic analysis. You can access all of the functionality through the API.

##Table of Contents

API Endpoint
Format

https://commons.wikimedia.org/w/api.php?action=query&prop=imageinfo&iiprop=url&iiurlwidth=100&iiurlheight=100&pageids=45223047
https://upload.wikimedia.org/wikipedia/commons/thumb/3/3c/12_Plane-Table_Sheets_Covering_Whole_Length_of_Original_Frontier_from_L._Tanganyika_to_Uganda_%26_Extension_South_to_Kigoma._-_War_Office_ledger._%28WOOS-4-1-11%29.jpg/86px-thumbnail.jpg
https://commons.wikimedia.org/w/api.php?action=query&prop=imageinfo&iiprop=url&iiurlwidth=100&iiurlheight=100&pageids=45222398
https://upload.wikimedia.org/wikipedia/commons/thumb/1/1b/12_Plane-Table_Sheets_Covering_Whole_Length_of_Original_Frontier_from_L._Tanganyika_to_Uganda_%26_Extension_South_to_Kigoma._-_War_Office_ledger._%28WOOS-4-1-8%29.jpg/81px-12_Plane-Table_Sheets_Covering_Whole_Length_of_Original_Frontier_from_L._Tanganyika_to_Uganda_%26_Extension_South_to_Kigoma._-_War_Office_ledger._%28WOOS-4-1-8%29.jpg

Keybase proof

I hereby claim:

  • I am timwaters on github.
  • I am timwaters (https://keybase.io/timwaters) on keybase.
  • I have a public key whose fingerprint is BA0F 07D7 3062 F7C9 7AA1 9A75 D75E 86BF 4786 F7F7

To claim this, I am signing this object:

http://overpass-api.de/api/interpreter?data=[out%3Ajson]%3B%20%0Aarea%20%0A%20%20[%22boundary%22%3D%22administrative%22]%0A%20%20[%22name%22%3D%22%D0%98%D1%81%D1%82%D1%80%D0%B8%D0%BD%D1%81%D0%BA%D0%B8%D0%B9%20%D1%80%D0%B0%D0%B9%D0%BE%D0%BD%22]%0A%20%20-%3E.a%3B%20%0Aout%20body%20qt%3B%20%0A%28relation%28area.a%29%20[%22admin_level%22%3D%228%22]%3B%29%3B%20%0Aout%20body%20qt%3B%20%0A%3E%3B%20%0Aout%20skel%20qt%3B
http://overpass.openhistoricalmap.org/api//interpreter?data=%2F*%0AThis%20has%20been%20generated%20by%20the%20overpass-turbo%20wizard.%0AThe%20original%20search%20was%3A%0A%E2%80%9Chighway%3D*%20and%20type%3Away%E2%80%9D%0A*%2F%0A[out%3Ajson][timeout%3A25]%3B%0A%2F%2F%20gather%20results%0A%28%0A%20%20%2F%2F%20query%20part%20for%3A%20%E2%80%9Chighway%3D*%E2%80%9D%0A%20%20way[%22highway%22]%2850.74253872133164%2C-1.6280364990234373%2C51.132400312945464%2C-0.90362548828125%29%3B%0A%29%3B%0A%2F%2F%20print%20results%0Aout%20body%3B%0A%3E%3B%0Aout%20skel%20qt%3B
tail -f log/test.log -n 1000
ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
(0.2ms) begin transaction
SQL (0.4ms) INSERT INTO "articles" ("title", "text", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["title", "first"], ["text", "text stuff"], ["created_at", "2015-06-01 18:44:00.613696"], ["updated_at", "2015-06-01 18:44:00.613696"]]
SQL (0.3ms) INSERT INTO "versions" ("event", "created_at", "item_id", "item_type") VALUES (?, ?, ?, ?) [["event", "create"], ["created_at", "2015-06-01 18:44:00.613696"], ["item_id", 980191009], ["item_type", "Article"]]
SQL (0.4ms) UPDATE "versions" SET "transaction_id" = ? WHERE "versions"."id" = ? [["transaction_id", 213], ["id", 213]]
(234.3ms) commit transaction
(0.1ms) begin transaction
SQL (0.3ms) INSERT INTO "comments" ("text", "article_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["text", "this is a comment"], ["article_id", 980191009], ["created_at", "2015-06-01 18:44:00.89738
@timwaters
timwaters / gist:8066c9cbc743c916ea3b
Created April 17, 2015 18:29
compile mapserver 6.2 with ruby 2
6130 ./configure --with-gdal --with-ogr --with-tiff --with-geos --with-proj --with-png --with-aag --with-zlib
6131 make
6132 make mapscriptvars
6133 cd mapscript/ruby/
6134 ruby extconf.rb
6135 make
6136 cp mapscript.so ~/.rvm/rubies/ruby-2.2.1/lib/ruby/vendor_ruby/2.2.0/x86_64-linux/
@timwaters
timwaters / gist:3e90ab6beb65c3020f65
Created March 24, 2015 16:02
batch compressing and adding gdaloveviews to a directory of files
i=0
for file in *.tif; do
echo $((i++))
tmp_tiff=$(basename $file .tif)_deflate.tif
echo Compressing $file to $tmp_tiff
gdal_translate -co COMPRESS=deflate $file $tmp_tiff
echo Adding overviews to $tmp_tiff
gdaladdo -r average $tmp_tiff 2 4 8 16 32 64
echo rm and move to orig
mv $tmp_tiff $file