Skip to content

Commit

Permalink
fill name and category filed in pois when building map
Browse files Browse the repository at this point in the history
  • Loading branch information
chenchenplus committed Aug 14, 2024
1 parent 03a0bc3 commit 504b5bd
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
5 changes: 2 additions & 3 deletions mosstool/map/_map_util/aoi_matcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -1607,11 +1607,10 @@ def _add_pois(aois, pois, projstr):
poi = pois[poi_id]
x, y = poi["coords"][0]
external = poi["external"]
poi_name = external.get("name", "")
out_pois[poi_uid] = {
"id": poi_uid,
"name": poi_name,
"category": poi.get("catg", ""),
"name": poi.get("name", ""),
"category": poi.get("category", ""),
"position": {"x": x, "y": y},
"aoi_id": poi_id_to_aoi_id[poi_id],
"external": {
Expand Down
6 changes: 6 additions & 0 deletions mosstool/map/_map_util/convert_aoi.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ def convert_poi(geos: FeatureCollection, projstr: str) -> list:
{
"id": poi_id,
"coords": [projector(*coords)],
"name": name,
"category": catg,
"external": {
"name": name,
"catg": catg,
Expand Down Expand Up @@ -163,6 +165,8 @@ def in_boundary(geo):
{
"id": poly_id,
"coords": [projector(lon, lat) for (lon, lat) in geo],
"name": "",
"category": poly_type,
"external": {
"name": "", # SUMO's POI does not have a name field
"catg": poly_type,
Expand Down Expand Up @@ -222,6 +226,8 @@ def in_boundary(geo):
{
"id": poi_id,
"coords": [projector(lon, lat) for (lon, lat) in [gps_loc]],
"name": "",
"category": poi_type,
"external": {
"name": "", # SUMO's POI does not have a name field
"catg": poi_type,
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "mosstool"
version = "0.2.29"
version = "0.2.30"
description = "MObility Simulation System toolbox "
authors = ["Jun Zhang <[email protected]>"]
license = "MIT"
Expand Down

0 comments on commit 504b5bd

Please sign in to comment.