Giter Site home page Giter Site logo

hydromaps's Introduction

Build Status

Installation

Windows

install.packages("hydroMaps", 
    repos = c("http://owi.usgs.gov/R", "http://cran.us.r-project.org"))

Mac and Unix

hydroMaps depends on the R packages sp,rgeos, and rgdal all of which require an external library gdal to be installed. See :

https://www.mapbox.com/tilemill/docs/guides/gdal/

install.packages("hydroMaps", 
    repos = c("http://owi.usgs.gov/R", "http://cran.us.r-project.org"))

Sample Workflow

library(dataRetrieval)
library(hydroMap)

sites <- c("01491000", "01573000", "01576000")

siteInfo <- readNWISsite(sites)
# png("test.png",width=11,height=8,units="in",res=600,pointsize=4)
plotWSB(sites)
## OGR data source with driver: ESRI Shapefile 
## Source: "C:\Users\ldecicco\AppData\Local\Temp\1\RtmpCONae8", layer: "epa_basins"
## with 3 features
## It has 4 fields

# dev.off()

Use base R graphics to add information:

plotWSB(sites)
## OGR data source with driver: ESRI Shapefile 
## Source: "C:\Users\ldecicco\AppData\Local\Temp\1\RtmpCONae8", layer: "epa_basins"
## with 3 features
## It has 4 fields
points(siteInfo$dec_long_va, siteInfo$dec_lat_va, pch=20, col="red", cex=2)
axis(2,las=1)
axis(1,las=1)
title(paste("Sites:",paste0(siteInfo$site_no,collapse = ",")))

Create Interactive Graphs using Leaflet:

library(leaflet)
basins <- getBasin(sites)
leaflet() %>% 
  addProviderTiles("CartoDB.Positron") %>% 
  setView(-75.8, 40, zoom = 6) %>%
  addPolygons(data=basins, weight=2) %>%
  addCircleMarkers(siteInfo$dec_long_va,siteInfo$dec_lat_va,
                   color = "red",
                   radius=3,
                   stroke=FALSE,
                   fillOpacity = 0.8, opacity = 0.8,
                   popup=siteInfo$station_nm)

Screen shot:

Contribute

In order to contribute to this code, we recommend the following workflow:

  1. "fork" this repository to your own personal github account

  2. clone the github repository to your computer:

    $git clone https://github.com/{username}/hydroMaps.git

  3. modify code or add new functionality, save the code

  4. add the repository master to a remote master called "upstream"

    $cd hydroMaps

    $git remote add upstream https://github.com/USGS-R/hydroMaps.git

  5. before pushing your changes to your repository, pull in the current version of the USGS-R master:

    $git fetch upstream

  6. merge these differences with your own "master" version:

    $git merge upstream/master

  7. push your changes to your github repository, in addition to changes made by pulling in the GLEON master:

    $git push

  8. submit a pull request to USGS-R master using your account at github.com

Disclaimer

This software is in the public domain because it contains materials that originally came from the U.S. Geological Survey, an agency of the United States Department of Interior. For more information, see the official USGS copyright policy

Although this software program has been used by the U.S. Geological Survey (USGS), no warranty, expressed or implied, is made by the USGS or the U.S. Government as to the accuracy and functioning of the program and related program material nor shall the fact of distribution constitute any such warranty, and no responsibility is assumed by the USGS in connection therewith.

This software is provided "AS IS."

CC0

hydromaps's People

Contributors

ldecicco-usgs avatar

Watchers

Luke Winslow avatar James Cloos avatar

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.