All routes are under the lh-places/v1 namespace.
GET /geojson/{id}
This route is public. It returns one published post as a GeoJSON Feature whose properties are id, title, url and address. A post that is not published, or has no geodata, returns 404.
{
"type": "Feature",
"geometry": { "type": "Point", "coordinates": [144.9631, -37.8136] },
"properties": {
"id": 42,
"title": "Melbourne CBD",
"url": "https://example.com/melbourne-cbd/",
"address": "Swanston St, Melbourne VIC 3000"
}
}
GET /geojson
This route is public. It returns a FeatureCollection of published posts that have geodata, with the same properties on each feature.
| Parameter | Default | Notes |
|---|---|---|
post_type |
post | Post type to query. |
posts_per_page |
50 | Capped at 500. |
category |
none | Category ID. |
post_status |
publish | Accepted but ignored. Only published posts are returned. |
GET /attachment-exif-gps/{id}
This route backs Import from media and requires edit_post on the post. It returns latitude, longitude, attachment_id and attachment_title for the first image attached to post {id} that has usable EXIF GPS data. Out-of-range coordinates, and 0,0, are treated as missing.
