Skip to content

Experimental geospatial library (modeled after TURF.js) written in C/WASM. (PSU Schreyer Thesis)

License

Notifications You must be signed in to change notification settings

mbullington/astro-wasm

Repository files navigation

astro-wasm

Experimental geospatial library modeled after Turf.js written in C/WASM.

This project is part of my PSU Schreyer Undergraduate Thesis under Danfeng Zhang, which looks to benchmark and document the performance characteristics of a WASM implemention vs. JS along with GeoJSON decoding/reencoding between JS-WASM.

Note: Not ready for any use.

Progress

Right now I'm implementing different algorithms and assessing their performance vs. Turf.js:

  • area
  • union - Implemented but needs unit tests for correctness.
  • intersect - Implemented but needs unit tests for correctness.
  • difference - Implemented but needs unit tests for correctness.

Chrome

So far with small-n polygons, TURF.js is beating the WASM implementation by consistently ~1,000 ops per second. Next steps here are to build out the bench to test different n complexity of polygons and average them.

Also looking into WASM performance tools to avoid optimizing in the wrong places.

Sources

Turf.js: Included code in LICENSE


Robert. G. Chamberlain and William H. Duquette, "Some Algorithms for Polygons on a Sphere",


Alfred Melch, "Performance comparison of simplification algorithms for polygons in the context of web applications"


Francisco Martinez, Antonio Jesus Rueda, Francisco Ramon Feito, "A new algorithm for computing Boolean operations on polygons. (2008, 2013)

I implemented correctness fixes from w8r/martinez. This are the same changes that were used in TURF.js.

Specifically, I changed third_party/martinez to reflect these changes:

I also made multiple ergonomic changes to the source code.

About

Experimental geospatial library (modeled after TURF.js) written in C/WASM. (PSU Schreyer Thesis)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published