GGL2 API for Java and Python
We are pleased to announce that the GGL2 tools are increasing constantly. The newcomer today is an API for Java and Python.
This API allows developers to execute GGL2 processes from their programs with a single call, passing the GGL2 code as a parameter. Thus, Java and Python developers can now run GGL2 algorithms using their own language easily.
In order to use this API, GGL2 must be installed and the installation directory specified before executing GGL2 code. Then, the execute call will run the GGL2 code and will return normally if the process finishes successfully or will throw an exception if anything fails. Different exceptions will be thrown depending on whether the error has been a GGL2 compilation error, a GGL2 execution error or any other unexpected error.
For Java developers, the GGL2 API is available with and without Maven. In the end, the necessary jars must be included in the classpath and then a simple program like this example can be executed:
import org.gearscape.ggl.GGL2; public class Main { public static void main(String[] args) throws Exception { GGL2 ggl2 = new GGL2("/home/victorzinho/bin/ggl"); ggl2.execute("show 'Hello World!';"); } }
For Python developers the module containing the GGL2 API must be imported. The previous example can be executed as follows:
import GGL2 GGL2.location = '/home/user/bin/ggl' GGL2.execute("show 'Hello World!';")
There is a complete tutorial on how to configure and use the API with both Java and Python in [1].
—–
Do you have a project idea and want to turn it into reality? We would like to hear from you, tell us about it
The facts define us
-
Real-time public transportation visualization
https://vimeo.com/540079821/ Real-time visualization for the Barcelona metro and bus services Since 2016, Geomatico has been working with the Barcelona public transport agency (Transports Metropolitans de Barcelona, TMB) for GIS development…
-
Beyond vector tiles: Mapbox, MapLibre or DeckGL for my 3D map?
Unfortunately, there is no magic recipe for this answer, but this post will discuss in depth the pros and cons of vector tiles, Mapbox, MapLibre and DeckGL. Geomatico is a…
-
Irriter: precision irrigation visualization
http://vimeo.com/736100341 Software development for precision irrigation Irriter is an information system to help the irrigators of the Baix Ter. It is based on crop information, soil type and satellite imagery…
-
Serverless rasters in MapLibre: the COG protocol extension
After our talk at FOSS4G about vector tiles and Deck.gl, an audience member raised an interesting question: we have the tools to publish and analyze vector data directly in the…