Skip to content

Commit

Permalink
rename folder
Browse files Browse the repository at this point in the history
  • Loading branch information
r-akemii committed Sep 9, 2024
1 parent 95c7084 commit 5f64a87
Show file tree
Hide file tree
Showing 35 changed files with 111 additions and 71 deletions.
2 changes: 1 addition & 1 deletion aequilibrae/project/network/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def create_from_osm(
clean=True,
) -> None:
"""
Downloads the network from Open-Street Maps
Downloads the network from OpenStreetMap (OSM)
:Arguments:
**area** (:obj:`Polygon`, *Optional*): Polygon for which the network will be downloaded. If not provided,
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,14 @@ AequilibraE matrices saved in disk can be reused and loaded once again.
:ref:`plot_assignment_without_model`
Usage example

Open Matrix (OMX)
-----------------
OpenMatrix (OMX)
----------------

AequilibraE can handle OMX files, but if you're wondering what is OMX and what does
it stand for, this section is for you. The text in this section is borrowed from
`Open Matrix Wiki page <https://github.com/osPlanning/omx/wiki>`_.
`OpenMatrix Wiki page <https://github.com/osPlanning/omx/wiki>`_.

The Open Matrix file format (or simply OMX) is a standard matrix format for storing and
The OpenMatrix file format (or simply OMX) is a standard matrix format for storing and
transferring matrix data across different models and software packages, intended to make
the model development easier. It is a file capable of storing more than one matrices
at a time, including multiple indexes/lookups, and attributes (key/value pairs) for matrices and
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,21 @@ AequilibraE is built on the shoulder of much older and more established
projects, such as `SQLite <https://sqlite.org/index.html>`_,
`SpatiaLite <http://www.gaia-gis.it/gaia-sins/>`_ and `NumPy
<https://numpy.org/>`_, as well as reasonably new industry standards such as the
`Open-Matrix format <https://github.com/osPlanning/omx>`_.
`OpenMatrix format <https://github.com/osPlanning/omx>`_.

Impressive performance, portability, self containment and open-source character
of these pieces of software, along with their large user base and wide
industry support make them solid options to be AequilibraE's data backend.

Since working with Spatialite is not just a matter of a ``pip install``,
Since working with SpatiaLite is not just a matter of a ``pip install``,
please refer to :ref:`dependencies`. For QGIS users this is not a concern, while
for Windows users this dependency is automatically handled under the hood, but
the details are also discussed in the aforementioned dependencies section.

Package components: A conceptual view
-------------------------------------

As all the components of an AequilibraE model based on open-source software and
As all the components of an AequilibraE model are based on open-source software and
open-data standards, modeling with AequilibraE is a little different from
modeling with commercial packages, as the user can read and manipulate model
components outside the software modeling environments (Python and QGIS).
Expand Down Expand Up @@ -62,7 +62,8 @@ series of files and sub folders exist, and the current project organization
is as follows:

.. image:: ../../images/project_structure.png
:width: 600
:scale: 25 %
:align: center
:alt: AequilibraE project structure

|
Expand All @@ -75,10 +76,10 @@ folders and databases.
The second key component of any model is the **parameters.yaml** file, which
holds the default values for a number of procedures (e.g. assignment
convergence), as well as the specification for networks imported from
Open-Street Maps and other general *import-export* parameters.
OpenStreetMap and other general *import-export* parameters.

The third and last required component of an AequilibraE model is the Matrices
folder, where all the matrices in binary format (in AequilibraE's native AEM or
The third and last required component of an AequilibraE model is the **Matrices
folder**, where all the matrices in binary format (in AequilibraE's native AEM or
OMX formats) should be placed. This folder can be empty, however, as no
particular matrix is required to exist in an AequilibraE model.

Expand All @@ -103,7 +104,7 @@ The following sections presents the structure and contents for all databases in

.. toctree::
:maxdepth: 1
:caption: Dive deep into project structure!
:caption: Or dive deep into project structure!

project_database/index
parameter_file
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ to the use of **integer**, **numeric** and **varchar**.

For the case of all non-mandatory fields, two more parameters are possible: 'osm_source' and
'osm_behaviour'. Those two fields provide the necessary information for importing data from
`Open Street Maps <https://www.openstreetmap.org/>`_ in case such resource is required, and
`OpenStreetMap <https://www.openstreetmap.org/>`_ in case such resource is required, and
they work in the following way:

'osm_source': The name of the tag for which data needs to be retrieved. Common tags are
Expand Down Expand Up @@ -108,13 +108,13 @@ that it does not make sense to have fields for one or two directions and that it
yet to import any tagged values from OSM at the moment, and therefore the parameter *osm_source*
would have no effect here.

Open Street Maps
~~~~~~~~~~~~~~~~
OpenStreetMap
~~~~~~~~~~~~~

The **OSM** group of parameters has two specifications: **modes** and **all_link_types**.

**modes** contains the list of key tags we will import for each mode. Description of tags can be found on
`Open-Street Maps <https://wiki:openstreetmap:org/wiki/Key:highway:>`_, and we recommend
`OpenStreetMap Wiki <https://wiki:openstreetmap:org/wiki/Key:highway:>`_, and we recommend
not changing the standard parameters unless you are exactly sure of what you are doing.

For each mode to be imported there is also a mode filter to control for non-default
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
*transit_graph_configs* table structure
---------------------------------------

The *transit_graph_configs* table holds configuration parameters for a TransitGraph of a particular `period_id`
Attributes follow

.. csv-table::
:header: "Field", "Type", "NULL allowed", "Default Value"
:widths: 30, 20, 20, 20

period_id*,INTEGER,NO,
config,TEXT,YES,


(* - Primary key)



The SQL statement for table and index creation is below.


::

CREATE TABLE if not exists transit_graph_configs (period_id INTEGER UNIQUE NOT NULL PRIMARY KEY REFERENCES periods(period_id),
config TEXT);
INSERT INTO 'attributes_documentation' (name_table, attribute, description) VALUES('transit_graph_configs','period_id', 'The period this config is associated with.');
INSERT INTO 'attributes_documentation' (name_table, attribute, description) VALUES('transit_graph_configs','mode_id', 'JSON string containing the configuration parameters.');
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
*zones* table structure
-----------------------

The *zones* table holds information on the Traffic Analysis Zones (TAZs)
in AequilibraE's model.

The **zone_id** field identifies the zone.

The **area** field corresponds to the area of the zone in **km2**.
TAZs' area is automatically updated by triggers.

The **name** fields allows one to identity the zone using a name
or any other description.

.. csv-table::
:header: "Field", "Type", "NULL allowed", "Default Value"
:widths: 30, 20, 20, 20

ogc_fid*,INTEGER,YES,
zone_id,INTEGER,NO,
area,NUMERIC,YES,
name,TEXT,YES,
geometry,MULTIPOLYGON,NO,''


(* - Primary key)



The SQL statement for table and index creation is below.


::

CREATE TABLE 'zones' (ogc_fid INTEGER PRIMARY KEY,
zone_id INTEGER UNIQUE NOT NULL,
area NUMERIC,
"name" TEXT);
SELECT AddGeometryColumn( 'zones', 'geometry', 4326, 'MULTIPOLYGON', 'XY', 1);
CREATE UNIQUE INDEX idx_zone ON zones (zone_id);
SELECT CreateSpatialIndex( 'zones' , 'geometry' );
INSERT INTO 'attributes_documentation' (name_table, attribute, description) VALUES('zones','zone_id', 'Unique node ID');
INSERT INTO 'attributes_documentation' (name_table, attribute, description) VALUES('zones','area', 'Area of the zone in km2');
INSERT INTO 'attributes_documentation' (name_table, attribute, description) VALUES('zones','name', 'Name of the zone, if any');
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ Link distance
+++++++++++++

Link distance cannot be changed by the user, as it is automatically recalculated
using the Spatialite function *GeodesicLength*, which always returns distances
using the SpatiaLite function ``GeodesicLength``, which always returns distances
in meters.

Link direction
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Python limitations
``````````````````

As it happens in other cases, Python's usual implementation of SQLite is
incomplete, and does not include R-Tree, a key extension used by Spatialite for
incomplete, and does not include R-Tree, a key extension used by SpatiaLite for
GIS operations.

For this reason, AequilibraE's default option when importing a network from OSM
Expand Down Expand Up @@ -69,13 +69,13 @@ with the option for creating such indices.
If you want to learn a little more about this topic, you can access this
`blog post <https://pythongisandstuff.wordpress.com/2015/11/11/python-and-spatialite-32-bit-on-64-bit-windows/>`_
or check out the SQLite page on `R-Tree <https://www.sqlite.org/rtree.html>`_.
If you want to take a stab at solving your SQLite/Spatialite problem
If you want to take a stab at solving your SQLite/SpatiaLite problem
permanently, take a look at this
`other blog post <https://www.xl-optim.com/spatialite-and-python-in-2020/>`_.

Please also note that the network consistency triggers will NOT work before
spatial indices have been created and/or if the editing is being done on a
platform that does not support both R-Tree and Spatialite.
platform that does not support both R-Tree and SpatiaLite.

.. seealso::

Expand Down
12 changes: 4 additions & 8 deletions docs/source/modeling_with_aequilibrae/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,10 @@ In this section you can find a deep dive into modeling with AequilibraE, from
a start guide to a complete view into AequilibraE's data structure.

.. toctree::
:numbered: 3
:maxdepth: 1
:caption: A guide to AequilibraE

1-aequilibrae_project/index
2-static_traffic_assignment/index
3-transit_assignment/index
4-route_choice/index
5-aequilibrae_matrix
6-project_components
6-accessing-project-data
aequilibrae_project/index
static_traffic_assignment/index
transit_assignment/index
route_choice/index
20 changes: 10 additions & 10 deletions docs/source/useful_information/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,49 +35,49 @@ for all currently supported Python versions and major platforms.

.. _installing_spatialite_on_windows:

Spatialite
SpatiaLite
++++++++++

Although the presence of Spatialite is rather ubiquitous in the GIS ecosystem,
Although the presence of SpatiaLite is rather ubiquitous in the GIS ecosystem,
it has to be installed separately from Python or AequilibraE in any platform.

This `blog post <https://xl-optim.com/spatialite-and-python-in-2020/>`_ has a more
comprehensive explanation of what is the setup you need to get Spatialite working,
comprehensive explanation of what is the setup you need to get SpatiaLite working,
but that is superfluous if all you want is to get it working.

Windows
^^^^^^^

.. note::
On Windows ONLY, AequilibraE automatically verifies if you have Spatialite
On Windows ONLY, AequilibraE automatically verifies if you have SpatiaLite
installed in your system and downloads it to your temporary folder if you do
not.

Spatialite does not have great support on Python for Windows. For this reason,
it is necessary to download Spatialite for Windows and inform and load it
SpatiaLite does not have great support on Python for Windows. For this reason,
it is necessary to download SpatiaLite for Windows and inform and load it
to the Python SQLite driver every time you connect to the database.

One can download the appropriate version of the latest Spatialite release
One can download the appropriate version of the latest SpatiaLite release
directly from its `project page <https://www.gaia-gis.it/gaia-sins/>`_ , or the
cached versions on AequilibraE's website for
`64-Bit Python <https://github.com/AequilibraE/aequilibrae/releases/tag/V.0.7.5>`_

After unpacking the zip file into its own folder (say ``D:/spatialite``), one can
*temporarily* add the spatialite folder to system path environment variable,
*temporarily* add the SpatiaLite folder to system path environment variable,
as follows:

::

import os
os.environ['PATH'] = 'D:/spatialite' + ';' + os.environ['PATH']

For a permanent recording of the Spatialite location on your system, please refer
For a permanent recording of the SpatiaLite location on your system, please refer
to the blog post referenced above or Windows-specific documentation.

Ubuntu Linux
^^^^^^^^^^^^

On Ubuntu it is possible to install Spatialite by simply using apt-get
On Ubuntu it is possible to install SpatiaLite by simply using apt-get

::

Expand Down

0 comments on commit 5f64a87

Please sign in to comment.