This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import requests | |
import json | |
import pandas as pd | |
# Go from JSON to a measurement of UMD deforestation by year. If you | |
# have a shapefile, you will have to convert and simplify the | |
# polygons, preserving topology. The Earth Engine API does not | |
# support long, long requests. You can convert the shapefile using | |
# OGR within the data subdirectory: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import pandas | |
from BeautifulSoup import BeautifulSoup | |
def _grab_data(): | |
url = 'http://www.bettermap.org/json' | |
x = requests.get(url) | |
return x.json()['features'] | |
def _process_entry(entry): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from bs4 import BeautifulSoup | |
import json | |
import pandas as pd | |
# Process information on Caltrans projects. Convert this file to | |
# GeoJSON: | |
# wget https://dot.ca.gov/hq/construc/cons.kml | |
# ogr2ogr -f GeoJSON cons.json cons.kml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Accepts a results dictionary and writes an short analysis based on | |
# the stored results. Example: | |
# test_res_dict = { | |
# 'address' : '1460 Golden Gate Avenue, San Francisco, CA', | |
# 'sold_date' : '2008-04-21', | |
# # baseline level of vegetation or some other sort of indicator of | |
# # the property. | |
# 'pre_ndvi' : 100, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def landsatID(alert_date, coords, offset_days=30): | |
"""get the ID of the Landsat 8 image that is closest to the | |
supplied alert date within the supplied GEE-formatted polygon | |
""" | |
d = datetime.datetime.strptime(alert_date, '%Y-%m-%d') | |
begin_date = d - datetime.timedelta(days=offset_days) | |
poly = ee.Feature.Polygon(coords) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// FORMA, Hammer et al. (2014) | |
// Objective: | |
// Alerts of forest disturbance from MODIS imagery | |
// GEE core assets: | |
// MOD44B_C4_TREE_2000 (Vegetation Continuous Fields, annual 250m) | |
// MOD13Q1 (Vegetation indices, 16-day 250m) | |
// NOAA/PRECL_05D (Precipitation Reconstruction over Land, monthly 0.5 degree) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// FORMA, Hammer et al. (2014) | |
// Objective: | |
// Alerts of forest disturbance from MODIS imagery | |
// GEE core assets: | |
// MOD44B_C4_TREE_2000 (Vegetation Continuous Fields, annual 250m) | |
// MOD13Q1 (Vegetation indices, 16-day 250m) | |
// NOAA/PRECL_05D (Precipitation Reconstruction over Land, monthly 0.5 degree) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Normalized Burn Ratio | |
// Hammer, Kraft, and Steele (Data Lab at WRI) | |
// GFW-Fires, prototype | |
// Reference | |
// Escuin, S., R. Navarro, P. Fernandez. 2008. Fire severity assessment by | |
// using NBR (Normalized Burn Ratio) and NDVI (Normalized Difference | |
// Vegetation Index) derived from LANDSAT TM/ETM images. Int. J. Remote | |
// Sens. 29:1053-1073. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Normalized Burn Ratio | |
// Hammer, Kraft, and Steele (Data Lab at WRI) | |
// GFW-Fires, prototype | |
// Reference | |
// Escuin, S., R. Navarro, P. Fernandez. 2008. Fire severity assessment by | |
// using NBR (Normalized Burn Ratio) and NDVI (Normalized Difference | |
// Vegetation Index) derived from LANDSAT TM/ETM images. Int. J. Remote | |
// Sens. 29:1053-1073. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Normalized Burn Ratio | |
// Hammer, Kraft, and Steele (Data Lab at WRI) | |
// GFW-Fires, prototype | |
// Reference | |
// Escuin, S., R. Navarro, P. Fernandez. 2008. Fire severity assessment by | |
// using NBR (Normalized Burn Ratio) and NDVI (Normalized Difference | |
// Vegetation Index) derived from LANDSAT TM/ETM images. Int. J. Remote | |
// Sens. 29:1053-1073. |
OlderNewer