Skip to content

Instantly share code, notes, and snippets.

@donpdonp
Forked from aaronpk/json format for geo data
Created May 22, 2010 03:37
Show Gist options
  • Save donpdonp/409734 to your computer and use it in GitHub Desktop.
Save donpdonp/409734 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: {
geojson: { "type": "Point",
"coordinates": [11.0, 61.0] }
}
}
},
{
uuid: "550e8400-e29b-41d4-a716-446655440001",
date: "2010-04-30T16:50:00Z",
location: {
position: {
geojson: { "type": "Point",
"coordinates": [101.0, 50.0] }
}
}
}
]
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: {
geojson: { "type": "Point",
"coordinates": [45.5, -122.636] }
altitude: null,
heading: 190,
speed: 56,
horizontal_accuracy: 6.0
vertical_accuracy: 75.0
}
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....
},
geo_json: {
"type": "Polygon",
"coordinates": [
[ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ],
[ [100.2, 0.2], [100.8, 0.2], [100.8, 0.8], [100.2, 0.8], [100.2, 0.2] ]
]
}
}
},
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