GeoSpatial Indexer for CouchDB 2.0
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
c_src/easton_index
constants
src
test
.gitignore
LICENSE
README.md
TODO.md
rebar.config

README.md

Easton - External port based spatial indexing

This application implements a spatial indexing port program as well as an API to that program for use by other Erlang applications.

Source files

Easton consists of the following Erlang source files:

  • easton.app.src - application resource file
  • easton_constants.hrl - header file defining error codes and directory locations
  • easton_geojson.erl - set of routines to convert between WKB (Well Known Binary - an open binary format for portably representing geospatial data) and JSON
  • easton_geojson.hrl - header file for above
  • easton_index.erl - takes index operating requests from hastings and passes them through to the C++ based spatial index, search/query and re-projection routines

Easton also consists of the following C++ source files:

  • command.cc - provides multiple easton commands for execution, including "get information of index", "synchronize index", "close index", "search against Geo entries", "remove or update entry", "put, get or delete user’s key and value".
  • epsg.cc - optimisation to reduce reliance on slow to initialise CSMap routines.
  • geo.cc - various geospatial operations, including implementation of relations and circle and ellipse queries.
  • index.cc - create, manage and use index by leveraging C APIs provided by libspatialindex, and encapsulate Geo entry using SpatialEntry, TemporalEntry, HistoricalEntry and TopHits.
  • init.cc - initial routines for signals, csmap, pid, etc.
  • io.cc - io routines for port comms and wrapper around LevelDB (used for storing data about the index)
  • main.cc - creates index objects, creation includes several checks done by geo.cc, however those checks are only caught at the very top level of easton_index and means uninformative error messages are passed back to the user. See FB case 57954 (https://cloudant.fogbugz.com/f/cases/57954/Error-messages-on-invalid-EPSG-code-specified-in-design-document-not-useful-to-users)
  • reproject.cc - performs reprojection of geometries. Done by libgeos.

and the following relevant header files:

  • config.hh - defines constants of easton, including index type, command name, filter type, error code.
  • easton.hh - defines constants for namespace of "easton", "cmd", "geo" and "io".
  • exceptions.hh - defines exceptions thrown by easton_index process, these should find their way either to logs or to the user. Exceptions defined for index errors, geo errors easton errors and easton exits.

Logs

The easton_index executable generates some log messages that find their way to splunk as well as errors that find their way back to the user. As noted above some of these messages are vague.

Metrics

Easton does not generate metrics, all geospatial metrics are generated by hastings.