|
21 | 21 | from opengeodeweb_back.geode_objects import geode_objects |
22 | 22 | from opengeodeweb_back.geode_objects.types import geode_object_type |
23 | 23 | from opengeodeweb_back.geode_objects.geode_mesh import GeodeMesh |
| 24 | +from opengeodeweb_back.geode_objects.geode_grid2d import GeodeGrid2D |
| 25 | +from opengeodeweb_back.geode_objects.geode_grid3d import GeodeGrid3D |
24 | 26 | from opengeodeweb_back.geode_objects.geode_surface_mesh2d import GeodeSurfaceMesh2D |
25 | 27 | from opengeodeweb_back.geode_objects.geode_surface_mesh3d import GeodeSurfaceMesh3D |
26 | 28 | from opengeodeweb_back.geode_objects.geode_solid_mesh3d import GeodeSolidMesh3D |
@@ -267,6 +269,25 @@ def vertex_attribute_names() -> flask.Response: |
267 | 269 | 200, |
268 | 270 | ) |
269 | 271 |
|
| 272 | +@routes.route( |
| 273 | + schemas_dict["cell_attribute_names"]["route"], |
| 274 | + methods=schemas_dict["cell_attribute_names"]["methods"], |
| 275 | +) |
| 276 | +def cell_attribute_names() -> flask.Response: |
| 277 | + json_data = utils_functions.validate_request( |
| 278 | + flask.request, schemas_dict["cell_attribute_names"] |
| 279 | + ) |
| 280 | + params = schemas.PolygonAttributeNames.from_dict(json_data) |
| 281 | + geode_object = geode_functions.load_geode_object(params.id) |
| 282 | + if not isinstance(geode_object, GeodeGrid2D | GeodeGrid3D): |
| 283 | + flask.abort(500, f"{params.id} is not a GeodeGrid") |
| 284 | + cell_attribute_names = geode_object.cell_attribute_manager().attribute_names() |
| 285 | + return flask.make_response( |
| 286 | + { |
| 287 | + "cell_attribute_names": cell_attribute_names, |
| 288 | + }, |
| 289 | + 200, |
| 290 | + ) |
270 | 291 |
|
271 | 292 | @routes.route( |
272 | 293 | schemas_dict["polygon_attribute_names"]["route"], |
|
0 commit comments