Mojo Modcon (23) contest finalist
In November 2023 I was the #6 finalist in the ModCon23 contest for the new programming language, Mojo🔥. Calculating an envelope is a fundamental part of spatial analysis. The envelope (aka: bounds, bbox, mbr) is usually defined by an xmin, ymin, xmax, and ymax representing the minimum and maximum x (longitude) and y (latitude) coordinates that encompass the bounded feature(s)...
The content in this post is from 2023-11-30, before this blog existed.
Figure attribution: QGIS documentation: Fig. 27.53 Black lines represent the bounding boxes of
each polygon feature.
What is Mojo
Mojo is a new programming language that bridges the gap between research and production by combining Python syntax and ecosystem with systems programming and metaprogramming features. Mojo is still young, but it is designed to become a superset of Python over time. source: Mojo docs
Contest submission
Calculates the spatial envelope, and explores the performance of Python, NumPy, and Mojo. The Mojo final implementation is 20X to 600X faster than Python, and 1.3X to 4X faster than NumPy.
The GitHub repo https://github.com/guidorice/modcon23-contest has a more detailed writeup, source code, and more benchmark results.
Further reading
- Announcement of all the winners in Modverse weekly #11
- Mojo GitHub https://github.com/modularml/mojo
- Mojo and MAX engine docs
- 2024-09-20 Added explanation of spatial envelope, and inserted QGIS docs figure