location: Difference between revisions

From IndieWeb
(Motion section - capture something here)
(add stationary to motion type, otherwise looks good)
Line 50: Line 50:
Location information may also contain indication about motion, e.g. a person at a location, but in motion, by some method. Such information in practice includes things like:
Location information may also contain indication about motion, e.g. a person at a location, but in motion, by some method. Such information in practice includes things like:
* velocity (perhaps with a specific motion vector in 2 or 3 dimensions)
* velocity (perhaps with a specific motion vector in 2 or 3 dimensions)
* mode of motion / transport (e.g. walking, running, bicycling, driving)
* mode of motion / transport (e.g. walking, running, bicycling, driving, stationary)


== See Also ==
== See Also ==

Revision as of 19:37, 19 December 2014


location is a key aspect of checkin and event posts. It's also sometimes an aspect of posts in general, e.g. where a note or photo/video was posted from. The aspect of location is sometimes referred to as geo for short.

Enabling Technologies

How

How to determine the location of a microformat

To accommodate various different location use-cases, there are multiple places within a microformat structure where location data can be placed. Given a microformat, to determine it’s location:

  • create a stack of property maps where location data might be found, in order of priority
  • for each potential location property, search the stack for a valid property value

In more detail (pseudocode):

  • given a microformat structure mf, to find the location it represents:
  • let location-sources be a list of microformats, containing the following, in this order:
    • mf
    • if mf has a location property which is a microformat, that value
    • if mf has an adr property which is a microformat, that value
    • if mf has a geo property:
      • if the geo property is a microformat, that value
      • else if the geo property is a string, parse it as a geo: URL and append a derived microformat containing the properties of the geo: URL: latitude+longitude if they’re both present, and altitude if it was present
  • for each of the following location properties, search the property map stack in order of priority for a valid value. As soon as one is found, consider that the value. If none are found, the microformat does not have this property
    • street-address
    • extended-address
    • post-office-box
    • locality
    • region
    • postal-code
    • country-name
    • label
    • latitude
    • longitude
    • altitude

Motion

Location information may also contain indication about motion, e.g. a person at a location, but in motion, by some method. Such information in practice includes things like:

  • velocity (perhaps with a specific motion vector in 2 or 3 dimensions)
  • mode of motion / transport (e.g. walking, running, bicycling, driving, stationary)

See Also