Skip to content

Commit b29cd27

Browse files
feat(routes): texture coordinates route/data/schema
1 parent 31617a4 commit b29cd27

File tree

3 files changed

+56
-0
lines changed

3 files changed

+56
-0
lines changed

src/opengeodeweb_back/routes/blueprint_routes.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,20 @@ def create_point():
304304
200,
305305
)
306306

307+
with open(os.path.join(schemas, "texture_coordinates.json"), "r") as file:
308+
texture_coordinates_json = json.load(file)
309+
310+
@routes.route(
311+
texture_coordinates_json["route"],
312+
methods=texture_coordinates_json["methods"],
313+
)
314+
def texture_coordinates():
315+
DATA_FOLDER_PATH = flask.current_app.config["DATA_FOLDER_PATH"]
316+
utils_functions.validate_request(flask.request, texture_coordinates_json)
317+
data = geode_functions.load(flask.request.json["input_geode_object"], os.path.join(DATA_FOLDER_PATH, flask.request.json["filename"]))
318+
texture_coordinates = data.texture_manager().texture_names()
319+
320+
return flask.make_response({"texture_coordinates": texture_coordinates}, 200)
307321

308322
with open(
309323
os.path.join(schemas, "vertex_attribute_names.json"),
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"route": "/texture_coordinates",
3+
"methods": [
4+
"POST"
5+
],
6+
"type": "object",
7+
"properties": {
8+
"input_geode_object": {
9+
"type": [
10+
"string"
11+
]
12+
},
13+
"filename": {
14+
"type": [
15+
"string"
16+
]
17+
}
18+
},
19+
"required": [
20+
"supported_feature"
21+
],
22+
"additionalProperties": false
23+
}

0 commit comments

Comments
 (0)