diff --git a/examples/cube/st_paul_test.log b/examples/cube/st_paul_test.log index 6c1f29c..0babee9 100644 --- a/examples/cube/st_paul_test.log +++ b/examples/cube/st_paul_test.log @@ -8,4 +8,4 @@ L,A,0,3230,3262,999998,5,0,4,0,0,0,0,0,0,0,5,1,0,40,3,1,1,1,0,0.10462,0 L,A,0,3262,3230,999997,5,0,4,0,0,0,0,0,0,0,5,1,0,40,3,1,1,1,0,0.10462,0 L,D,0,3261,131209,281,5,0,4,0,0,0,0,0,0,0,5,1,0,40,3,1,1,1,0,0.10462,0 L,D,0,178775,42542,477533,5,0,4,0,0,0,0,0,0,0,5,1,0,40,3,1,1,1,0,0.10462,0 -N,A,0,354388,-93.18389,44.96898,"",1,0,0,0 +N,A,0,354388,485498.84,4979520.93,"",1,0,0,0 diff --git a/lasso/parameters.py b/lasso/parameters.py index 5d28cda..72a4786 100644 --- a/lasso/parameters.py +++ b/lasso/parameters.py @@ -701,6 +701,7 @@ def __init__(self, **kwargs): ) self.output_dir = os.path.join(self.scratch_location) self.output_epsg = 26915 + self.wrangler_epsg = 4269 """ Create all the possible headway variable combinations based on the cube time periods setting diff --git a/lasso/project.py b/lasso/project.py index 9d5f80e..26a15d7 100644 --- a/lasso/project.py +++ b/lasso/project.py @@ -582,8 +582,24 @@ def _process_node_additions(node_add_df): if len(node_add_df) == 0: WranglerLogger.debug("No node additions processed") return [] + + WranglerLogger.info("Reprojecting node coordinates from model CRS to standard CRS") + if 'X' in node_add_df.columns: + node_add_df = gpd.GeoDataFrame( + node_add_df, + geometry = gpd.points_from_xy( + node_add_df['X'], + node_add_df['Y'] + ), + crs = "EPSG:" + str(self.parameters.output_epsg) + ) + + # convert to WGS 84 + node_add_df = node_add_df.to_crs(epsg=self.parameters.wrangler_epsg) + node_add_df['X'] = node_add_df['geometry'].apply(lambda g: g.x) + node_add_df['Y'] = node_add_df['geometry'].apply(lambda g: g.y) - add_nodes_dict_list = node_add_df.drop(["OPERATION_final"], axis=1).to_dict( + add_nodes_dict_list = node_add_df.drop(["OPERATION_final", "geometry"], axis=1).to_dict( "records" ) WranglerLogger.debug("{} Nodes Added".format(len(add_nodes_dict_list)))