-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merge changes for Ranch into Develop #289
Conversation
…rk_wrangler into develop_with_ranch
networks built by Ranch have 'id' as unique shape id
I think this is moot given #296? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See inline comments
@@ -187,6 +188,9 @@ class RoadwayNetwork(object): | |||
"roadway", | |||
"length", | |||
"segment_id", | |||
"assign_group", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't these be added as parameters?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed.
self.nodes_df = _add_dict_to_df(self.nodes_df, node) | ||
|
||
# add geometry for new nodes | ||
self.nodes_df["geometry"] = self.nodes_df.apply( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see two problematic things here:
- If the X/Y are updated, they need to have their geometry updated. It's probably an easy enough operation that I would just update it for all.
- If you are doing a selection, do it in the Dataframe before the .apply()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RE 1: This chunk of codes is for adding new links and new nodes. I don't think Lasso/Wrangler currently support node changes.
RE 2: I was following the implementation of new links.
network_wrangler/network_wrangler/roadwaynetwork.py
Lines 1677 to 1696 in 34580a0
# add location reference and geometry for new links | |
self.links_df["locationReferences"] = self.links_df.apply( | |
lambda x: create_location_reference_from_nodes( | |
self.nodes_df[ | |
self.nodes_df[RoadwayNetwork.NODE_FOREIGN_KEY] == x["A"] | |
].squeeze(), | |
self.nodes_df[ | |
self.nodes_df[RoadwayNetwork.NODE_FOREIGN_KEY] == x["B"] | |
].squeeze(), | |
) | |
if x["new_link"] == 1 | |
else x["locationReferences"], | |
axis=1, | |
) | |
self.links_df["geometry"] = self.links_df.apply( | |
lambda x: create_line_string(x["locationReferences"]) | |
if x["new_link"] == 1 | |
else x["geometry"], | |
axis=1, | |
) |
@@ -148,6 +148,7 @@ class RoadwayNetwork(object): | |||
|
|||
# CRS = "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs" | |||
CRS = 4326 # "EPSG:4326" | |||
CRS_alt=4269 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what this is? But the naming is confusing/doesn't mean anything.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps we can name it alternative_standard_crs
. Added details in #302
I think this is also taken care of by the flexibility in #296? |
@@ -96,6 +96,17 @@ def __init__(self, base_scenario: dict, project_cards: [ProjectCard] = None): | |||
self.road_net = None | |||
self.transit_net = None | |||
|
|||
if type(base_scenario) is dict: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
technically it is supposed to be a dict per typehint? but we can address it
@i-am-sijia I think this branch is now moot based on individual PRs to |
I added descriptions in #302 regarding the CRS issue. |
@i-am-sijia I believe this is now all moot and we can close this PR? Please check. |
…_project apply transit project card
stop deletion in "set"
add comments, updated shape_id naming format, updated the condition for adding new stop node
Apply transit line addition and deletion project cards
assign ml node in the 950,000 range
…_node Revert "assign ml node in the 950,000 range"
Dependency bug fix
In transit routing change, new stops are add to the stops table based on index position. If a stop record gets deleted, the indices of the remaining rows need to be adjusted
fixed shape index and adding new stops issue
…ring assign ml node in the 950,000 range
This is a dupe of functionality already in v1. |
List of Changes
1. Add CRS_alt
2. Adds/updates geometry
3. Change default for
UNIQUE_SHAPE_ID
fieldshape_id
toid
because shapes out of Ranch has uniqueid
from SharedStreets, no need to create ashape_id
. ( @i-am-sijia please fill in reason)4. Updated
base_scenario
instantiationbase_scenario
to dictionary ifbase_scenario
attribute is of typeScenario
so that it is consistent type as it is read in.5. Added to managed lane required attributes