Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

We have imported OSM networks to route on. So our IDs sometimes grow abnormally big ;)

It seems that PGRouting is failing with IDs like 633719916...

We got this error message from postgresql: "terminate called after throwing an instance of 'std::bad_alloc'".

Is there another way rather than renumbering our IDs?

Is there a "fix" planned from PGRouting?

Thanks for your help!

share|improve this question
up vote 3 down vote accepted

Quoting pgRouting mailing list:

It's probably the ID being to large, yes. [...] So if your total number of road links is OK and it would fit with integer, then it's better to renumber ID's, because it will also affect calculation speed.

share|improve this answer
Thanks underdark. I thought it would lead to this. – Axel Zingsem Apr 28 '11 at 9:27
Yes this seems to be a well known problem, but no one seems to know what the limit is. There are also limits on the most number of links/nodes loaded at once: I have been unable to route across the US using OSM data, for example. – winwaed Apr 29 '11 at 12:19
Well, the data type of source and target is 'bigint', so that's the theoretical limit. But in practice you should try to keep ID's low and without "wholes". – dkastl Jun 5 '12 at 9:47

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.