Map Builder¶
In this section, we will introduce you to the advanced features of the Map Builder.
Detailed Map Content Input¶
Road Network¶
net (Union[FeatureCollection, Map])is the input of map road network.Builderaccepts two types of net input:FeatureCollectionandMap. If aMapis provided as input,Builderconstructs the map while preserving the originallanes,roads, andjunctions. If aFeatureCollectionin the specified format is given, thelanes,roads, andjunctionsare constructed based on the providedLineStringsandMultiPoints.proj_str (Optional[str] = None), as discussed, is a PROJ.4 projection string, used to transform longitude and latitude coordinates into planar xy coordinates. Ifproj_stris not provided toBuilder, it is assumed that the coordinates in theFeatureCollectionare already in planar xy format, and no projection transformation will be performed.
AOI¶
aois (Optional[FeatureCollection] = None): input aois data in specific format.aoi_mode (Union[Literal["append"], Literal["overwrite"]] = "overwrite"):aoi_modeprovides two options:overwriteandappend. When thenetinput to the Builder is aFeatureCollection, there is no difference between these modes. However, when the net input is aMap,appendmeans that the originalAOIsin the map will be retained, with new AOIs added based on the inputaois. On the other hand,overwritemeans that the originalAOIsin the input map will be deleted, and only the new AOIs from the inputaoiswill be added.aoi_matching_distance_threshold (float = 30.0): in output map, allAOIsmust be near at least onelane. Theaoi_matching_distance_thresholddefines the distance threshold for determining proximity, with the unit being meters.merge_aoi (bool): if true, nearby AOIs will be merged into one larger AOI, thus reducing overall AOI numbers.
POI¶
pois (Optional[FeatureCollection] = None): input pois data in specific format.
Control the Shape of Road Network¶
Driving lane generation¶
road_expand_mode (Union[Literal["L"], Literal["M"], Literal["R"]] = "R"):road_expand_modehas three options:L,M, andR.Lrepresents generating the geometry for alllanesby translating theLineStringof the road’s right boundary to the left;Mrepresents generating the geometry for all lanes by treating theLineStringof the road as the centerline and translating it to both sides;Rrepresents generating the geometry for all lanes by translating theLineStringof the road’s left boundary to the right.expand_roads (bool = False): if true, the number of lanes for roads that connect to straight and U-turn roads will be increased by 2.default_lane_width (float = 3.2): the default value of lane width for the lanes without awidthattribute.
Walking lane generation¶
gen_sidewalk_speed_limit (float) = 0: after generating all the driving lanes based on the road’sLineString, a decision is made whether to generate sidewalks for each road based on its highway level or speed limit. The gen_sidewalk_speed_limit is the threshold speed value, in units of meters per second, above which sidewalks will be generated alongside the roads.
Generation of Traffic Light¶
When creating a map with Builder, traffic light control situations in specified format within junctions are automatically generated based on its lane connections. The following are some parameters that control the generation of these signal controls.
traffic_light_min_direction_group (int = 3): for junctions whose number of lane directions are greater than or equal totraffic_light_min_direction_groupwill be chosen to generate default fixed time traffic-light and feasible phase for max pressure algorithm.traffic_light_mode (Union[Literal["green_red"], Literal["green_yellow_red"], Literal["green_yellow_clear_red"]] = "green_yellow_clear_red"):traffic_light_modeoffers three options:green_red,green_yellow_red, andgreen_yellow_clear_red. These represent different fixed-phase signal control modes: only red and green lights, including red, green, and yellow lights, and including red, green, and yellow lights along with a pedestrian clearance red light.green_time (float = 30.0): the green light duration in traffic light.yellow_time (float = 5.0): the yellow light duration in traffic light.
Output Format Check¶
Builder provides default checks for the correctness of input and output structures.
Additionally, you can set
output_lane_length_checkto True to verify whether the lanes connected in junctions are excessively long due to a large enclosed area.If
strict_modeis set to True, aValueErrorwill be raised if there are errors in the properties.turn annotations.