pysal / tobler

Spatial interpolation, Dasymetric Mapping, & Change of Support
https://pysal.org/tobler
BSD 3-Clause "New" or "Revised" License
144 stars 30 forks source link

Add pre-set options to `h3fy` resolution #118

Open darribas opened 3 years ago

darribas commented 3 years ago

Picking this up from #111:

Going forward, it'd be great to give also str options, something like:

  • auto: some "magic" that gives the "correct" one, if we can come up with some heuristics
  • balanced (or some alternative name): for the resolution that'll give you the closest number of hexagons to those passed in source
  • compacted: one that allocates to a H3 Polyfill compacted version
  • ...

And from @knaaptime:

one option might be to try and roughly match the number of input geoms, another option might be to try and match the size, e.g. by taking the best match between mean area of input geoms and the hexes listed at https://h3geo.org/docs/core-library/restable

sjsrey commented 2 years ago

@darribas how about a new argument called auto_resolution that can take the following values:

mean: sets resolution to give h3 hexagons approximating the mean source area median: sets resolution h3 hexagons approximating the median source area

if this is set, then the resolution argument is ignored?