@@ -150,11 +150,26 @@ def do_GET(self):
150150 self .get_collection_id (collection_id , connection , cursor )
151151 return
152152
153+ # /health
154+ elif self .path == '/health' :
155+ send_json_response (self , 200 , {"status" : "ok" })
156+ return
157+
158+ # /conformance
159+ elif self .path == '/conformance' :
160+ self .do_conformance ()
161+ return
162+
163+ # /api (OpenAPI service description)
164+ elif self .path == '/api' :
165+ self .do_api ()
166+ return
167+
153168 # / (home)
154169 elif self .path == '/' :
155170 self .do_home ()
156171 return
157-
172+
158173 def do_POST (self ):
159174 # ==================================================== TEMPORAL PROPERTIES ========================================================
160175 # /collections/{collectionId}/items/{mFeatureId}/tproperties
@@ -240,6 +255,47 @@ def do_home(self):
240255 self .wfile .write (
241256 bytes ("<html><head></head><p>Request: This is the base route of the pyApi</p>body></body></html>" , "utf-8" ))
242257
258+ def do_conformance (self ):
259+ send_json_response (self , 200 , {"conformsTo" : [
260+ "http://www.opengis.net/spec/ogcapi-movingfeatures-1/1.0/conf/common" ,
261+ "http://www.opengis.net/spec/ogcapi-movingfeatures-1/1.0/conf/mf-collection" ,
262+ "http://www.opengis.net/spec/ogcapi-movingfeatures-1/1.0/conf/movingfeatures" ,
263+ "http://www.opengis.net/spec/ogcapi-common-1/1.0/conf/core" ,
264+ "http://www.opengis.net/spec/ogcapi-common-2/1.0/conf/collections" ,
265+ ]})
266+
267+ def do_api (self ):
268+ def op (summary ):
269+ return {"summary" : summary , "responses" : {"200" : {"description" : "OK" }}}
270+
271+ send_json_response (self , 200 , {
272+ "openapi" : "3.0.3" ,
273+ "info" : {"title" : "MobilityAPI" , "version" : "1.0.0" ,
274+ "description" : "OGC API – Moving Features over MobilityDB (PyMEOS)" },
275+ "paths" : {
276+ "/" : {"get" : op ("Landing page" )},
277+ "/api" : {"get" : op ("API definition" )},
278+ "/conformance" : {"get" : op ("Conformance declaration" )},
279+ "/collections" : {"get" : op ("Collections" ), "post" : op ("Register a collection" )},
280+ "/collections/{collectionId}" : {"get" : op ("Collection metadata" ),
281+ "put" : op ("Replace collection" ),
282+ "delete" : op ("Delete collection" )},
283+ "/collections/{collectionId}/items" : {"get" : op ("Moving features" ),
284+ "post" : op ("Insert a moving feature" )},
285+ "/collections/{collectionId}/items/{mFeatureId}" : {"get" : op ("A moving feature" ),
286+ "delete" : op ("Delete feature" )},
287+ "/collections/{collectionId}/items/{mFeatureId}/tgsequence" : {"get" : op ("Temporal geometry (MF-JSON)" ),
288+ "post" : op ("Append a sub-trajectory" )},
289+ "/collections/{collectionId}/items/{mFeatureId}/tgsequence/{tGeometryId}/{query}" :
290+ {"get" : op ("Derived query: distance | velocity (acceleration → 501)" )},
291+ "/collections/{collectionId}/items/{mFeatureId}/tproperties" : {"get" : op ("Temporal properties" ),
292+ "post" : op ("Add temporal properties" )},
293+ "/collections/{collectionId}/items/{mFeatureId}/tproperties/{tPropertyName}" :
294+ {"get" : op ("A temporal property" ), "post" : op ("Append values" ), "delete" : op ("Delete property" )},
295+ "/collections/{collectionId}/bulk" : {"post" : op ("Bulk ingest (extension): GeoJSON / GeoParquet fleet feed" )},
296+ },
297+ })
298+
243299
244300# ________________________________Class Moving Feature Collection_______________________________
245301## Resource Collections
0 commit comments