Releases: Rimagination/ggmapcn
Releases · Rimagination/ggmapcn
v0.2.0
ggmapcn 0.2.0
New features
- annotation_compass(): Compass (grid north or true north). Works with
coord_sf()or by injecting CRS vialayer$geom_params$crs. Supports grob styles/functions (e.g.,north_arrow_classic(),compass_sinan()). - annotation_scalebar(): Projection-aware scale bar with styles
"segment","ticks","bar". Auto sizing and unit promotion (metric/imperial). Geographic CRS support viageographic_mode = "approx_m" | "degrees". - Compass style set (exported):
north_arrow_classic(),north_arrow_solid(),compass_rose_simple(),compass_rose_classic(),compass_rose_circle(),compass_guiding_fish(),compass_sinan(). - check_geodata(): Mirror-first downloads (jsDelivr → GitHub), pre-checks local files (
local_dirs→ packageextdata→ user cache), atomic writes, resume, retries, optional SHA-256.
Enhancements
- geom_boundary_cn() now consumes
check_geodata()paths, transforms to usercrs, and injects CRS into compass/scale layers in “easy mode”. - Safer CRS handling in annotations (no
%||%; explicit null checks). Defensive guards against zero-width panels. - Smarter labels/ticks for
"segment"scale bar (segments,label_show,minor_tick_height).
Bug fixes
- Prevent “zero-length unit” errors on degenerate panels.
- Remove reliance on undefined
%||%helper. - Consistent behavior in geographic CRS; clear warning in approximate mode.
Breaking/behavior changes
- In geographic CRS,
annotation_scalebar()defaults togeographic_mode = "approx_m"and warns about approximation. Usegeographic_mode = "degrees"to display degrees. - Some internal helpers are now unexported (
@noRd) but remain available internally.
Dependencies
Imports: adddigest,grid; setcurl (>= 5.0.0).
v0.0.2
New Features
- Added the
basemap_dem()function for visualizing elevation data with customizable projections. - Added the
basemap_vege()function for visualizing vegetation data of China with customizable projections. - Added the
geom_world()function for visualizing global administrative divisions. - Added the
coord_proj()function, based on coord_sf, which limits the plotting area to the specified range after projection, without altering the underlying data.
Bug Fixes
Replaced size with linewidth to align with the latest standards of ggplot2.
Enhancements
Improved styling options for various boundaries in geom_boundary_cn().
Initial Release
This is the first release of the ggmapcn package, an R extension for plotting China maps using ggplot2.
Key features include:
- Easy mapping of China’s provincial boundaries.
- Built-in data files for provincial and national boundaries.
- Integrated support for vegetation type raster data for China.