vissim2gmns.func_lib.vissim_fzp
- vissim2gmns.func_lib.vissim_fzp(path_vissim_fzp: str, path_vissim_inpx: str, *, x_col_name: str = 'POS', y_col_name: str = 'POSLAT', output_dir: str = '', **kwargs) GeoDataFrame[source]
Convert vissim fzp file to geopandas dataframe.
- Parameters:
path_vissim_fzp (str) – the path to the vissim fzp file.
path_vissim_inpx (str) – the path to the vissim inpx file.
x_col_name (str) – the longitude column name in fzp file to convert fzp file to geojson.
y_col_name (str) – the latitude column name in fzp file to convert fzp file to geojson.
output_dir (str) – the directory to save the output files. Defaults to “”.
**kwargs – other parameters for the conversion, such as isShp, isGeojson, isCsv.
Notes
output_dir: if not provide no data will be saved.
isShp: whether to save the output as shapefile. Default is False.
isGeojson: whether to save the output as geojson. Default is False.
isCsv: whether to save the output as csv. Default is True.
Example
>>> import vissim2gmns as vg >>> path_vissim_fzp = "./vissim_data/xl_002_001.fzp" >>> path_vissim_inpx = "./vissim_data/xl_002_001.inpx" >>> output_dir = "./output" >>> x_col_name = "POS" >>> y_col_name = "POSLAT" >>> >>> # get the fzp data as a geopandas dataframe without saving to file. >>> df_fzp = vg.vissim_fzp(path_vissim_fzp, path_vissim_inpx) >>> >>> # get the fzp data as a geopandas dataframe and save shp files (default) to the output_dir. >>> df_fzp = vg.vissim_fzp(path_vissim_fzp, path_vissim_inpx, output_dir=output_dir) >>> >>> # get the fzp data as a geopandas dataframe and control the output file format by setting isShp, isGeojson and isCsv parameters. >>> df_fzp = vg.vissim_fzp(path_vissim_fzp, path_vissim_inpx, output_dir=output_dir, isShp=True, isGeojson=True, isCsv=True)
- Returns:
converted geopandas dataframe.
- Return type:
GeoDataFrame