[pgrouting-users] pgrouting workshop

Pedro Costa pedrocostaarma at sapo.pt
Wed Jul 11 03:47:06 PDT 2012


I found the cause of my last problem:

pg_fetch_result(): Bad column offset specified in line 72



    $sql = "SELECT id, the_geom,
             distance(the_geom, GeometryFromText('POINT(".$lonlat[0]." 
".$lonlat[1].")', 27492)) AS dist
             FROM vertices_tmp
             ORDER BY dist LIMIT 1";

       $query = pg_query($con,$sql);

       $edge['id']      = pg_fetch_result($query, 0, 0);
       $edge['source']   = pg_fetch_result($query, 0, 1);
       $edge['target']   = pg_fetch_result($query, 0, 2);
       $edge['the_geom'] = pg_fetch_result($query, 0, 3); 
--------------------->here


Maybe because i'm trying to work with points of table vertices_tmp.
Do you know want i have wrong?







Em 11-07-2012 11:14, Daniel Kastl escreveu:
> Hi Pedro,
>
> When comparing your line with the workshop source on GitHub [1], I see 
> that you added "password" to the connection string.
> I think you're missing a "." before "Password" and are you sure the 
> syntax is correct and it needs to be a capital "P"?
>
> Daniel
>
>
>
> [1] 
> https://github.com/pgRouting/workshop/blob/master/web/php/pgrouting.php
>
> On Wed, Jul 11, 2012 at 10:47 AM, Pedro Costa <pedrocostaarma at sapo.pt 
> <mailto:pedrocostaarma at sapo.pt>> wrote:
>
>
>     Hi Daniel
>
>
>     In apache log i found this error:
>
>     [error] an unknown filter was not added: PHP
>     [error] [client my client] PHP Parse error:  syntax error,
>     unexpected T_CONSTANT_ENCAPSED_STRING in 'my
>     domain'/routing/php/pgrouting.php on line 42, referer:
>
>
>     Line 42 is my db data:
>
>
>      // Connect to database
>       $con = pg_connect("dbname=".PG_DB." host=".PG_HOST."
>     user=".PG_USER "Password=".PG_PASS);
>
>
>
>     do you know what is the problem?
>
>
>     Thanks
>
>
>
>
>
>
>     Em 10-07-2012 17:12, Daniel Kastl escreveu:
>>
>>
>>         server: http://pastebin.com/tdWDgj54
>>
>>
>>     You're missing quotation in line 11 ... that's when the code
>>     highlighting becomes weird.
>>
>>     Otherwise, try to output the SQL queries to the server log and
>>     then run the query in the terminal.
>>     Like this you can see if your query is OK or not.
>>
>>     Daniel
>>
>>
>>
>>     -- 
>>     Georepublic UG & Georepublic Japan
>>     eMail: daniel.kastl at georepublic.de
>>     <mailto:daniel.kastl at georepublic.de>
>>     Web: http://georepublic.de <http://georepublic.de/>
>>
>>
>>     _______________________________________________
>>     Pgrouting-users mailing list
>>     Pgrouting-users at lists.osgeo.org  <mailto:Pgrouting-users at lists.osgeo.org>
>>     http://lists.osgeo.org/mailman/listinfo/pgrouting-users
>
>
>
>     _______________________________________________
>     Pgrouting-users mailing list
>     Pgrouting-users at lists.osgeo.org
>     <mailto:Pgrouting-users at lists.osgeo.org>
>     http://lists.osgeo.org/mailman/listinfo/pgrouting-users
>
>
>
>
> -- 
> Georepublic UG & Georepublic Japan
> eMail: daniel.kastl at georepublic.de <mailto:daniel.kastl at georepublic.de>
> Web: http://georepublic.de <http://georepublic.de/>
>
>
> _______________________________________________
> Pgrouting-users mailing list
> Pgrouting-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/pgrouting-users


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/pgrouting-users/attachments/20120711/2346a14b/attachment.html>


More information about the Pgrouting-users mailing list