
Security News
MCP Community Begins Work on Official MCP Metaregistry
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
A tool for generating zone-to-zone travel demand based on grid cells or TAZs using gravity model
GRID2DEMAND: A tool for generating zone-to-zone travel demand based on grid cells or TAZs and gravity model
Grid2demand is an open-source quick demand generation tool based on the trip generation and trip distribution methods of the standard 4-step travel model.
By taking advantage of OSM2GMNS tool to obtain route-able transportation network from OpenStreetMap, Grid2demand aims to further utilize Point of Interest (POI) data to construct trip demand matrix aligned with standard travel models.
You can get access to the introduction video with the link: https://www.youtube.com/watch?v=EfjCERQQGTs&t=1021s
You can find base-knowledge tutorial with the link: Base Knowledge such as transportation 4 stages planning
You can find the tutorial code witht the link: How To Use Grid2demand
pip install grid2demand
If you meet installation issues, please reach out to our developers for solutions.
[!IMPORTANT] node.csv and poi.csv should follow the GMNS standard and you can generate node.csv and poi.csv using osm2gmns.
from __future__ import absolute_import
import grid2demand as gd
if __name__ == "__main__":
# Specify input directory
input_dir = "your-data-folder"
# Initialize a GRID2DEMAND object
net = gd.GRID2DEMAND(input_dir=input_dir, use_zone_id=True, mode_type="auto")
# load network: node and poi
net.load_network()
# Generate zone.csv from node boundary by specifying number of x blocks and y blocks
net.net2grid(num_x_blocks=10, num_y_blocks=10)
# net.net2grid(cell_width=10, cell_height=10, unit="km")
# Load zone from zone.csv
net.taz2zone()
# Map zones with nodes and pois, viseversa
net.map_mapping_between_zone_and_node_poi()
# Calculate zone-to-zone distance matrix
net.calc_zone_od_distance_matrix(pct=1)
# Calculate demand by running gravity model
net.run_gravity_model()
# Save demand, zone, updated node, updated poi to csv
net.save_results_to_csv(agent=True, overwrite_file=False)
from __future__ import absolute_import
import grid2demand as gd
if __name__ == "__main__":
# Specify input directory
input_dir = "your-data-folder"
# Initialize a GRID2DEMAND object
net = gd.GRID2DEMAND(input_dir=input_dir, use_zone_id=True, mode_type="auto")
# Load network: node and poi
net.load_network()
# Load zone from zone.csv
net.taz2zone()
# Map zones with nodes and pois, viseversa
net.map_mapping_between_zone_and_node_poi()
# Calculate zone-to-zone distance matrix
net.calc_zone_od_distance_matrix(pct=1)
# Calculate demand by running gravity model
net.run_gravity_model()
# Save demand, zone, updated node, updated poi to csv
net.save_results_to_csv(node=Frale, zone=False, agent=False, overwrite_file=False)
The grid2demand project welcomes your expertise and enthusiasm!
Small improvements or fixes are always appreciated. If you are considering larger contributions to the source code, please contact us through email: Xiangyong Luo, Dr. Xuesong Simon Zhou
Writing code isn't the only way to contribute to grid2demand. You can also:
For more information about the ways you can contribute to grid2demand, visit our GitHub. If you' re unsure where to start or how your skills fit in, reach out! You can ask by opening a new issue or leaving a comment on a relevant issue that is already open on GitHub.
If you use grid2demand in your research please use the following BibTeX entry:
Xiangyong Luo, Xuesiong Simon Zhou (2023). xyluo25/grid2demand: Zenodo. https://doi.org/10.5281/zenodo.11212556
FAQs
A tool for generating zone-to-zone travel demand based on grid cells or TAZs using gravity model
We found that grid2demand demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 6 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
Research
Security News
Socket uncovers an npm Trojan stealing crypto wallets and BullX credentials via obfuscated code and Telegram exfiltration.
Research
Security News
Malicious npm packages posing as developer tools target macOS Cursor IDE users, stealing credentials and modifying files to gain persistent backdoor access.