Skip to main content

Mojo Modcon (23) contest finalist

· 2 min read
Alex G Rice
Geodata rambler and developer, aka guidorice

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)...

note

The content in this post is from 2023-11-30, before this blog existed.

bounding box
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.

benchmarks image

The GitHub repo https://github.com/guidorice/modcon23-contest has a more detailed writeup, source code, and more benchmark results.

Further reading

edits
  • 2024-09-20 Added explanation of spatial envelope, and inserted QGIS docs figure