Skip to content

Commit a1d49d2

Browse files
committed
point_set instead of point
1 parent 6b59701 commit a1d49d2

6 files changed

Lines changed: 11 additions & 90 deletions

File tree

opengeodeweb_back_schemas.json

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,6 @@
11
{
22
"opengeodeweb_back": {
33
"create": {
4-
"point": {
5-
"$id": "opengeodeweb_back/create/point",
6-
"route": "/point",
7-
"methods": [
8-
"POST"
9-
],
10-
"type": "object",
11-
"properties": {
12-
"name": {
13-
"type": "string",
14-
"minLength": 1
15-
},
16-
"x": {
17-
"type": "number"
18-
},
19-
"y": {
20-
"type": "number"
21-
},
22-
"z": {
23-
"type": "number"
24-
}
25-
},
26-
"required": [
27-
"name",
28-
"x",
29-
"y",
30-
"z"
31-
],
32-
"additionalProperties": false
33-
},
344
"point_set": {
355
"$id": "opengeodeweb_back/create/point_set",
366
"route": "/point_set",
@@ -74,6 +44,7 @@
7444
"additionalProperties": false
7545
}
7646
},
47+
"models": {},
7748
"vertex_attribute_names": {
7849
"$id": "opengeodeweb_back/vertex_attribute_names",
7950
"route": "/vertex_attribute_names",

src/opengeodeweb_back/routes/create/blueprint_create.py

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -16,28 +16,6 @@
1616
schemas_dict = get_schemas_dict(os.path.join(os.path.dirname(__file__), "schemas"))
1717

1818

19-
@routes.route(
20-
schemas_dict["point"]["route"],
21-
methods=schemas_dict["point"]["methods"],
22-
)
23-
def point() -> flask.Response:
24-
"""Endpoint to create a single point in 3D space."""
25-
json_data = utils_functions.validate_request(flask.request, schemas_dict["point"])
26-
params = schemas.Point.from_dict(json_data)
27-
28-
# Create the point
29-
pointset = GeodePointSet3D()
30-
builder = pointset.builder()
31-
builder.set_name(params.name)
32-
builder.create_point(opengeode.Point3D([params.x, params.y, params.z]))
33-
34-
# Save and get info
35-
result = utils_functions.generate_native_viewable_and_light_viewable_from_object(
36-
pointset
37-
)
38-
return flask.make_response(result, 200)
39-
40-
4119
@routes.route(
4220
schemas_dict["point_set"]["route"],
4321
methods=schemas_dict["point_set"]["methods"],
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
from .point import *
21
from .point_set import *

src/opengeodeweb_back/routes/create/schemas/point.json

Lines changed: 0 additions & 22 deletions
This file was deleted.

src/opengeodeweb_back/routes/create/schemas/point.py

Lines changed: 0 additions & 13 deletions
This file was deleted.

src/opengeodeweb_back/routes/create/schemas/point_set.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,21 @@
22
from dataclasses import dataclass
33
from typing import List
44

5+
56
@dataclass
6-
class PointXYZ(DataClassJsonMixin):
7+
class Point(DataClassJsonMixin):
8+
def __post_init__(self) -> None:
9+
print(self, flush=True)
10+
711
x: float
812
y: float
913
z: float
1014

15+
1116
@dataclass
1217
class PointSet(DataClassJsonMixin):
18+
def __post_init__(self) -> None:
19+
print(self, flush=True)
20+
1321
name: str
14-
points: List[PointXYZ]
22+
points: List[Point]

0 commit comments

Comments
 (0)