MikkoVihtakari / ggOceanMaps

Plot oceanographic research data on maps using ggplot2
GNU General Public License v3.0
46 stars 7 forks source link

TopologyException from version 2.2.0 #40

Open eaalto opened 9 months ago

eaalto commented 9 months ago

After upgrading to the latest version (2.2.0), I am getting the following error:

Error in (function (msg) : TopologyException: Input geom 0 is invalid: Self-intersection at -178.09999999999999 89.450000000000003

following a call to: basemap(limits=c(-105, 5, -5, 75), bathymetry=TRUE, bathy.style="contour_grey")

Traceback:

  1. basemap_data(limits = limits, data = data, shapefiles = shapefiles, crs = crs, bathymetry = bathymetry, bathy.type = bathy.type, downsample = downsample, glaciers = glaciers, lon.interval = lon.interval, lat.interval = lat.interval, rotate = rotate, expand.factor = expand.factor, ...

  2. basemap_data_crop(x = x, bathymetry = bathymetry, glaciers = glaciers, crs = crs)

  3. clip_shapefile(sf::st_transform(x$shapefiles$bathy, crs = x$crs), limits = x$clip_limits)v

There are calls to 'sf' below that, but I checked and updating to the newest version of 'sf' (v 1.0.15) is ok. The problem goes away if I roll back to ggOceanMaps v. 2.1.1.

I'm not the familiar with how 'sf' and other spatial data works, so I don't have any suggestions about what would cause a TopologyException.

Thanks. Emil Aalto

MikkoVihtakari commented 9 months ago

Yes, seems like a bug somewhere. I'll look at it when I have time. Thanks for reporting.