]> marstr Code Repo - orthographic-api/summary
 
descriptionSource code of the API to acquire OSM data for my Python tool Orthographic
last changeTue, 27 Aug 2024 10:59:24 +0000 (12:59 +0200)
shortlog
2024-08-27 MarStrCorrected an issue which would write actual latitude... master
2024-08-19 MarStrAdded readme
2024-08-19 MarStrInitial commit with PHP script
heads
3 weeks ago master
Description
Orthographic API
A small PHP script offering an API endpoint to my (upcoming) Orthographic Python tool, to acquire OpenStreetMap XML files and its associated data. While the Orthographic tool (which will be posted in my repository as well) manages the access to this API automatically, I am still posting this script here to show how the tool acquires the OSM data.
In addition, using this approach eliminates the need for any Orthographic user to store huge amounts of OSM data in a local cache folder - instead all of these files are stored on my server.
Should a specific OSM tile for Orthographic be older than 30 days, it will be re-acquired and refreshed to always have up to date information.
Endpoint
https://marstr.online/osm/v1/
Method: POST
Content
A short JSON specifiying the bounding box and the Orthographic tile. This is automatically populated by the Python tool and sends it to this endpoint.
Example:
{
"bbox": {
"lat": 51,
"lng": 7,
"lat_b": 51.0101,
"lng_b": 7.016
},
"tile_lat": 51,
"tile_lng": 7,
"square_lat": 1,
"square_lng": 1
}
Result
The response is the content of the acquired OSM data, in XML format. Orthographic will process the content of this data further.