woodbri / osrm-tools

Tools to extract postgresql database into OSRM normalized files, and postgresql function to access OSRM Server.
BSD 2-Clause "Simplified" License
30 stars 6 forks source link

ERROR: integer out of range #1

Closed sercoin closed 10 years ago

sercoin commented 10 years ago

Hi,

I create my tables same as "ddnoded2" tables. But when I try to run pgr2osrm I got this error;

Writing vertices to streets.osrm file ... ERROR: integer out of range

How can I solve that? Can you help me?

woodbri commented 10 years ago

Hmmm, looking at the code, I seem to have a small bug. I will push a change for this. Line 135 of pgr2osrm.cpp

int32_t lat = row["lat"].as<uint32_t>();

should be:

int32_t lat = row["lat"].as<int32_t>();
woodbri commented 10 years ago

Closing. 37057c6..550a555 fix pushed to master.

sercoin commented 10 years ago

Creating names table ... Writing streets.osrm.names file ... 1775 records Writing vertices to streets.osrm file ... ERROR: integer out of range

I still get this error. I changed line 135 like you said.

woodbri commented 10 years ago

What does select min(id), max(id) from vertices_tmp; report? id values must be unsigned 32bit integers.

sercoin commented 10 years ago

Results are min(id)=1 max(id)=65329

woodbri commented 10 years ago

Are your coordinates in lat/lon degrees? What does this report: select min(st_x(the_geom)), min(st_y(the_geom)), max(st_x(the_geom)), max(st_y(the_geom)) from vertices_tmp;

sercoin commented 10 years ago

5194199.72306648 ;3315880.66657522; 5390616.28540176; 3516524.91557929 in this order

woodbri commented 10 years ago

You data is not in decimal degrees. This is required by OSRM. You will need to project all you data into srid 4326.