Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for discrete non-square (hexagonal) raster grids #9

Closed
mbacou opened this issue Sep 1, 2017 · 5 comments
Closed

Add support for discrete non-square (hexagonal) raster grids #9

mbacou opened this issue Sep 1, 2017 · 5 comments

Comments

@mbacou
Copy link

mbacou commented Sep 1, 2017

On Roger Bivand's suggestion, I'm reposting here from R-sig-Geo:

I am wondering if current R raster operations (e.g. extract(), resample(), distance(), etc.) can be modified to work with honeycomb (hexagonal) grids instead of simple square grids? This is driven by e.g.
work at Uber https://www.slideshare.net/stonse/ml-and-data-science-at-uber-gitpro-talk-2017, and other articles http://strimas.com/spatial/hexagonal-grids/ and also R packages:

I'm being asked to evaluate the pros/cons of using different tessellations, and wondering what's the extent of R's support for non square grids.

Thanks!

@mbacou mbacou changed the title Add support for non-square (hexagonal) raster grids Add support for discrete non-square (hexagonal) raster grids Sep 1, 2017
@adrfantini
Copy link

adrfantini commented Sep 1, 2017

I guess you already looked into the icosa and dggridR packages?
EDIT: spoiler alert: they are AWESOME

@adrfantini
Copy link

I believe edzer and the author of icosa spoke at EGU earlier this year (they were at the same session at least once iirc), so it's likely they already discussed this. Still, interested to hear from edzer if non-rectangular grids are programmed for the future. rectangular grids are so twentieth century!

@mdsumner
Copy link
Member

mdsumner commented Sep 1, 2017

I'd like to add that regular meshes like hexagons are only part of a greater need for generalization, icosa and dggridR have the extra feature that they are continuous around the globe. Something that GDAL allows in part and stars has on the agenda is to deal with regular grids that are rectangular in index-space, but that have coordinate data that position them in geometric (or geographic space) - and that is independent of whether the logic behind the grid wraps around a seam. Raster can already be bent into shape for "irregular grids", the angstroms package shows some limited ways.

These meshes are where the distinction between raster and vector disappears, and I don't think that's in scope for stars, though it is an important topic to be considered. icosa and dggridR share some concepts with the ragged array grid used by SeaWiFS and MODIS (it's equal area in Sinusoidal projection, and implicitly wraps - but doesn't share vertices where the horizontal rows meet, it's implicitly calculated by number-of-rows and latitude of row).

https://oceancolor.gsfc.nasa.gov/docs/format/l3bins/

I just mention this in the hope that the distinction between rectangular grids (whether regular or not, whether wrapping or not) and continuous meshes is clear. I feel I understand it well, but it's not explained clearly in one place that I know of.

@edzer
Copy link
Member

edzer commented Sep 1, 2017

I feel I understand it well, but it's not explained clearly in one place that I know of.

Do I hear a challenge? ;-)

Tesselations of the sphere and meshes are definitely on my radar, as are spatial indexes on the sphere - I had some good discussions with @rubak about his s2 package which he presented at UseR! two months ago. The pragmatic side in me might first try to represent them as a bunch of simple feature geometries which, with proper indexing, might work for many cases - icosa seems to a lot of conversions to sp structures if only to visualize. No doubt Mike's experiences will help getting this done all more formally / efficiently / topologically.

@edzer
Copy link
Member

edzer commented Sep 23, 2018

Right now, hexagonal grids are now supported in sf, and by that also in stars (where they are seen as a sequence of points, or polygons, no clever indexing going on).

@edzer edzer closed this as completed Sep 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants