Map viewers (Part I): Main Open Source libraries

Today we want to bring you a series of blog entries somewhat different from what we are used to: we are going to talk about maps; or rather about the most common libraries that are currently available to represent data with a spatial component. We are sure you are already familiar with that, and also with what you need to do to make your first map.

In this first entry we want to talk about which are these libraries, and in further entries we will explain how to use them and how to generate your first layers with these libraries.

Main libraries

There are as many libraries to make map as there are colors: Lots of them. There are viewers programmed in C#, Java, Python, JavaScript, etc., which can be executed in different environments, including desktop, mobile and web.

Therefore, depending on the purpose we have, we will choose one or another library and environment. But as we cannot talk about all of them -although we would like to- we have decided to limit ourselves to those libraries that:

  • Are developed in JavaScript.
  • Run in browsers.
  • Allow to carry out some spatial analysis.
  • Are Open Source (and therefore, free).

With this we have filtered the possible options, so let’s see which ones we’ll keep.

CesiumJS

We start talking about this library because it is the one we currently use in the Platform’s GIS Viewers, as we have already shown you in the past.

Cesium is an Open Source library, under Apache license, designed to create 2D, 2.5D and 3D maps globally, with good performance, accuracy, visual quality and ease of use.

This library has a great advantage over other options, and that is that it includes native 3D visualization, allowing us to view content in three dimensions, use extruded models, etc. Simplifying a lot, it is the closest to Google Maps that we are going to find.

Preview of Indra’s building in Alcobendas.

Web: https://cesium.com/cesiumjs
GitHub: https://github.com/CesiumGS/cesium

OpenLayers

We give this library the second place because, although we have not yet implemented it in GIS Viewers, we make a fairly widespread use of it in both Products and Projects

Like Cesium, OpenLayers is an Open Source library, with BSD-2 license. This differs mainly with the previous one in that the visualization is exclusively in 2D, although there is a plugin that allows to adapt the Cesium library to give 3D capabilities to OpenLayers.

Being focused on 2D, it has a greater potential in terms of projected coordinate systems, so that, while in Cesium only two coordinate systems are supported (the ones called WGS84 and Pseudo-Mercator), with OpenLayers you can work with almost any coordinate system, either those defined by default or one of your own through PROJ4.

The main advantage of this is that it allows you to work with local geospatial files, focused on a specific area (for example, on the island of El Hierro, using REGCAN95 27N).

The rendering in OpenLayers is generally better than in Cesium.

Web: https://openlayers.org
GitHub: https://github.com/openlayers/openlayers

Leaflet

This library is Open Source too, under BSD-2 license, and is characterized by being much lighter than the two.

Its drawback, as with Cesium, is that it has only four options of projection systems by default, so it is necessary to jury-rig with PROJ4 to represent local data.

This library is perfect to represent your data quickly and easily, without thousands of options making it difficult. Be careful with the order of the coordinates, which here are specified as latitude and longitude, unlike Cesium and OpenLayers, which do it as longitude and latitude.

Although it is a 2D viewer, there are plugins that allow you to enter 3D models or even display an isometric view.

Of those seen so far, this is the one that renders best.

Web: https://leafletjs.com
GitHub: https://github.com/Leaflet/Leaflet

Other libraries

These would be the most common libraries to find and work with, but there are also some marginal libraries that, although they meet the same premises as the previous ones, they are the great unknown barely used.

This would be the case with Polymaps, a very light library but not updated since 2011, or Modest Maps, which is barely 10KB in its minified mode.

In the following posts we will explain how to install and start using these three map viewer libraries: Cesium, OpenLayers and Leaflet.


Do you know any other library that you think should be in this list? Let us know in the comments.

2 Comments

Deja una respuesta

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *