Reference¶
ImxObject
¶
Represents an object within an IMX file.
Info
This class is used to encapsulate the data and functionality for an object within an IMX file. It contains attributes parsed from the XML element representing the object, and methods to manipulate and query the object. In the future we will add specific domain objects like TrackAssets, RailConnections ect.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
element |
_Element
|
The XML element representing the object. |
required |
imx_file |
ImxFile
|
The IMX file associated with the object. |
required |
parent |
Optional[ImxObject]
|
The parent ImxObject of the object. Defaults to None. |
None
|
Attributes:
Name | Type | Description |
---|---|---|
element |
_Element
|
Returns the XML element representing the object. |
tag |
str
|
Returns the tag of the XML element. |
path |
str
|
Returns the path of the object within the XML structure. |
name |
str
|
Returns the name attribute of the XML element. |
puic |
str
|
Returns the puic attribute of the XML element. |
geometry |
LineString | Point | Polygon | MultiLineString | MultiPoint | MultiPolygon | GeometryCollection
|
Object geometer |
geographic_location |
ImxGeographicLocation | None
|
Returns the geographic location associated with the object. |
get_imx_property_dict(add_extension_properties=True, add_parent=True, add_children=True, add_geometry=False)
¶
Retrieve a dictionary containing IMX properties, including the tag, path, properties, and optionally extension properties and geometry. Args: add_extension_properties : A dictionary of additional extension properties to include in the result. add_parent: Includes the parent puic in the result. add_children: Includes all puics of children in the result. add_geometry: Includes string representing geometry data in the result. Returns: A dictionary with 'keys' 'values' of all interesting imx properties
extend_imx_object(imx_extension_object)
¶
Extends the current ImxObject with another ImxObject.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
imx_extension_object |
ImxObject
|
The ImxObject to extend with. |
required |
lookup_tree_from_imx_file(imx_file)
classmethod
¶
lookup_tree_from_element(element, imx_file)
classmethod
¶
Generates a lookup tree from a specific XML element within an IMX file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
element |
_Element
|
The XML element to start building the lookup tree from. |
required |
imx_file |
ImxFile
|
The IMX file associated with the XML element. |
required |
Returns:
Type | Description |
---|---|
list[ImxObject]
|
List[ImxObject]: The lookup tree generated from the XML element. |
ImxGeographicLocation
dataclass
¶
Represents a geographic location with attributes parsed from an XML element.
Attributes:
Name | Type | Description |
---|---|---|
shapely |
Point | LineString | Polygon
|
The Shapely geometric representation of the location. |
azimuth |
Optional[float]
|
The azimuth of the location, if available. |
data_acquisition_method |
Optional[str]
|
The method used to acquire the geographic data. |
accuracy |
Optional[float]
|
The accuracy of the geographic data. |
srs_name |
Optional[str]
|
The spatial reference system name. |
from_element(element)
staticmethod
¶
Create an ImxGeographicLocation instance from an XML element.
Info
This method parses geographic location data from the given XML element and creates an instance of ImxGeographicLocation with the parsed data.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
element |
Element
|
The XML element to parse. |
required |
Returns:
Type | Description |
---|---|
Optional[ImxGeographicLocation]
|
Optional[ImxGeographicLocation]: An instance of ImxGeographicLocation if the element contains |
Optional[ImxGeographicLocation]
|
geographic location data, otherwise None. |