Previously downloaded shapefiles from the USGS
Watershed Boundary Dataset are converted to a
SpatialPolygonsDataFrame with additional columns of data. The resulting file will be
created in the spatial data directory which is set with
directory where the WBD HUC datasets are found
character or integer which must be 2, 4, 6, 8, 10, 12 or 14
character extsion associated with mapshaper simplified files
logical specifying whether to only return the name without creating the file
The full WBD dataset can be downloaded from the USGS with the following command:
curl ftp://rockyftp.cr.usgs.gov/vdelivery/Datasets/Staged/WBD/Shape/WBD_National.zip -O
Typically, the raw data will be simplified using the command line version of mapshpaper. (Installation instructions are found at this URL.)
With mapshaper, you can reduce the number of vertices in the polygons, greatlyl improving the efficiency of spatial searches. Experimentation at the mapshaper website show that a reduction to 1-2 of the original shapefile size still retains the recognizable shape of polygons, removing only the higher order "crenellations" in the polygons.
An example use of mapshaper would be:
mapshaper WBDHU2.shp --simplify 1
A full suite of
.shp, .shx, .dbf, .prj files will be created for the new name
Name of the dataset being created.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.