Issue #25: Special about Geo

Issue #25: Special about Geo

GIS is a very fascinating topic, and the one I wish I had more specialized knowledge of. I was recently reading an article by Vladimir Agafonkin (author of Leaflet) on coming up with a better algorithm to find the visual center of a polygon. This lead me to look for articles and information on what is available on that topic in the Elm land. Unfortunately, not much. But let's see what there is and what is still missing. This week it's a special issue of Elm Bits about GIS.

Just last week I mentioned Ian Mackenzie and the 1.0.0 release of his 3D rendering engine for Elm. Ian is the most active person that works in the domains adjacent to GIS. Take a look at his Github. Here are a few:

A while ago Ian was on the Elm Town podcast, episode 49 where he talked about his work, how he got into Elm, packages he created, and many other things.

When we talk about maps, probably the first few that come to mind are Google Maps, and Open Street Map. A lot of folks have also heard about Mapbox. There is gampleman/elm-mapbox that allows you to use MapboxGl (via ports) from Elm. And of course you can embed Google Maps in your app via PaackEng/elm-google-maps. If you're new to Elm and ports, there is a nice and simple article by Moremi Vannak that explains how to embed Google maps into your website through ports. Combine it with billstclair/elm-geolocation and you will be able to show approximate user's location on the map.

During the Elm-Conf 2017 Jonas Coch gave a talk on building interactive maps in Elm. How do you add markers, how to create layers, use ports, display heat maps, and use GeoJSON. It's a short talk worth watching:

Building a Slippy Map Library in Pure Elm

While looking at the information available on this topic, I stumbled upon Voronchuk/hexagons and etaque/elm-hexagons both of which implement hexagonal grids. If you're like me and never heard of these, it's a grid built of hexagons (well, obviously):

Courtesy of redblobgames.com

You can navigate within this grid using coordinates, calculate distances, paths, neighbours. Essentially this is a map. Hexagonal grids are used in some games, e.g. for building a terrain. Or board games like settlers of Catan. Amit Patel has an in-depth explanation of the concept and how to transform and navigate through the hexagonal space along with a list of other types of grids.

For working with various units, there's a package from Ian Mackenzie called elm-units which contains not only GIS-related units, but lots of others too, e.g. lumens for light, moles for sunstance concentration, joules and newtons for energy, and many more. Max Goldstein has built a parser for GeoJSON to make it easy to import this data and render on map. For data types like bounding box, points, and a handful of others, Jakub Hampl has created elm-geospatial.

Jakub is the person behind the amazing gampleman/elm-visualization (and elm-mapbox mentioned above). He gave a talk about geospatial analysis on Elm Europe last year:

Geospatial Analysis

My dive into this topic started with frustration on how little there is prior work for a beginner to build something interesting, however at the end of the day I think there is enough of building blocks and helpful information to be able to use Elm for building geospatial apps. Maybe not as easily as you could in pure JavaScript (with the abundance of libraries and tools), but it's not that bad either.

And to finish off this issue with a great quote from Barack Obama:

The study of geography is about more than just memorizing places on a map. It's about understanding the complexity of our world.
Show Comments