All links to kml 55/13555/1
authorMartin Skorupski <martin.skorupski@highstreet-technologies.com>
Tue, 8 Oct 2024 16:50:16 +0000 (18:50 +0200)
committerMartin Skorupski <martin.skorupski@highstreet-technologies.com>
Tue, 8 Oct 2024 16:50:16 +0000 (18:50 +0200)
- use generic method 'toKml' for folder, placemark, point, and line representation
- fix GeoLocation type issue

Issue-ID: OAM-395
Change-Id: Ic03b3994d09a35ff3507259ece5aa0f39aec029f
Signed-off-by: Martin Skorupski <martin.skorupski@highstreet-technologies.com>
code/network-generator/network_generation/model/python/nr_cell_du.py

index a81bafc..ca46b0b 100644 (file)
@@ -155,8 +155,7 @@ class NrCellDu(ORanNode):
             intersect2
         )
 
-        tower: GeoLocation = GeoLocation(cast(IGeoLocation, self.geo_location))
-        # TODO: Why a cast is required
+        tower = self.geo_location
 
         cell_polygon: list[GeoLocation] = []
         cell_polygon.append(tower)
@@ -205,12 +204,9 @@ class NrCellDu(ORanNode):
         return cell_polygon
 
     def toKml(self) -> ET.Element:
-        placemark: ET.Element = ET.Element("Placemark")
-        name: ET.Element = ET.SubElement(placemark, "name")
-        name.text = self.name
-        style: ET.Element = ET.SubElement(placemark, "styleUrl")
-        style.text = "#" + self.__class__.__name__
-        multi_geometry: ET.Element = ET.SubElement(placemark, "MultiGeometry")
+        nr_cell_du = super().toKml()
+        multi_geometry = nr_cell_du.find('Placemark/MultiGeometry')
+
         polygon: ET.Element = ET.SubElement(multi_geometry, "Polygon")
         outer_boundary: ET.Element = ET.SubElement(polygon, "outerBoundaryIs")
         linear_ring: ET.Element = ET.SubElement(outer_boundary, "LinearRing")
@@ -226,7 +222,7 @@ class NrCellDu(ORanNode):
             ]
             text.append(",".join(strs))
         coordinates.text = " ".join(text)
-        return placemark
+        return nr_cell_du
 
     def toSvg(self) -> ET.Element:
         return ET.Element("to-be-implemented")