[postgis-users] ERROR: Error computing path: | SQL state: 38001
Birgit Laggner
birgit.laggner at vti.bund.de
Wed Feb 22 02:11:13 PST 2012
Hi Palatla,
I only saw in the documentation that the order of arguments in the
sql-expression used in the function shortest_path_astar is slightly
different from the one you are using:
This is an example from the documentation
(http://www.pgrouting.org/docs/1.x/astar.html):
SELECT * FROM shortest_path_astar('SELECT gid AS id, source::int4,
target::int4, length::double precision AS cost,length::double precision
AS reverse_cost, x1, y1, x2, y2 FROM dourol', 3, 7, true, true);
As you can see, cost and reverse_cost are placed before the coordinates.
Perhaps this might be the cause of the problem?
Hope that helps,
Birgit.
Am 22.02.2012 09:41, schrieb Palatla Srikanth:
>
> Hi,
>
> We are developing an web application that users PostgreSQL 8.4 +
> PostGIS1.5 + Pgrouting 1.03 + development using (Java + Struts +
> Hibernate)
>
> *When this Query is executed:*
>
> SELECT ST_AsText(the_geom),id AS Coords FROM delhi_road WHERE id IN
> (SELECT edge_id FROM shortest_path_astar('SELECT id, source,
> target,x1,y1,x2,y2,cost,reverse_cost from delhi_road',550,662,true,true))
>
> We are getting the below mentioned error and the other users accessing
> the application were too facing the database exceptions. Can someone
> help us to fix this issue.
>
> -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
> *Error from the postgreSQL query*
>
> ERROR: Error computing path:
>
> ********** Error **********
>
> ERROR: Error computing path:
>
> SQL state: 38001
>
> ------------------------------------------------------------------------
>
> *Query used:*
>
> **
>
> SELECT ST_AsText(the_geom),id AS Coords FROM delhi_road WHERE id IN
> (SELECT edge_id FROM shortest_path_astar('SELECT id, source,
> target,x1,y1,x2,y2,cost,reverse_cost from delhi_road',550,662,true,true))
>
> -------------------------------------------------------------------------
>
> *Error on the Application server (IDE)*
>
> [ INFO] 46:48 (_MapServiceDAO.java:generateRoute:1525_)
>
> Query is......SELECT ST_AsText(the_geom),id AS Coords FROM delhi_road
> WHERE id IN (SELECT edge_id FROM shortest_path_astar('SELECT id,
> source, target,x1,y1,x2,y2,cost,reverse_cost from
> delhi_road',550,662,true,true))
>
> [ INFO] 46:48 (_MapServiceDAO.java:generateRoute:1552_)
>
> Exception _aala.........org.postgresql.util.PSQLException_: ERROR:
> Error computing path: _
>
> Feb 22, 2012 11:46:48 AM org.apache.catalina.core.StandardWrapperValve
> invoke
>
> SEVERE: Servlet.service() for servlet GenerateRoute threw exception
>
> _org.hibernate.SessionException_: Session was already closed
>
> at org.hibernate.impl.SessionImpl.close(_SessionImpl.java:303_)
>
> at
> com.tis.hib.util.HibernateSessionFactory.closeSession(_HibernateSessionFactory.java:86_)
>
> at
> com.tis.dao.impl.MapServiceDAO.generateRoute(_MapServiceDAO.java:1572_)
>
> at com.tis.servlet.GenerateRoute.doGet(_GenerateRoute.java:125_)
>
> at javax.servlet.http.HttpServlet.service(_HttpServlet.java:690_)
>
> at javax.servlet.http.HttpServlet.service(_HttpServlet.java:803_)
>
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(_ApplicationFilterChain.java:290_)
>
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(_ApplicationFilterChain.java:206_)
>
> at
> org.apache.catalina.core.StandardWrapperValve.invoke(_StandardWrapperValve.java:230_)
>
> at
> org.apache.catalina.core.StandardContextValve.invoke(_StandardContextValve.java:175_)
>
> at
> org.apache.catalina.core.StandardHostValve.invoke(_StandardHostValve.java:128_)
>
> at
> org.apache.catalina.valves.ErrorReportValve.invoke(_ErrorReportValve.java:104_)
>
> at
> org.apache.catalina.core.StandardEngineValve.invoke(_StandardEngineValve.java:109_)
>
> at
> org.apache.catalina.connector.CoyoteAdapter.service(_CoyoteAdapter.java:261_)
>
> at
> org.apache.coyote.http11.Http11Processor.process(_Http11Processor.java:844_)
>
> at
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(_Http11Protocol.java:581_)
>
> at
> org.apache.tomcat.util.net.JIoEndpoint$Worker.run(_JIoEndpoint.java:447_)
>
> at java.lang.Thread.run(_Thread.java:619_)
>
> *Regards,*
>
> *Palatla Srikanth*
>
>
>
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20120222/b1c3856d/attachment.html>
More information about the postgis-users
mailing list