Skip to main content

All you need to know about geospatial representation

· 5 min read
Guille Gonzalez
Project Leader

The first thing you see when visiting Auravant platform is a map, then drawn fields and layers drawn into it. But, what we need to know and understand about those elements?

thumbnail image

The main tools a developer could offer to the agro world surely are related to maps, images, layers, and processing of this kind of data. Imagine you're a farmer and you need to control more than 500 hectares of farm. You would like to have everything on the mobile screen, wouldn't you?

For sure! You'd like to have monitoring tools at your hand, and you'd like those images with precise information. After all, this is called precision agriculture, right?

That's why I'm gonna give you a starting point so that your extensions will have more to offer.

And who am I to guide you on this?

I'm an Extensions Developer at Auravant. Beginning my path on agro world and extensions my ver first tasks were GeoTIFF images processing, GeoServer data based calculus and agronomic layers representation.

Since then, I've been fascinated with the world of image processing and, more than anything, with making life easier for the farmer.

But wait, none of this can be achieved without a basic knowledge of the subject.

Lets begin...

What is geospatial information?

Basically, geospatial information helps us link a stack of data to a location on Earth (or close to it, but we focus on Earth).

This information could come from many places, such as GPS, satellite images, etc. Will leave that info for another post.

There are several types of geospatial information. However, two of them are the most used. These are Vectorial and Raster.

Vector information is based on geometric shapes, such as points, lines, and polygons, to display geographic objects. Raster information, on the other hand, divides a piece of land into a grid or matrix of pixels.

The main difference is that the Vectorial associates its information to the complete figure, while the Raster associates the information to each of its pixels.

For example, in the following images we have a Vector vs a Raster somewhere in the world.

vectorial raster

The vector can have general information about that piece of land, such as the location, the country, the crop that is planted.

The raster divides that portion of land into pixels, with a certain definition. Each one of these squares is assigned a value of a variable (which could be, for example, NDVI), which informs that in that pixel the value of the variable is X.

So far so good. But, more than likely, you will ask me "how do I use this in my code?". Let's see in what formats this kind of data works.

Representation formats

You have to know that there are several types of file formats for geospatial representation, although here I will only tell you about the main ones that you will see when working with Auravant.

Lets make a list:

Shapefile

Refers to a computer file format. It is a vector format where the location of geographic objects and associated data are stored.

This format is multifile, which means that it is made up of several files. Requires a minimum of 3, defined as follows:

  • .shp - Stores the geometric elements of objects.
  • .shx - Stores the index of geometric elements.
  • .dbf - Stores the information of the associated parameters.

This type of data is especially used for uploading and downloading geographic objects. For example, to create a new batch, you can take a zip file containing an object in Shapefile format

More info: Shapefile Technical Description

GeoJSON

This open representation format can be one of the most used by javascript developers, since it is based on JSON. Represents simple geographic features along with associated properties.

More info: geojson.org

WKT (Well Known Text)

WKT is a syntax (a string) in ASCII format. It is used for spatial objects of vector form.

As it is a string, it is very easy to handle it in javascript objects, within one of the properties. That way we could associate a geographic feature with extra properties.

KML (Keyhole Markup Language)

This format is based on XML for the representation of a geographical object and its associated content. It is the default format used by Google Earth.

KML can contain Raster and Vector type entities.

More info: Kwyhole Markup Language

GeoTIFF

In this case, it is based on the TIFF image file to store the georeferenced information. That is, it is an image that contains metadata necessary for the location of this image in a spatial reference system, as well as attributes or additional information.

More info: GeoTiff

Next steps

Now you have an idea of ​​how georeferenced data types are.

It is normal that at first everything seems complex, however, applying it is simpler than it seems.

Auravant offers several solutions around handling this type of data with the SDK. For javascript there are many libraries that simplify processing (for instance TurfJS, LeafletJS, Open Layers).

Also see GeoServer, a free tool that allows us to view and edit geospatial information, as well as store and consume it.

And this is the end of this post, but don't sit idly by! The best way to consolidate and expand knowledge is by trying. Good luck!