OSCP Spatial Content Discovery using FastAPI and Tile38.
Update of OSCP Spatial Service Discovery to support prototype development in the MSF Real/Virtual World Inte gration Working Group. Adapted from FastAPI-Tile38.
- Clone and install
git clone https://github.com/OpenArCloud/SCD-FastAPI-Tile38.git cd SCD-FastAPI-Tile38 poetry install
- Setup environment
cp .env.dist .env
- Start your local stack
docker-compose up
Once the application is started you can checkout and interact with it via on localhost:8002/docs.
Or you can use it with http/curl:
echo '{ "data": { "type": "Feature", "geometry": {"type": "Point", "coordinates": [-1.472761207099694,50.93965177660982]}, "properties": {"id": "uuid1", "content":[{"geopose": {"position": {"lat": 50.93965177660982, "lon": -1.472761207099694, "h": 1000}, "quaternion": {"x": 0.0, "y": 0.0, "z": 0.0, "w": 0.0}},
"metatype": "model3D", "contenttype": "model/gltf+json", "description": "test model","url": "http://path_to_model", "tags": {"name1": "value1", "name2": "value2"}}]}}}' \
| http post http://localhost:8002/scr x-api-key:test
HTTP/1.1 201 Created
content-length: 34
content-type: application/json
date: Mon, 03 Feb 2025 03:00:50 GMT
server: uvicorn
{
"elapsed": "3.054657ms",
"ok": true
}
http get http://localhost:8002/search/nearby lat==50.937876 lon==-1.471582 radius==1000 x-api-key:test
HTTP/1.1 200 OK
content-length: 490
content-type: application/json
date: Mon, 03 Feb 2025 03:02:45 GMT
server: uvicorn
{
"data": [
{
"distance": 214.04799872062975,
"id": "uuid1",
"object": {
"geometry": {
"coordinates": [
-1.472761207099694,
50.93965177660982
],
"type": "Point"
},
"properties": {
"content": [
{
"contenttype": "model/gltf+json",
"description": "test model",
"geopose": {
"position": {
"h": 1000.0,
"lat": 50.93965177660982,
"lon": -1.472761207099694
},
"quaternion": {
"w": 0.0,
"x": 0.0,
"y": 0.0,
"z": 0.0
}
},
"metatype": "model3D",
"tags": {
"name1": "value1",
"name2": "value2"
},
"url": "http://path_to_model"
}
],
"id": "uuid1"
},
"type": "Feature"
}
}
]
}
Distributed under the MIT License. See LICENSE
for more information.