<div class="body">
<p>
Hello,
</p>
<p>
I am trying to have routing working for city of Toronto data.
But,nothing shows up and a problem is seen in the <a class="missing
wiki">FindNearestEdge</a>() method.
</p>
<p>
One example request sent to the routing php is as follows:
routing.php?startpoint=-8837720.7293944
5412947.799546&finalpoint=-8836963.525083
5412307.6394342&method=SPD&srid=900913
</p>
<p>
My understanding is that projection for the pgRouting database is 4326
and for the tiles displayed in <a class="wiki" href="http://pgrouting.postlbs.org/wiki/OpenLayers">OpenLayers</a> it is
900913. (In the code both the html and php projection values are set to
900913. However I am not clear as to how to make the projection changes --
whether modify the pgRouting database or change <a class="wiki" href="http://pgrouting.postlbs.org/wiki/OpenLayers">OpenLayers</a> HTML
page).
</p>
<p>
Further details are below
</p>
<hr>
<p>
- The tiles were rendered through generate_tiles.py script of postgis
database for Toronto routes. I found Ontario.osm and then extracted city
of Toronto osm data. Then, created the pgRouting database. Now my map
displays the tiles correctly in 900913 projection.
</p>
<p>
- I am not sure but maybe the pgRouting database is 4326 projection,
because for A* search the x1,y1... are shown in latlng. ...?
</p>
<p>
The HTML page is very similar to: <a href="http://pgrouting.postlbs.org/wiki/Workshop-RoutingRequest">http://pgrouting.postlbs.org/wiki/Workshop-RoutingRequest</a>
Except that instead of 54004 projection, I use 9000913 projection.
</p>
<p>
The php page is same as <a href="http://pgrouting.postlbs.org/wiki/Workshop-ClosestEdge">http://pgrouting.postlbs.org/wiki/Workshop-ClosestEdge</a>
Again I have set projection to 900913 here.
</p>
<blockquote>
<p>
Code snippet:
</p>
</blockquote>
<p>
...
</p>
<blockquote>
<p>
$sql = "SELECT gid, source, target, the_geom,astext(the_geom),
</p>
<blockquote>
<p>
distance(the_geom, <a class="missing wiki">GeometryFromText?</a>(
</p>
<blockquote>
<p>
'POINT(".$lonlat<a class="missing changeset" title="No changeset 0 in
the repository">[0]</a>." ".$lonlat<a class="changeset" href="http://pgrouting.postlbs.org/changeset/1" title="Initial import">[1]</a>.")',
900913)) AS dist
</p>
</blockquote>
</blockquote>
<p>
FROM ".TABLE."
WHERE the_geom && setsrid(
</p>
<blockquote>
<blockquote>
<p>
'BOX3D(".($lonlat<a class="missing changeset" title="No changeset 0 in
the repository">[0]</a>-200)."
</p>
<blockquote>
<p>
".($lonlat<a class="changeset" href="http://pgrouting.postlbs.org/changeset/1" title="Initial import">[1]</a>-200).",
".($lonlat<a class="missing changeset" title="No changeset 0 in the
repository">[0]</a>+200)."
".($lonlat<a class="changeset" href="http://pgrouting.postlbs.org/changeset/1" title="Initial import">[1]</a>+200).")'::box3d,
900913)
</p>
</blockquote>
</blockquote>
</blockquote>
<p>
ORDER BY dist LIMIT 1";
</p>
</blockquote>
<p>
...
</p>
<p>
The problem is when the php script runs, findNearestEdge() method doesn't
work and one warning as followed shown:
</p>
<p>
PHP Warning: pg_fetch_result(): Unable to jump to row 0 on PostgreSQL
result index 3
...
</p>
<p>
I am not sure of the problem. Please, if you have ideas let me know.
</p>
</div>