Skip to content

Commit

Permalink
LGVISIUM-102: remove redundant layer.id from predictions.json
Browse files Browse the repository at this point in the history
  • Loading branch information
stijnvermeeren-swisstopo committed Nov 19, 2024
1 parent 67e85e0 commit 3b8f8a8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
4 changes: 1 addition & 3 deletions README.predictions-json.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ Each key in the JSON object is the name of a PDF file. The extracted data is lis
- `layers`: a list of objects, where each object represents a layer of the borehole profile, using the following keys:
- `material_description`: the text of the material description, both as a single value as well as line-by-line, and the location in the PDF where the text resp. the lines where extracted from.
- `depth_interval`: the measured depth of the upper and lower limits of the layer, and the location in the PDF where they were extracted from.
- `id`: a unique identifier.
- `bounding_boxes`: a list of objects, one for each (part of a) borehole profile in the PDF, that list some bounding boxes that can be used for visualizations. Each object has the following keys:
- `sidebar_rect`: the area of the page the contains a "sidebar" (if any), which contains depths or other data displayed to the side of material descriptions.
- `depth_column_entries`: list of locations of the entries in the depth column (if any).
Expand Down Expand Up @@ -87,8 +86,7 @@ All bounding boxes are measured with PDF points as the unit, and with the top-le
"value": 6.0,
"rect": [201.62551879882812, 374.30560302734375, 210.0361328125, 380.828857421875]
}
},
"id": "2b841b12-1f8d-4845-a873-0916b2a09420"
}
},
# ... (more layers)
],
Expand Down
5 changes: 1 addition & 4 deletions src/stratigraphy/layer/layer.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"""Layer class definition."""

import uuid
from dataclasses import dataclass, field
from dataclasses import dataclass

import fitz
from stratigraphy.data_extractor.data_extractor import ExtractedFeature, FeatureOnPage
Expand All @@ -17,7 +16,6 @@ class Layer(ExtractedFeature):

material_description: FeatureOnPage[MaterialDescription]
depth_interval: AAboveBInterval | None
id: uuid.UUID = field(default_factory=uuid.uuid4)

def __str__(self) -> str:
"""Converts the object to a string.
Expand All @@ -39,7 +37,6 @@ def to_json(self) -> dict:
return {
"material_description": self.material_description.to_json() if self.material_description else None,
"depth_interval": self.depth_interval.to_json() if self.depth_interval else None,
"id": str(self.id),
}

@classmethod
Expand Down

0 comments on commit 3b8f8a8

Please sign in to comment.