Carma-platform v4.2.0
CARMA Platform is built on robot operating system (ROS) and utilizes open source software (OSS) that enables Cooperative Driving Automation (CDA) features to allow Automated Driving Systems to interact and cooperate with infrastructure and other vehicles through communication.
osm_transform.py File Reference

Go to the source code of this file.

Namespaces

namespace  osm_transform
 

Variables

float osm_transform.new_lat_0 = 0.0
 
float osm_transform.new_lon_0 = 0.0
 
float osm_transform.rotate_lat = 0.0
 
float osm_transform.rotate_lon = 0.0
 
float osm_transform.rotation_deg = 0.0
 
 osm_transform.theta_rad = math.radians(rotation_deg)
 
 osm_transform.parser = argparse.ArgumentParser(description="Relocate and rotate OSM map geometry around a new reference point.")
 
 osm_transform.help
 
 osm_transform.args = parser.parse_args()
 
 osm_transform.tree = etree.parse(args.input_file)
 
 osm_transform.root = tree.getroot()
 
 osm_transform.geo_ref_elem = root.find("geoReference")
 
 osm_transform.old_proj_str = geo_ref_elem.text.strip()
 
string osm_transform.new_proj_str = f"+proj=tmerc +lat_0={new_lat_0} +lon_0={new_lon_0} +k=1 +x_0=0 +y_0=0 +datum=WGS84 +units=m +geoidgrids=egm96_15.gtx +vunits=m +no_defs"
 
 osm_transform.crs_wgs84 = CRS.from_epsg(4326)
 
 osm_transform.crs_old = CRS.from_proj4(old_proj_str)
 
 osm_transform.crs_new = CRS.from_proj4(new_proj_str)
 
 osm_transform.to_old_xy = Transformer.from_crs(crs_wgs84, crs_old, always_xy=True)
 
 osm_transform.to_new_latlon = Transformer.from_crs(crs_new, crs_wgs84, always_xy=True)
 
 osm_transform.text
 
 osm_transform.xs_old
 
 osm_transform.ys_old
 
 osm_transform.lat = float(node.get("lat"))
 
 osm_transform.lon = float(node.get("lon"))
 
 osm_transform.x_old
 
 osm_transform.y_old
 
 osm_transform.cx_old = np.mean(xs_old)
 
 osm_transform.cy_old = np.mean(ys_old)
 
 osm_transform.to_new_xy = Transformer.from_crs(crs_wgs84, crs_new, always_xy=True)
 
 osm_transform.rotate_x
 
 osm_transform.rotate_y
 
 osm_transform.offset_x = rotate_x - cx_old
 
 osm_transform.offset_y = rotate_y - cy_old
 
 osm_transform.x = xs_old[i] + offset_x
 
 osm_transform.y = ys_old[i] + offset_y
 
 osm_transform.x_rel
 
 osm_transform.y_rel
 
 osm_transform.x_rot = x_rel * math.cos(theta_rad) - y_rel * math.sin(theta_rad)
 
 osm_transform.y_rot = x_rel * math.sin(theta_rad) + y_rel * math.cos(theta_rad)
 
 osm_transform.new_lon
 
 osm_transform.new_lat
 
 osm_transform.output_file
 
 osm_transform.pretty_print
 
 osm_transform.True
 
 osm_transform.xml_declaration
 
 osm_transform.encoding