RandomFractals / geo-data-viewer

Geo Data Analytics tool for VSCode IDE with kepler.gl support to generate and view maps πŸ—ΊοΈ without any Python 🐍, IPyWidgets βš™οΈ, pandas 🐼, Jupyter notebooks πŸ“š, or ReactJS βš›οΈ app code.
https://marketplace.visualstudio.com/items?itemName=RandomFractalsInc.geo-data-viewer
Apache License 2.0
404 stars 43 forks source link

Add hex well known binary format support (.wkb) #138

Open ninok opened 2 years ago

RandomFractals commented 2 years ago

@ninok These changes look good. So, this PR is for binary well known format support? https://en.wikipedia.org/wiki/Well-known_text_representation_of_geometry

Could you link me to some public geo datasets in .wkb format I could use for testing and adding samples to ./data examples folder?

Thanks for contributing these changes!

ninok commented 2 years ago

Thanks for review @RandomFractals!

You are correct that these changes are for well known binary encoded in hex string (i.e. that's why I pass {hex: true} to wkbFormat.readFeatures). I also updated the PR title to make it more clear.

This format is basically what you get from PostGIS when not converting the geometry to text, e.g.:

SELECT 'POLYGON((10.689 -25.092, 34.595 -20.170, 38.814 -35.639, 13.502 -39.155, 10.689 -25.092))'::geometry;

gives you

0103000000010000000500000054E3A59BC4602540643BDF4F8D1739C05C8FC2F5284C4140EC51B81E852B34C0D578E926316843406F1283C0CAD141C01B2FDD2406012B40A4703D0AD79343C054E3A59BC4602540643BDF4F8D1739C0

Is this enough for testing? I can also add this file to this PR. Are there some automated test where this file would be used or is it just for quick mannual testing?