summaryrefslogtreecommitdiff
path: root/python-grid2demand.spec
blob: 0d14db532123c3c3785c134f35e058064ddeabb2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
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