Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
  • s2dv s2dv
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 17
    • Issues 17
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 2
    • Merge requests 2
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Terraform modules
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Earth SciencesEarth Sciences
  • s2dvs2dv
  • Issues
  • #60
Closed
Open
Issue created Apr 21, 2022 by aho@ahoMaintainer

PlotEquiMap: Poorly reorganized lon/lat if the input is not regularly spaced

PlotEquiMap() expected regularly-spaced longitude and latitude. In some cases, the lon/lat is not regularly spaced and the function re-organizes lon/lat wrongly. The data can still be plotted but some features (e.g., country.border = T) is not functional.

The "regularly spaced" requirement is documented but there is no check in the function. And for many cases, the data can still be plotted, so we're not sure what's the exact criteria of "regular spaced".

For a specific case (script below), the country border is not plotted and the problematic part is line 721-725. Without the wrong sorting, the longitude can remain correct and borders can be plotted.

library(s2dv)

x <- readRDS('/home/Earth/aho/aho-testtest/s2dv/issue/issue60/data.rds')

s2dv::PlotEquiMap(var = x$data, lon = x$lon, lat = x$lat, coast_color = 'black',
                  colNA = 'grey', axelab = FALSE, brks = seq(0.5,12.5,1),
                  triangle_ends = c(F,F), bar_label_scale = 2,
                  toptitle = 'title', country.borders = TRUE, coast_width = 2,
                  filled.continents = FALSE, filled.oceans = 'grey',
                  height = 10, width = 18, res = 300, fileout = NULL)

FYI @cdelgado

Edited Apr 21, 2022 by aho
Assignee
Assign to
Time tracking