Note
Go to the end to download the full example code.
Avoiding the automatic download of SpatiaLite binaries on Windows#
In this example, we show how to prevent Windows from downloading the SpatiaLite binaries automatically.
This may be relevant to users in corporate environments where the download and use of binaries to the Windows temporary is restricted.
Spatialite Logo by Massimo Zedda, image from https://www.gaia-gis.it/
# Imports
import os
from os.path import join
from tempfile import gettempdir
from uuid import uuid4
from aequilibrae.utils.create_example import create_example
No pre-existing parameter file exists for this project. Will use default
from aequilibrae.utils.spatialite_utils import set_known_spatialite_folder, ensure_spatialite_binaries
# First we prevent Windows from downloading spatialite binaries during this session
# THIS VALUE MUST BE UPPER CASE TO BE EFFECTIVE
os.environ["AEQ_SPATIALITE_DIR"] = r"C:\path\to\existing\download"
Now we can go about our business as usual
project = create_example(join(gettempdir(), uuid4().hex))
project.close()
This project at /tmp/fd6c8cce7f344bbc9a1ff5a7e6c1a6ee is already closed
Total running time of the script: (0 minutes 1.452 seconds)