Skip to content

Commit

Permalink
package rewrite, better practices, new end point, updated tests. See o…
Browse files Browse the repository at this point in the history
  • Loading branch information
mikejohnson51 committed Dec 17, 2024
1 parent fc62251 commit 1dea782
Show file tree
Hide file tree
Showing 21 changed files with 775 additions and 434 deletions.
4 changes: 4 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,7 @@
^LICENSE\.md$
rosm.cache
^\.travis\.yml$
^\.github$
^_pkgdown\.yml$
^docs$
^pkgdown$
50 changes: 50 additions & 0 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help

on:
push:
branches: [main, master]
pull_request:
branches: [main, master]

name: R CMD Check

jobs:
R-CMD-check:
runs-on: ${{ matrix.config.os }}

name: ${{ matrix.config.os }} (${{ matrix.config.r }})

strategy:
fail-fast: false
matrix:
config:
- {os: macos-latest, r: 'release'}
- {os: windows-latest, r: 'release'}
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'release'}
- {os: ubuntu-latest, r: 'oldrel-1'}

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes

steps:
- uses: actions/checkout@v3

- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
http-user-agent: ${{ matrix.config.http-user-agent }}
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::rcmdcheck
needs: check

- uses: r-lib/actions/check-r-package@v2
with:
upload-snapshots: true
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
.Ruserdata
rosm.cache
.DS_Store
docs
31 changes: 22 additions & 9 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,20 +1,33 @@
Package: NFHL
Title: Extract Data from the National Flood Hazards Layers
Version: 0.0.0.9000
Title: Extract and Query Data from the National Flood Hazard Layers
Version: 0.1.0
Authors@R:
person(given = "Mike",
family = "Johnson",
role = c("aut", "cre"),
email = "jmj00@ucsb.edu",
email = "mike.johnson@noaa.gov",
comment = c(ORCID = "0000-0002-5288-8350"))
Description: This package uses the AOI subsetting workflow to extract data
from the FEMA National Flood Hazards Layer.
License: CC0
Description: Provides tools for extracting and querying data from FEMA's
National Flood Hazard Layer (NFHL). Functions include spatial subsetting
using areas of interest (AOI), querying metadata for specific layers,
and transforming data into spatial objects. This package is designed for
researchers, GIS analysts, and hydrologists working with flood hazard data.
License: Apache License (>= 2)
Encoding: UTF-8
LazyData: true
RoxygenNote: 7.1.0
RoxygenNote: 7.3.2
Imports:
sf (>= 0.6),
jsonlite,
geojsonsf,
httr,
stringr
Suggests:
testthat (>= 3.0.0),
rmarkdown,
dplyr,
stats
AOI
Remotes:
mikejohnson51/AOI
Config/testthat/edition: 3
URL: https://github.com/mikejohnson51/NFHL
BugReports: https://github.com/mikejohnson51/NFHL/issues
237 changes: 194 additions & 43 deletions LICENSE.md

Large diffs are not rendered by default.

14 changes: 9 additions & 5 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@

export(nfhl_describe)
export(nfhl_get)
importFrom(dplyr,"%>%")
importFrom(dplyr,mutate)
importFrom(jsonlite,read_json)
importFrom(sf,read_sf)
export(nfhl_meta)
export(nhfl_end_point)
importFrom(geojsonsf,geojson_sf)
importFrom(httr,GET)
importFrom(httr,build_url)
importFrom(httr,content)
importFrom(httr,parse_url)
importFrom(sf,st_as_sfc)
importFrom(sf,st_bbox)
importFrom(sf,st_crs)
importFrom(sf,st_transform)
importFrom(stats,setNames)
importFrom(stringr,str_extract)
importFrom(stringr,str_remove)
4 changes: 4 additions & 0 deletions R/meta.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#' @title National Flood Hazard Layer Metadata
#' @description A data.frame specifying Layer ID for each date type.
#' @export

nfhl_meta = data.frame(type = c('NFHL Availability',
'LOMRs',
'LOMAs',
Expand Down
Loading

0 comments on commit 1dea782

Please sign in to comment.