Skip to content

Instantly share code, notes, and snippets.

@danhammer
Created April 15, 2015 13:38
Show Gist options
  • Save danhammer/62b420d9a118b3c6aa0f to your computer and use it in GitHub Desktop.
Save danhammer/62b420d9a118b3c6aa0f to your computer and use it in GitHub Desktop.
import requests
import urllib
BASE = "http://beta.gfw-apis.appspot.com/forest-change/forma-alerts"
period = "2008-01-01,2012-09-24"
sample_area = {
"geometry": {
"type": "Polygon",
"coordinates": [
[
109.53369140625,
2.04302395742204
],
[
109.48974609375,
1.6806671337507222
],
[
109.69848632812499,
1.4280747713669428
],
[
110.36865234374999,
0.8788717828324276
],
[
110.67626953125,
0.8019757647536726
],
[
111.005859375,
0.9557662177941483
],
[
111.20361328125,
1.0106897682409128
],
[
113.961181640625,
-0.8678867310885294
],
[
113.22509765625,
-3.480523430587774
],
[
109.852294921875,
-3.7217452310689536
],
[
107.90771484375,
-0.45043481325254864
],
[
108.511962890625,
1.537901237431487
],
[
109.53369140625,
2.04302395742204
]
]
}
}
res = requests.get(
BASE,
params=dict(
geojson=str(sample_area['geometry']),
period=period
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment