help on create a project using OSM

9 views
Skip to first unread message

Fabio Morais

unread,
Feb 27, 2025, 11:36:23 AMFeb 27
to aequi...@googlegroups.com
hi,

I m trying to create a project using OSM coordinates, but it raised an error message.

Could you help me on it?


code:
from aequilibrae import Project
import sqlite3
west  = -49.334
south =  -25.488
east =  -46.751
north =  -23.574


fldr = Diretorio_Saida
project = Project()
project.new(fldr)

now = datetime.now()

current_time = now.strftime("%H:%M:%S")
print("Current Time =", current_time)

# We can create from a bounding box or a named place.
# For the sake of this example, we will choose the small nation of Nauru.
project.network.create_from_osm(model_area = [west,south,east,north])

now = datetime.now()

current_time = now.strftime("%H:%M:%S")
print("Current Time =", current_time)

project.close()


error message:

Traceback (most recent call last):
  File "/home/fabio/Documentos/OSM/./le_osm_box.py", line 44, in <module>
    project.network.create_from_osm(model_area = [west,south,east,north])
  File "/home/fabio/.local/lib/python3.10/site-packages/aequilibrae/project/network/network.py", line 168, in create_from_osm
    model_area.bounds[0] < -180
AttributeError: 'list' object has no attribute 'bounds'


Thanks a lot
Fábio Emanuel

Pedro Camargo

unread,
Feb 27, 2025, 3:20:57 PMFeb 27
to aequilibrae
AequilibraE moved away from using bounding boxes for project creation.  You should now using a Shapely polygon (or box).  Please take a look at the documentation:

Pedro



---- On Fri, 28 Feb 2025 02:36:10 +1000 Fabio Morais <fabio....@gmail.com> wrote ---

--
You received this message because you are subscribed to the Google Groups "AequilibraE" group.
To unsubscribe from this group and stop receiving emails from it, send an email to aequilibrae...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/aequilibrae/CADxpX0edekYNpCqTEhZ8y83Je5FYa_ekyDDNCCRms6Z7ibfyxw%40mail.gmail.com.


Reply all
Reply to author
Forward
0 new messages