Skip to content

Instantly share code, notes, and snippets.

@hackervera
Forked from aaronpk/json format for geo data
Created July 30, 2010 04:11
Show Gist options
  • Save hackervera/499885 to your computer and use it in GitHub Desktop.
Save hackervera/499885 to your computer and use it in GitHub Desktop.
Common minimal format for sending just lat/long data
[
{
uuid: "550e8400-e29b-41d4-a716-446655440000",
date: "2010-04-30T16:50:00Z",
location: {
position: {
latitude: 45.5118,
longitude: -122.6433
}
},
client: {
name: "Geoloqi",
version: "0.1",
platform: "iPhone OS 4"
}
},
{
uuid: "550e8400-e29b-41d4-a716-446655440001",
date: "2010-04-30T16:50:00Z",
location: {
position: {
latitude: 45.5128,
longitude: -122.6435
}
},
client: {
name: "Geoloqi",
version: "0.1",
platform: "iPhone OS 4"
}
}
]
Full data format allowing custom information to be included based on source of location data
[{
uuid: "550e8400-e29b-41d4-a716-446655440000",
date: "2010-04-30T16:50:00Z", (iso8601 format)
location: {
position: {
latitude: 45.5118,
longitude: -122.6433,
geojson: {
type: "Polygon",
coordinates: [[-122.643, 45.512], [-122.650, 45.512], [-122.643, 45.533], [-122.650, 45.533]]
},
altitude: null,
heading: 190,
speed: 56,
horizontal_accuracy: 6.0,
vertical_accuracy: 8.0 (in meters)
}
source: "hardware_gps,wifi,street_address,agps,twitter,foursquare,geomena"
type: "latlng,address,neighborhood,city",
raw: (from hardware gps device) {
dop_h: 2.7,
dop_v: 2.1,
satellites: []
},
raw: (from wifi positioning) {
aps: []
}
raw: (from twitter) {
id: "103994853",
created_at: "Tue Apr 07 22:52:51 +0000 2009",
text: "At least I can get your humor through tweets. RT @abdur: I don't mean this in a bad way, but genetically speaking your a cul-de-sac.",
source: "<a href="http://www.tweetdeck.com/">TweetDeck</a>",
....etc....
}
},
client: {
name: "Geoloqi",
version: "0.1",
platform: "iPhone OS 4",
other: "whatever"
},
environment: {
air_temperature: {
celsius: 20.3
},
humidity: {
percent: 80
},
sound_pressure_level: {
pascals: 10
}
},
body: {
heart_rate: {
bpm: 100
},
core_temperature: {
celsius: 25
}
}
}]
Format for querying positions of multiple users:
[{
user: {
id: "http://aaron.pk",
display_name: "aaronpk",
url: "http://aaronparecki.com",
image_url: "http://aaron.pk/pic.jpg"
},
data: []
},
{
user: {
id: "@caseorganic",
display_name: "caseorganic",
url: "http://oakhazelnut.com",
image_url: "http://a1.twimg.com/profile_images/116264220/kk-caseorganic-48px.jpg"
},
data: []
}]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment