DOI-USGS / intersectr

See official repository here: https://code.usgs.gov/water/intersectr
Creative Commons Zero v1.0 Universal
7 stars 5 forks source link

Hacking in better support for data that spans the date line. #12

Closed dblodgett-usgs closed 5 years ago

dblodgett-usgs commented 5 years ago

Not super happy with this, but the tests pass and it does what we need to do.

Found some differences in behavior between sf and stars where stars switches to 0-360 lat/lon when data crosses the date line. So I convert the geometry to the same when the cell geometry has to be created in that projection. Still need to test this out for the area weighted stuff -- but it should be OK as long as the geometry gets handled right.

Not going to merge just yet as further work is required to make sure the area intersection will work under this strategy.

dblodgett-usgs commented 5 years ago

Ended up pulling back a few things and adding a check for lon/lat in the calculate area weights function. This should pretty much work now.