Location Data Standards

All Eratos functions require data types to be in Eratos Standard form. We did not create these standards but chose them as they are the most scalable and generalizable data types for their given class, and believe establishing these standards across our Community will simplify and speed up collaboration and innovation.

The Well-Known Text (WKT) format is the Eratos standard for location data.

In python the WKT format is best managed by Shapely.

WKT Point

A WKT Point defines a physical point on the surface of planet Earth.

The standard form of a WKT Point is as follows: POINT(longitude latitude).
note: there is a space between longitude and latitude, no comma. This is also the inverse to some commonly used location finding services like Google Maps

In python a WKT POINT is defined as a string before Shapely will allow it to be loaded:

from shapely import wkt, geometry

ex_Point = 'POINT(150 -44)'

#Load Point using shapely, check if Point has been correctly defined, raise error otherwise
ex_Point_shape = wkt.loads(ex_Point )
if type(ex_Point_shape ) is not geometry.Point:
        raise ValueError('value inside bottomLeftPoint should be a WKT point')

Create WKT Point for Latitude and Longitude values

Often data frames defining spatial points have two columns, Latitude and Longitude.

The below functions will give users a simple fast solution to convert them into WKT Point, so your data is ready for Eratos functions.

def find_latlng_location_wkt(lat, lng):

     loc = f'POINT ({lng} {lat})'

  return loc