- def toKml(self):
- 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")
- 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")
- coordinates: ET.Element = ET.SubElement(linear_ring, "coordinates")
- points: list[Point] = Hexagon.polygon_corners(self.layout, self.position)
- points.append(points[0])
- method = GeoLocation(self.geoLocation).point_to_geo_location
- geo_locations: list[GeoLocation] = list(map(method, points))
- text: list[str] = []
- for geo_location in geo_locations:
- text.append(
- f"{geo_location.longitude},{geo_location.latitude},{geo_location.aboveMeanSeaLevel}"
- )
- coordinates.text = " ".join(text)
-
- # cells
- cell_angle = self.parent.parent.parent.parent.parent.configuration()["pattern"][
- "o-ran-ru"
- ]["cell-angle"]
- for index in range(int(360 / cell_angle)):
- line: ET.Element = ET.SubElement(multi_geometry, "LineString")
- tessellate: ET.Element = ET.SubElement(line, "tessellate")
- tessellate.text = "1"
- coordinates: ET.Element = ET.SubElement(line, "coordinates")
-
- intersect: Point = Point(
- points[2 * index].x - points[2 * index + 1].x / 2,
- points[2 * index].y - points[2 * index + 1].y / 2,
+ def _create_o_ran_rus(self) -> list[ORanRu]:
+ result: list[ORanRu] = []
+ for index in range(self._o_ran_ru_count):
+ s: str = "00" + str(index)
+ name: str = "-".join(
+ [self.name.replace("Tower", "RU"), s[len(s) - 2 : len(s)]]