figma-plugin icon indicating copy to clipboard operation
figma-plugin copied to clipboard

Render oceans

Open tmcw opened this issue 2 years ago • 2 comments

Right now one of the most annoying things about this plugin is that it doesn't render water areas properly. I'm not 100% sure how to do this - need to do some spelunking in iD. The solution probably isn't something like downloading the entire relation, because relations are gigantic. But maybe it's winding order or something like that?

tmcw avatar Jan 02 '23 19:01 tmcw

Still not sure how to do this, tbh. This is a "deep hard problem", some refs:

  • https://help.openstreetmap.org/questions/50891/problem-with-rendering-water-from-overpass-data (it's hard, recommending a separate dataset)
  • https://www.reddit.com/r/openstreetmap/comments/jxfo1f/comment/gcxexe0/?utm_source=reddit&utm_medium=web2x&context=3

Possible solutions:

  • https://osmdata.openstreetmap.de/data/water-polygons.html

tmcw avatar Jan 10 '23 04:01 tmcw

I think the solution is going to be the osmdata polygons, and then ignore all coastlines in the osm data, request polys by tile number, clip the polys, voila. Uploaded them to both R2 and S3, for some reason, next steps:

  • [ ] Set up worker to request from R2
  • [ ] Add FlatGeobuf to backend code
  • [ ] Calculate tile numbers on backend
  • [ ] Request & draw

And, maybe, as might be necessary, clip at some stage here to make sure the polygons are not gigantic.

tmcw avatar Jan 11 '23 03:01 tmcw