This file contains hidden or 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
| """TFA script for Stacie to experiment with TFAs.""" | |
| import logging | |
| import os | |
| import pygeoprocessing.routing | |
| import multiprocessing | |
| import sys | |
| import taskgraph | |
| WORKSPACE_DIR = 'workspace' |
This file contains hidden or 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
| # coding=UTF-8 | |
| import io | |
| import multiprocessing | |
| import numpy | |
| def numpy_dumps(numpy_array): | |
| """Safely pickle numpy array to string. |
This file contains hidden or 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
| """These calculations are for the Critical Natural Capital paper.""" | |
| import pygeoprocessing | |
| gdal.SetCacheMax(2**27) | |
| logging.basicConfig( | |
| level=logging.DEBUG, | |
| format=( | |
| '%(asctime)s (%(relativeCreated)d) %(levelname)s %(name)s' | |
| ' [%(funcName)s:%(lineno)d] %(message)s')) |
This file contains hidden or 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
| """ | |
| EO Pollination test script. | |
| docker run --rm -it -v "%CD%":/usr/local/workspace therealspring/inspring:latest eo_test.py | |
| """ | |
| import logging | |
| import sys | |
| import multiprocessing | |
| import inspring | |
| from osgeo import gdal |
This file contains hidden or 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 osgeo import osr | |
| projection_wkt = 'GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AXIS["Latitude",NORTH],AXIS["Longitude",EAST],AUTHORITY["EPSG","4326"]]' | |
| srs = osr.SpatialReference() | |
| srs.ImportFromWkt(projection_wkt) | |
| print(projection_wkt) | |
| print(f'''IsProjected: { | |
| srs.IsProjected()}. EPSGTreatsAsLatLong: {srs.EPSGTreatsAsLatLong()}''') |
This file contains hidden or 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
| """Demo of optimization.""" | |
| import logging | |
| import os | |
| import sys | |
| import pygeoprocessing | |
| logging.basicConfig( | |
| level=logging.DEBUG, | |
| format=( |
This file contains hidden or 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 multiprocessing | |
| import os | |
| import sys | |
| import json | |
| import glob | |
| import logging | |
| #import taskgraph | |
| import pandas as pd | |
| from wbnci import biodiversity, carbon |
This file contains hidden or 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
| """Example of determing if points are contained in polygon.""" | |
| from osgeo import gdal | |
| import shapely.geometry | |
| point_vector_path = 'dams.shp' | |
| polygon_vector_path = 'watersheds_hotels_resorts_DdS.shp' | |
| polygon_id_field = 'Name' | |
| point_id_field = 'desc_short' |
This file contains hidden or 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
| """Demo of how to use pandas to multiply one table by another.""" | |
| import argparse | |
| import os | |
| from osgeo import gdal | |
| from osgeo import ogr | |
| from osgeo import osr | |
| import pandas | |
| parser = argparse.ArgumentParser(description='mult by columns script') |
This file contains hidden or 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
| """Generate a STAC catalog.""" | |
| import os | |
| import subprocess | |
| import datetime | |
| import pystac | |
| output = subprocess.check_output( | |
| 'gsutil ls gs://my-bucket-with-geotiffs', shell=True) |