Git Product home page Git Product logo

gecevar's Introduction

gecevar R Package logo-gecevar

R-CMD-check Codecov test coverage

gecevar stands for “GEtting Climatic and other Environmental VARiables”. The package contains functions for downloading climate and environmental data from open and free online datasets for any region of the world. The data can be used for ecological studies. The area of interest can be a country, state or project area and is defined by an extent, vector file or country iso-code. Data comes from a variety of sources (e.g. Chelsa, OpenStreetMap, TropicalMoistForest, SRTMv4.1, SoilGrids). Climate and environmental data are available as multiband raster files at a resolution and in the coordinate reference system specified by the user. When possible, the package uses the properties of Cloud Optimized GeoTIFF (COGs) files to download only the portion of the global datasets corresponding to the area of interest, reducing download time. The package uses GDAL and the R libraries terra and sf for optimized processing of raster and vector geospatial data.

System requirements

Make sure GDAL and GRASS GIS are installed on your system.

Installation

You can install gecevar from GitHub with:

devtools::install_github("ghislainv/gecevar")

Contributing

The gecevar R package is Open Source and released under the GNU GPL version 3 license. Anybody who is interested can contribute to the package development following our Contributing guide. Every contributor must agree to follow the project’s Code of conduct.

gecevar's People

Contributors

ghislainv avatar guillaumontp avatar jeanneclement avatar lamonica-d avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

gecevar's Issues

Inconsistent output from transform_shp_country_extent

The function transform_shp_country_extent return inconsistent outputs depending on the input extent format.
For example transform_shp_country_extent(EPSG = 32738, country_name = "Madagascar") returns:

                                                      lonmin.xmin 
"281470 7110484 1156584 8783293"                             "43" 
                     latmin.ymin                      lonmax.xmax 
                           "-26"                             "51" 
                     latmax.ymax 
                           "-11"

And transform_shp_country_extent(EPSG = 32738, extent_latlon = c(43.0, -26.0, 51.0, -11.0)) returns:

                 lonmin.xmin.xmin latmin.ymin.ymin lonmax.xmax.xmax 
 "43 -26 51 -11"         "281470"        "7110484"        "1156584" 
latmax.ymax.ymax 
       "8783293" 

The two referentials are inverted in the outputs.
In this case the block for 'extent_latlon' in the function should probably be changed to something like that:

if (!is.null(extent_latlon)){
    extent_final_latlon <- c(lonmin.xmin=floor(extent_latlon[1]), latmin.ymin=floor(extent_latlon[2]), lonmax.xmax=ceiling(extent_latlon[3]), latmax.ymax=ceiling(extent_latlon[4]))
    e <- ext(extent_final_latlon[1], extent_final_latlon[3], extent_final_latlon[2], extent_final_latlon[4])
    e <- as.polygons(e)
    crs(e) <- "epsg:4326"
    extent <- st_bbox(project(e, paste0("epsg:", EPSG)))
    extent <- c(floor(extent[1]), floor(extent[2]), ceiling(extent[3]), ceiling(extent[4]))
    extent <- paste(extent[1], extent[2], extent[3], extent[4], sep = " ")
}

Instead of:

if (!is.null(extent_latlon)){
    extent <- round(extent_latlon)
    e <- ext(extent[1], extent[3], extent[2], extent[4])
    e <- as.polygons(e)
    crs(e) <- "epsg:4326"
    extent_final_latlon <- st_bbox(project(e, paste0("epsg:", EPSG)))
    extent_final_latlon <- c(lonmin.xmin=floor(extent_final_latlon[1]), latmin.ymin=floor(extent_final_latlon[2]),
                             lonmax.xmax=ceiling(extent_final_latlon[3]), latmax.ymax=ceiling(extent_final_latlon[4]))

  }

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.