+ scaled_polygon: ET.Element = ET.SubElement(multi_geometry, "Polygon")
+ scaled_outer_boundary: ET.Element = ET.SubElement(scaled_polygon, "outerBoundaryIs")
+ scaled_linear_ring: ET.Element = ET.SubElement(scaled_outer_boundary, "LinearRing")
+ scaled_coordinates: ET.Element = ET.SubElement(scaled_linear_ring, "coordinates")
+
+ arc: float = self.azimuth * math.pi / 180
+ meterToDegree: float = 2 * math.pi * GeoLocation().equatorialRadius / 360
+ translateX: float = (
+ self.layout.size.x
+ * (self.cell_scale_factor / 100)
+ * math.sin(arc)
+ )
+ translateY: float = (
+ self.layout.size.y
+ * (self.cell_scale_factor / 100)
+ * math.cos(arc)
+ )
+ centerX: float = self.layout.size.x * 0.5 * math.sin(arc)
+ centerY: float = self.layout.size.y * 0.5 * math.cos(arc)
+ cell_center : GeoLocation = GeoLocation(
+ {
+ "latitude": tower.latitude + centerY / meterToDegree,
+ "longitude": tower.longitude + centerX / meterToDegree,
+ "aboveMeanSeaLevel": tower.aboveMeanSeaLevel,
+ }
+ )
+ point_index: int = 0
+ text = []
+ for gl in cell_polygon:
+ scale: float = 1 + self.cell_scale_factor / 100
+ lng_new: float = ( 1 * scale * (gl.longitude - cell_center.longitude) ) + cell_center.longitude
+ lat_new: float = ( 1 * scale * ( gl.latitude - cell_center.latitude ) ) + cell_center.latitude
+ scaled_strs: list[str] = [
+ str("%.6f" % float(lng_new)),
+ str("%.6f" % float(lat_new)),
+ str("%.6f" % float(gl.aboveMeanSeaLevel)),
+ ]
+ text.append(",".join(scaled_strs))
+ point_index += 1
+ scaled_coordinates.text = " ".join(text)