Skip to content

Commit

Permalink
added test folder
Browse files Browse the repository at this point in the history
  • Loading branch information
denironyx committed Jun 16, 2024
1 parent d536086 commit 453fc31
Show file tree
Hide file tree
Showing 7 changed files with 117 additions and 1 deletion.
9 changes: 9 additions & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,12 @@ License: MIT + file LICENSE
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.1
Depends:
R (>= 3.5.0)
Imports:
arrow,
dplyr,
sf
Suggests:
testthat (>= 3.0.0)
Config/testthat/edition: 3
2 changes: 2 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
# Generated by roxygen2: do not edit by hand

export(dataset_path)
export(get_all_overture_types)
68 changes: 68 additions & 0 deletions R/utils.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
#' Title
#'
#' @param overture_type
#'
#' @return
#' @export
#'
#' @examples
dataset_path <- function(overture_type) {
type_theme_map = list(
"locality" = "admins",
"locality_area" = "admins",
"administrative_boundary" = "admins",
"building" = "buildings",
"building_part" = "buildings",
"division" = "divisions",
"division_area" = "divisions",
"place" = "places",
"segment" = "transportation",
"connector" = "transportation",
"infrastructure" = "base",
"land" = "base",
"land_cover" = "base",
"land_use" = "base",
"water" = "base"
)

theme = type_theme_map[[overture_type]]
return(paste0("s3://overturemaps-us-west-2/release/2024-05-16-beta.0/theme=",theme, "?region=us-west-2"))
}



#' get_all_overture_types
#'
#' @return
#' @export
#'
#' @examples
get_all_overture_types <- function() {
type_theme_map = list(
"locality" = "admins",
"locality_area" = "admins",
"administrative_boundary" = "admins",
"building" = "buildings",
"building_part" = "buildings",
"division" = "divisions",
"division_area" = "divisions",
"place" = "places",
"segment" = "transportation",
"connector" = "transportation",
"infrastructure" = "base",
"land" = "base",
"land_cover" = "base",
"land_use" = "base",
"water" = "base"
)

return(names(type_theme_map))
}


record_batch_reader <- function(overture_type, bbox = NULL) {
path <- dataset_path(overture_type)

filter_ex
}

2 changes: 1 addition & 1 deletion README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ knitr::opts_chunk$set(
[![R-CMD-check](https://github.com/denironyx/overturemapsr/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/denironyx/overturemapsr/actions/workflows/R-CMD-check.yaml)
<!-- badges: end -->

The goal of overturemapsr is to ...
Overture Maps provides free and open geospatial map data, from many different sources and normalized to a common schema. This tool helps to download Overture data within a region of interest and converts it to a few different file formats.

## Installation

Expand Down
14 changes: 14 additions & 0 deletions man/dataset_path.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions man/get_all_overture_types.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions tests/testthat.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# This file is part of the standard setup for testthat.
# It is recommended that you do not modify it.
#
# Where should you do additional test configuration?
# Learn more about the roles of various files in:
# * https://r-pkgs.org/testing-design.html#sec-tests-files-overview
# * https://testthat.r-lib.org/articles/special-files.html

library(testthat)
library(overturemapsr)

test_check("overturemapsr")

0 comments on commit 453fc31

Please sign in to comment.