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) |
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 python:3.8-slim-buster as builder | |
RUN apt-get update | |
RUN apt-get install -y --no-install-recommends \ | |
cmake build-essential wget ca-certificates unzip pkg-config \ | |
zlib1g-dev libfreexl-dev libxml2-dev | |
# making directory to avoid this JDK installation bug: https://github.com/geerlingguy/ansible-role-java/issues/64 | |
RUN mkdir /usr/share/man/man1 | |
RUN apt-get install -y openjdk-11-jdk-headless |
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 how to use experimental SDR c-factor.""" | |
import sys | |
import logging | |
import natcap.invest.sdr.sdr | |
logging.basicConfig(stream=sys.stdout, level=logging.DEBUG) | |
args = { | |
'biophysical_table_path': './data/biophysical_SDR.csv', |
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
root@6de621f3074a:/usr/local/pygeoprocessing# python setup.py install | |
running install | |
running bdist_egg | |
running egg_info | |
creating pygeoprocessing.egg-info | |
writing pygeoprocessing.egg-info/PKG-INFO | |
writing dependency_links to pygeoprocessing.egg-info/dependency_links.txt | |
writing requirements to pygeoprocessing.egg-info/requires.txt | |
writing top-level names to pygeoprocessing.egg-info/top_level.txt | |
writing manifest file 'pygeoprocessing.egg-info/SOURCES.txt' |
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 argparse | |
import requests | |
def demo(mosaic_id, planet_api_key): | |
"""Demo of searching multiple bounding boxes. | |
Parameters: | |
mosaic_id (str): planet mosaic id. | |
planet_api_key (str): Planet API key. |