Skip to content

Instantly share code, notes, and snippets.

View iisstizzy's full-sized avatar

Stan Watts iisstizzy

View GitHub Profile

A quarter million US roads added and aligned

Since September 2012 our team has aligned 260,309 roads in the United States. For this process we use fresh US government TIGER data to show where OpenStreetMap data is out of date, then we trace from imagery as needed and use road names from TIGER. (For a background on TIGER data in OpenStreetMap read Eric Fischer's blog post).

Here's the map showing the extent of the issue. Pink lines are the progress over US. Full interactive map.

We continue our work on TIGER with @MateoV's recent analysis that further focuses our TIGER work. This analysis looks only at areas with high Twitter

@wboykinm
wboykinm / geojson.php
Last active September 13, 2024 19:00
Sample PHP to Point GeoJSON
<?php
/**
* PHP GeoJSON Constructor, adpated from https://github.com/bmcbride/PHP-Database-GeoJSON
*/
# Connect to MySQL database
$conn = new PDO('mysql:host=localhost;dbname=mydatabase','myusername','mypassword');
# However the User's Query will be passed to the DB:
$sql = 'SELECT * from GDA_database WHERE user_query = whatever';
@cosmocatalano
cosmocatalano / instagram_scrape.php
Last active November 22, 2024 17:46
Quick-and-dirty Instagram web scrape, just in case you don't think you should have to make your users log in to deliver them public photos.
<?php
//returns a big old hunk of JSON from a non-private IG account page.
function scrape_insta($username) {
$insta_source = file_get_contents('http://instagram.com/'.$username);
$shards = explode('window._sharedData = ', $insta_source);
$insta_json = explode(';</script>', $shards[1]);
$insta_array = json_decode($insta_json[0], TRUE);
return $insta_array;
}