Coder Social home page Coder Social logo

corey4005 / get-usdm-shapefiles Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 1.0 110 KB

This is a tool to help users download large quantities of US drought monitor shapefiles from the GIS database. Contains an example to get point descriptions from 18 sites for 20 years.

Python 100.00%
drought drought-monitor geopandas pandas

get-usdm-shapefiles's Introduction

get-usdm-shapefiles

This is a tool to help users download large quantities of US drought monitor shapefiles from the GIS database.

Clone this repo

git clone https://github.com/Corey4005/get-usdm-shapefiles.git

Requirements

GNU Wget version 1.14

How to use this tool

Open a command prompt and enter a starting and end date:

python get_usdm.py 20000104 20201229 #example timestamp representing startdate 2000-01-04 and enddate 2020-12-29 (20 years!) 

This script will create a file called usdm_links.txt containing all of the links that wget could call to download US drought monitor shapefiles.

Then, you can call wget on the textfile and retreive the shapefiles from USDM REST API services.

wget -i usdm_links.txt -P shapefiles/ --progress=bar:force:noscroll

All of the shapefiles between the start and end date will be downloaded to the shapefiles directory!

In order to unzip the .zip files in the /shapefiles directory so that you can get each .shp, .prj, .xml, .sbn, .dbf, open a command prompt and enter the following:

python unzip.py

Cool statistic

I was able to download 20 years of USDM shapefiles to my hard drive in 34 seconds using this script!

Example script utilizing 20 years of USDM data

For a project I was working on, I needed USDM data for 18 USDA SCAN soil moisture sites across Alabama.

The metadata for the example is found here.

I ran the make_dataframe.py script on the /shapefiles directory to collect the USDM data for each point, for each shapefile. I then sent this data to the /outdata directory, where you can find an example drought climatology in .csv format.

get-usdm-shapefiles's People

Contributors

corey4005 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

rankicker795

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.