summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--python-grid2demand.spec254
-rw-r--r--sources1
3 files changed, 256 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index e69de29..17295d9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/grid2demand-0.2.7.tar.gz
diff --git a/python-grid2demand.spec b/python-grid2demand.spec
new file mode 100644
index 0000000..0d14db5
--- /dev/null
+++ b/python-grid2demand.spec
@@ -0,0 +1,254 @@
+%global _empty_manifest_terminate_build 0
+Name: python-grid2demand
+Version: 0.2.7
+Release: 1
+Summary: A tool for generating zone-to-zone travel demand based on grid cells or external TAZs
+License: GPLv3+
+URL: https://github.com/asu-trans-ai-lab/grid2demand
+Source0: https://mirrors.aliyun.com/pypi/web/packages/b3/ee/881a7fc3ae0301e6000cc2bca7f1f664645be5f1a9c0201233578ba10f14/grid2demand-0.2.7.tar.gz
+BuildArch: noarch
+
+Requires: python3-pandas
+Requires: python3-numpy
+
+%description
+# GRID2DEMAND: A tool for generating zone-to-zone travel demand based on grid cells
+
+## Introduction
+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 for teaching transportation planning and applications. By taking advantage of OSM2GMNS tool to obtain routable 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
+
+## Quick Start
+Users can refer to the [code template and test data set](https://github.com/asu-trans-ai-lab/Grid2Demand/) to have a quick start.
+
+## Installation
+```
+pip install grid2demand
+```
+If you meet installation issues, please refer to the [user guide](https://github.com/asu-trans-ai-lab/grid2demand/blob/main/README.md) for solutions.
+
+
+## Simple Example
+```python
+import grid2demand as gd
+
+"Step 1: Read Input Network Data"
+gd.ReadNetworkFiles()
+
+"Step 2: Zone Partition"
+# Option 1: Partition grid into cells (users can customize number of grid cells or cell's width and height in meters)
+gd.PartitionGrid(number_of_x_blocks=None, number_of_y_blocks=None, cell_width=1000, cell_height=1000)
+# Option 2: Partition based on Traffic Analysis Zone boundaries with an external input TAZ.csv
+gd.TAZ2zone()
+
+"Step 3: Get Production/Attraction Rates of Each Land Use Type with a Specific Trip Purpose"
+gd.GetPoiTripRate(trip_purpose=1)
+# users can customize trip purpose and poi_trip_rate.csv
+
+"Step 4: Define Production/Attraction Value of Each Node According to POI Type"
+gd.GetNodeDemand(residential_production=20, residential_attraction=20, boundary_production=1000, boundary_attraction=1000)
+# users can customize production and attraction values of residential nodes and boundary nodes
+
+"Step 5: Calculate Zone-to-zone Accessibility Matrix by Centroid-to-centroid Straight Distance"
+gd.ProduceAccessMatrix()
+
+"Step 6: Apply Gravity Model to Perform Trip Distribution"
+gd.RunGravityModel(trip_purpose=1, a=None, b=None, c=None)
+# users can customize friction factor coefficients under a specific trip purpose
+
+"Step 7: Generate Agent"
+gd.GenerateAgentBasedDemand()
+```
+
+## Visualization
+Option 1: Open [QGIS](https://www.qgis.org/) and add Delimited Text Layer of the files.
+
+Option 2: Upload files to the website of [ASU Trans+AI Lab](https://asu-trans-ai-lab.github.io/index.html#/) and view input and output files.
+
+Option 3: Import input_agent.csv to [A/B Street](https://a-b-street.github.io/docs/howto/asu.html) and view dynamic simulation of the demand.
+
+## User guide
+Users can check the [user guide](https://github.com/asu-trans-ai-lab/grid2demand/blob/main/README.md) for a detailed introduction of grid2demand.
+
+
+
+
+%package -n python3-grid2demand
+Summary: A tool for generating zone-to-zone travel demand based on grid cells or external TAZs
+Provides: python-grid2demand
+BuildRequires: python3-devel
+BuildRequires: python3-setuptools
+BuildRequires: python3-pip
+%description -n python3-grid2demand
+# GRID2DEMAND: A tool for generating zone-to-zone travel demand based on grid cells
+
+## Introduction
+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 for teaching transportation planning and applications. By taking advantage of OSM2GMNS tool to obtain routable 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
+
+## Quick Start
+Users can refer to the [code template and test data set](https://github.com/asu-trans-ai-lab/Grid2Demand/) to have a quick start.
+
+## Installation
+```
+pip install grid2demand
+```
+If you meet installation issues, please refer to the [user guide](https://github.com/asu-trans-ai-lab/grid2demand/blob/main/README.md) for solutions.
+
+
+## Simple Example
+```python
+import grid2demand as gd
+
+"Step 1: Read Input Network Data"
+gd.ReadNetworkFiles()
+
+"Step 2: Zone Partition"
+# Option 1: Partition grid into cells (users can customize number of grid cells or cell's width and height in meters)
+gd.PartitionGrid(number_of_x_blocks=None, number_of_y_blocks=None, cell_width=1000, cell_height=1000)
+# Option 2: Partition based on Traffic Analysis Zone boundaries with an external input TAZ.csv
+gd.TAZ2zone()
+
+"Step 3: Get Production/Attraction Rates of Each Land Use Type with a Specific Trip Purpose"
+gd.GetPoiTripRate(trip_purpose=1)
+# users can customize trip purpose and poi_trip_rate.csv
+
+"Step 4: Define Production/Attraction Value of Each Node According to POI Type"
+gd.GetNodeDemand(residential_production=20, residential_attraction=20, boundary_production=1000, boundary_attraction=1000)
+# users can customize production and attraction values of residential nodes and boundary nodes
+
+"Step 5: Calculate Zone-to-zone Accessibility Matrix by Centroid-to-centroid Straight Distance"
+gd.ProduceAccessMatrix()
+
+"Step 6: Apply Gravity Model to Perform Trip Distribution"
+gd.RunGravityModel(trip_purpose=1, a=None, b=None, c=None)
+# users can customize friction factor coefficients under a specific trip purpose
+
+"Step 7: Generate Agent"
+gd.GenerateAgentBasedDemand()
+```
+
+## Visualization
+Option 1: Open [QGIS](https://www.qgis.org/) and add Delimited Text Layer of the files.
+
+Option 2: Upload files to the website of [ASU Trans+AI Lab](https://asu-trans-ai-lab.github.io/index.html#/) and view input and output files.
+
+Option 3: Import input_agent.csv to [A/B Street](https://a-b-street.github.io/docs/howto/asu.html) and view dynamic simulation of the demand.
+
+## User guide
+Users can check the [user guide](https://github.com/asu-trans-ai-lab/grid2demand/blob/main/README.md) for a detailed introduction of grid2demand.
+
+
+
+
+%package help
+Summary: Development documents and examples for grid2demand
+Provides: python3-grid2demand-doc
+%description help
+# GRID2DEMAND: A tool for generating zone-to-zone travel demand based on grid cells
+
+## Introduction
+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 for teaching transportation planning and applications. By taking advantage of OSM2GMNS tool to obtain routable 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
+
+## Quick Start
+Users can refer to the [code template and test data set](https://github.com/asu-trans-ai-lab/Grid2Demand/) to have a quick start.
+
+## Installation
+```
+pip install grid2demand
+```
+If you meet installation issues, please refer to the [user guide](https://github.com/asu-trans-ai-lab/grid2demand/blob/main/README.md) for solutions.
+
+
+## Simple Example
+```python
+import grid2demand as gd
+
+"Step 1: Read Input Network Data"
+gd.ReadNetworkFiles()
+
+"Step 2: Zone Partition"
+# Option 1: Partition grid into cells (users can customize number of grid cells or cell's width and height in meters)
+gd.PartitionGrid(number_of_x_blocks=None, number_of_y_blocks=None, cell_width=1000, cell_height=1000)
+# Option 2: Partition based on Traffic Analysis Zone boundaries with an external input TAZ.csv
+gd.TAZ2zone()
+
+"Step 3: Get Production/Attraction Rates of Each Land Use Type with a Specific Trip Purpose"
+gd.GetPoiTripRate(trip_purpose=1)
+# users can customize trip purpose and poi_trip_rate.csv
+
+"Step 4: Define Production/Attraction Value of Each Node According to POI Type"
+gd.GetNodeDemand(residential_production=20, residential_attraction=20, boundary_production=1000, boundary_attraction=1000)
+# users can customize production and attraction values of residential nodes and boundary nodes
+
+"Step 5: Calculate Zone-to-zone Accessibility Matrix by Centroid-to-centroid Straight Distance"
+gd.ProduceAccessMatrix()
+
+"Step 6: Apply Gravity Model to Perform Trip Distribution"
+gd.RunGravityModel(trip_purpose=1, a=None, b=None, c=None)
+# users can customize friction factor coefficients under a specific trip purpose
+
+"Step 7: Generate Agent"
+gd.GenerateAgentBasedDemand()
+```
+
+## Visualization
+Option 1: Open [QGIS](https://www.qgis.org/) and add Delimited Text Layer of the files.
+
+Option 2: Upload files to the website of [ASU Trans+AI Lab](https://asu-trans-ai-lab.github.io/index.html#/) and view input and output files.
+
+Option 3: Import input_agent.csv to [A/B Street](https://a-b-street.github.io/docs/howto/asu.html) and view dynamic simulation of the demand.
+
+## User guide
+Users can check the [user guide](https://github.com/asu-trans-ai-lab/grid2demand/blob/main/README.md) for a detailed introduction of grid2demand.
+
+
+
+
+%prep
+%autosetup -n grid2demand-0.2.7
+
+%build
+%py3_build
+
+%install
+%py3_install
+install -d -m755 %{buildroot}/%{_pkgdocdir}
+if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
+if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
+if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
+if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
+pushd %{buildroot}
+if [ -d usr/lib ]; then
+ find usr/lib -type f -printf "\"/%h/%f\"\n" >> filelist.lst
+fi
+if [ -d usr/lib64 ]; then
+ find usr/lib64 -type f -printf "\"/%h/%f\"\n" >> filelist.lst
+fi
+if [ -d usr/bin ]; then
+ find usr/bin -type f -printf "\"/%h/%f\"\n" >> filelist.lst
+fi
+if [ -d usr/sbin ]; then
+ find usr/sbin -type f -printf "\"/%h/%f\"\n" >> filelist.lst
+fi
+touch doclist.lst
+if [ -d usr/share/man ]; then
+ find usr/share/man -type f -printf "\"/%h/%f.gz\"\n" >> doclist.lst
+fi
+popd
+mv %{buildroot}/filelist.lst .
+mv %{buildroot}/doclist.lst .
+
+%files -n python3-grid2demand -f filelist.lst
+%dir %{python3_sitelib}/*
+
+%files help -f doclist.lst
+%{_docdir}/*
+
+%changelog
+* Tue Jun 20 2023 Python_Bot <Python_Bot@openeuler.org> - 0.2.7-1
+- Package Spec generated
diff --git a/sources b/sources
new file mode 100644
index 0000000..66383de
--- /dev/null
+++ b/sources
@@ -0,0 +1 @@
+5fc500c2d6c39485b229e5a1d3ba3300 grid2demand-0.2.7.tar.gz