Skip to content

Instantly share code, notes, and snippets.

View mager's full-sized avatar
🏠
Working from home

Mager mager

🏠
Working from home
View GitHub Profile
>>> client.get_nearby("com.your.layer", 40.019444, -105.292778, tag="featured")
>>> records = client.get_nearby('com.simplegeo.us.business', 37.76488, -122.414989, tag='sic:58120304')
>>> [r['properties']['business_name'] for r in records['features']]
[u'Coffee Bar 1', u'Circadia Coffee House', u'Muddy Water', u'Shama Coffee Shop', u"It's Tops Coffee Shop",
u'Starbucks Coffee', u'Starbucks Coffee']
>>> client.get_nearby('com.simplegeo.global.flickr', 37.765850, -122.437094, limit=1, radius=0.5)
{
'type':'FeatureCollection',
'features':[
{
'distance':41.224616104598255,
'created':1284841637,
'geometry':{
'type':'Point',
'coordinates':[
-122.436684,
>>> client.get_nearby_geohash('com.simplegeo.global.flickr', '9q8y')
$testRecord->foo = 'bar';
INFO: Open of `sflnds_parks.shp'
using driver `ESRI Shapefile' successful.
Layer name: sflnds_parks
Geometry: Polygon
Feature Count: 211
Extent: (5978809.933564, 2086033.360837) - (6020988.384564, 2123615.899837)
Layer SRS WKT:
PROJCS["NAD_1983_StatePlane_California_III_FIPS_0403_Feet",
GEOGCS["GCS_North_American_1983",
<?php
require_once 'Services/SimpleGeo.php';
$client = new Services_SimpleGeo('your-oauth-token', 'your-oauth-secret');
$south = 42.4166 // Grosse Pointe Farms
$west = -82.9189 // Harper Woods
$north = 42.4465 // Grosse Pointe Woods
$east = -82.8753 // Grosse Pointe Shores
<?php
try {
$result = $client->getOverlaps($south, $west, $north, $east);
print_r($result);
} catch (Services_SimpleGeo_Exception $e) {
echo "ERROR: " . $e->getMessage() . " (#" . $e->getCode() . ")";
}
?>
<?php
// Require the PEAR client library. No other requires are needed.
require_once 'Services/SimpleGeo.php';
// If you log into SimpleGeo and click on Account you'll see
// your OAuth token and secret.
$client = new Services_SimpleGeo('your-oauth-token',
'your-oauth-secret');