jbaileyh / geogrid

Turning geospatial polygons into regular or hexagonal grids. For other similar functionality see the tilemaps package https://github.com/kaerosen/tilemaps
Other
393 stars 31 forks source link

create maps from sf object #8

Closed pssguy closed 6 years ago

pssguy commented 6 years ago

Is it possible - or could you enhance package so - that the hex and regular maps can be created from the starting point of a data.frame with a simple feature geometry list-column

sassalley commented 6 years ago

It is something that I have thought about. I do believe that it would be a good idea given that sf is a potential replace meant for sp. I rely a lot on a couple of functions from sp which are designed for sp types but will look into it.

In the short term - converting between sp and sf shouldn't be too much of an issue given this.

pssguy commented 6 years ago

I've been trying - so far without success - to create a SpatialPolygonsDataFrame from an sf. Then I can just apply your functions. I'm pretty sure it can be done but am new to this area so haven't achieved as yet

If you just had a function that could do that then that would solve my issue However, longer term, sf, as default, is probably the way to go

BTW congrats on a great package 100*'s and counting

sassalley commented 6 years ago

@pssguy any luck with the conversion? If i were to implement an SF option i'd probably just incorporate as(nc, 'Spatial') or the approaches discussed here which I don't think would help with your issue?

pssguy commented 6 years ago

@sassalley Yes, I think as(nc, 'Spatial') does the trick. Thanks