Zone_id error [Building Transit Graph]

22 views
Skip to first unread message

Njabulo

unread,
Oct 15, 2025, 4:17:51 AMOct 15
to AequilibraE
Hi everyone,

I am trying to build transit graphs directly in python for a project situated in Cape Town but this error keeps being thrown:
 
Cell In[4], line 8 4 data = Transit(proj) 5 # data.remove_graphs([1]) 6 7 # Building transit graph ----> 8 graph = data.create_graph( 9 with_outer_stop_transfers=False, 10 with_walking_edges=False, 11 blocking_centroid_flows=False, 12 connector_method="overlapping_regions" 13 ) 14 # print("Available graphs:", proj.network.graphs.keys()) 15 # print("Connector edges:", len(edges[edges['is_connector'] == 1])) 16 # print("Number of stops:", len(data.transit_data.stops)) 17 # print(data.transit_data.stops.head()) in Transit.create_graph(self, **kwargs) 101 period_id = kwargs.pop("period_id", self.periods.default_period.period_id) 103 graph = TransitGraphBuilder(self.project, period_id, **kwargs) --> 104 graph.create_graph() 105 self.graphs[period_id] = graph 106 return graph

--> 212 raise ValueError("'zone_id' must consist of integers greater than 0") 214 if zones.geometry.dtype is str or zones.geometry.dtype is bytes: 215 geometry = shapely.from_wkt(zones.geometry.values) ValueError: 'zone_id' must consist of integers greater than 0

I've imported the network for Cape Town using OSM ,and also tried inserting the zones into the database manually and forcing the id's into integer types but I keep geting the same error. The zones are being created but it seems they can't be read by Aequilibrae. If anyone has experience with this, I would appreciate any assistance in resolving it. Thank you for your time.

Pedro Camargo

unread,
Oct 15, 2025, 8:57:03 AMOct 15
to Njabulo, AequilibraE
Hi Njabulo,

What's the version of AequilibraE that you are using?  And what version of AequilibraE did you use to import your GTFS feed (if different than the one you are using now)?

Cheers,
Pedro



---- On Wed, 15 Oct 2025 19:04:35 +1100 Njabulo <nathi...@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/fa60a7fe-740c-4772-8039-faae9ee58647n%40googlegroups.com.


Njabulo

unread,
Oct 15, 2025, 9:16:50 AMOct 15
to AequilibraE
Hi Pedro,

Thank you for your quick response.

I'm using version 1.5.0 and I imported my GTFS into the same version.

Njabulo

Pedro Camargo

unread,
Oct 15, 2025, 9:38:34 AMOct 15
to AequilibraE
What are the IDs of your zones?

Did you first try to create the transit graph before adding zones to your model?

If that's the case, try removing the comment on the line data.remove_graphs([1])


Cheers,
Pedro



---- On Thu, 16 Oct 2025 00:16:50 +1100 Njabulo <nathi...@gmail.com> wrote ---

Njabulo

unread,
Oct 15, 2025, 10:57:28 AMOct 15
to AequilibraE
The IDs are integers that assigned to each transit zone. 
Yes, I did and then I used that line data.remove_graphs([1]) to remove them but I still got the same error. 

Njabulo

Pedro Camargo

unread,
Oct 15, 2025, 10:25:47 PMOct 15
to AequilibraE
Transit zone or model zone?

You should have a zone layer in your model.

Cheers,
Pedro



---- On Thu, 16 Oct 2025 01:57:28 +1100 Njabulo <nathi...@gmail.com> wrote ---

Njabulo

unread,
Oct 16, 2025, 4:52:56 PMOct 16
to AequilibraE
It's transit zones. 

It doesn't pick them up when I run the graph builder, I'm just not sure why.

Njabulo

Pedro Camargo

unread,
Oct 16, 2025, 5:19:53 PMOct 16
to AequilibraE
DO you have different zone systems in the model and in the PT database?

Something we need to improve for sure is to remove the zone system from the PT database to disambiguate things!

Cheers,
Pedro


---- On Fri, 17 Oct 2025 07:52:56 +1100 Njabulo <nathi...@gmail.com> wrote ---

Reply all
Reply to author
Forward
0 new messages