Geodirectory

terralego.geodirectory.closest(entry_id, tags=None)

Get the closest entry.

Parameters:
  • entry_id – The id of the entry on which to get the closest one.
  • tags – Optional, a list of tags to filter the entry which can be the closests.
Returns:

A geojson describing the entry as a python dictionnary. Raise 404 if no entry are found.

terralego.geodirectory.closest_from(lat, long, tags=None, dist=None)

Get the closest entry from the point.

Parameters:
  • lat – The latitude of the point.
  • long – The longitude of the point.
  • tags – Optional, a list of tags to filter the entry which can be the closests.
  • dist – Optional, a distance in meters.
Returns:

A geojson describing the entry as a python dictionnary. Raise 404 if no entry are found.

terralego.geodirectory.create_entry(geometry, tags=None)

Create a new entry.

Parameters:
  • geometry – A WKT string representing the geometry of the entry or a dict representing the geojson.
  • tags – A list of string describing the entry. Can be used for filtering later on.
Returns:

A geojson describing the entry as a python dictionnary.

terralego.geodirectory.delete_entry(entry_id)

Delete an entry.

Parameters:entry_id – The id of the entry.
terralego.geodirectory.get_entry(entry_id)

Get an entry.

Parameters:entry_id – The id of the entry.
Returns:A geojson describing the entry as a python dictionnary.
terralego.geodirectory.update_entry(entry_id, geometry, tags=None)

Update an entry.

Parameters:
  • entry_id – The id of the entry.
  • geometry – A WKT string representing the geometry of the entry or a dict representing the geojson.
  • tags – A list of string describing the entry. Can be used for filtering later on.
Returns:

A geojson describing the updated entry as a python dictionnary.