Package 'cartomisc'

Title: Miscellaneous Tools for Spatial Data Manipulation and Analysis
Description: Some useful tools for use with spatial data.
Authors: Sebastien Rochette [aut, cre]
Maintainer: Sebastien Rochette <[email protected]>
License: MIT + file LICENSE
Version: 0.0.0.9000
Built: 2025-01-29 03:08:05 UTC
Source: https://github.com/statnmap/cartomisc

Help Index


Transform raster as data.frame to be later used with ggplot Modified from rasterVis::gplot

Description

Transform raster as data.frame to be later used with ggplot Modified from rasterVis::gplot

Usage

gplot_data(x, maxpixels = 50000)

Arguments

x

A Raster* object

maxpixels

Maximum number of pixels to use

Details

rasterVis::gplot is nice to plot a raster in a ggplot but if you want to plot different rasters on the same plot, you are stuck. If you want to add other information or transform your raster as a category raster, you can not do it. With 'cartomisc::gplot_data', you retrieve your raster as a data.frame that can be modified as wanted using 'dplyr' and then plot in 'ggplot' using 'geom_tile'. If Raster has levels, they will be joined to the final tibble.


Create buffer divided by closest region

Description

Create buffer divided by closest region

Usage

regional_seas(
  x,
  group,
  dist = units::set_units(30, km),
  density = units::set_units(0.1, 1/km)
)

Arguments

x

Spatial polygon layer

group

Character. The grouping variable for your subareas

dist

distance from coasts of the buffer area. See ?sf::st_buffer

density

density of points along the coastline. (the higher, the more precise the region attribution)


Calculate the position of the sun according to date and geographical position in wgs84 Found here: http://stackoverflow.com/questions/8708048/position-of-the-sun-given-time-of-day-latitude-and-longitude

Description

Calculate the position of the sun according to date and geographical position in wgs84 Found here: http://stackoverflow.com/questions/8708048/position-of-the-sun-given-time-of-day-latitude-and-longitude

Usage

sun_position(
  year,
  month,
  day,
  hour = 12,
  min = 0,
  sec = 0,
  lat = 46.5,
  long = 6.5
)

Arguments

year

year

month

month

day

day

hour

hour

min

min

sec

sec

lat

lat

long

long