Skip to content

NotesLayers

ischneider edited this page Jan 31, 2012 · 8 revisions

Design

See [https://github.com/opengeo/mapstory/wiki/Design#wiki-notes](design wiki page) for details.

Schema

Tentative revised schema (2012-01-31)

Events layers have a fixed schema:

  • title: String, not null
  • description: String, not null
  • the_geom: String
  • start_time: long
  • end_time: long
  • in_timeline: boolean
  • in_map: boolean
  • appearance: String

Note: The start_time and end_time are the number of seconds before or after the era. This allows us to support an extended time range. A javascript Date can be obtained by new Date(seconds * 1000). When updating the annotations layer, the appropriate value can be obtained by date.getTime() / 1000.

Layer Creation

The MapStory branch of GeoNode (https://github.com/opengeo/geonode/tree/mapstory) already has a service to allow authenticated users to create layers. It currently expects a form POST request at /data/create_annotations_layer/<mapid>. No other data is required. A 404 error will occur if the map object cannot be found. A 401 will occur if the map object owner is not the current user.

The HTTP response will otherwise be a 'standard' JSON response object with status 200. This object will contain a boolean success property and an array errors property. For example:

{ success : 'false', errors : ['Specified store "blah" not found'] }

The name of the created layer will be _map_<id>_annotations.

Clone this wiki locally