LocationPlan

The structure of a location
In the abstract, we may choose to define a location as:


 * point: latitude/longitude combination (decimal, to save our sanities); OR
 * named place: a place with an extent larger than a point, listed in Geonames, and referenced by its Geonames ID; OR
 * OSM object: a node, way, or area existing in the extensive, community-contributed OpenStreetMap database

We could extend this to encompass one or more of these concepts:


 * fuzzed point: a point which has been slightly offset in a random way to respect privacy
 * line: a sequential series of points not ending at the starting point (e.g. walking tracks)
 * area: a sequence of points which close at the starting point, defining an inner extent (e.g. forests)

The practicality of posting notices with accurate instances of the last two forms is in doubt.

It seems wise to begin an implementation representing locations according to the simpler first three definitions.

Database tables and the classes they represent will require fields/properties for latitude and longitude. We also want one field for a Geonames ID and one each for OSM object ID and type (TODO: find out if OSM IDs can determine object type). It is unlikely that for a given location, both a Geonames and OSM ID will be provided, but normalisation issues are a side issue at this point. Lat/long, however, should always be stored redundantly where one of these IDs is provided, to speed up renderings.


 * from http://mail.laconi.ca/pipermail/laconica-dev/2009-April/001225.html:
 * We'll enhance the profile table (and corresponding class) with three location fields: latitude, longitude, and Geonames ID. Geonames is a geographic thesaurus -- it maps multiple names of a place to a single numeric ID. This is an efficient way to store information about a place much bigger than a single point. For example, setting your location to &quot;Dallas&quot; will set lat and long to 32.78306 &amp;amp; -96.80667, and geonameid = 4684888. Geonames's database is available gratis under a CC-By license, btw. Lots of freedom there.
 * We'll enhance the notice table (and corresponding class) with the same three location fields. When a new notice is saved, we'll save the current value of the three fields from the profile into the notice. So, if you dented from Cairo, but you're now back in Des Moines, we'll know where that dent actually happened.