[pgrouting-users] pgrouting workshop

Hi guys,

I'm playing with pgrouting workshop of FOSS4G 2011.
There is any link to download the workshop material?

Thanks

Pedro

Hi Pedro,

The years before it was always available on OSGeo server: http://download.osgeo.org/pgrouting/foss4g2010/
It seems I forgot to place the 2011 workshop there as well.

The workshop documentation source is on Github: https://github.com/pgRouting/workshop
So all you’re missing is the sample data. But you can download any OSM data or even use the sample data of 2010.

In case you’re using Ubuntu/Debian you can install last years workshop as a package easily:
https://launchpad.net/~georepublic/+archive/pgrouting/+packages
It contains the sample data of Denver as well. Or you download the tarball [1] and extract it.

Or, you use OSGeo Live DVD. It contains the workshop as well:
http://live.osgeo.org/en/quickstart/pgrouting_quickstart.html (see “What’s next” at the end of the page).

Hope that helps,
Daniel

[1] https://launchpad.net/~georepublic/+archive/pgrouting/+files/pgrouting%2Bworkshop_0.6.1.orig.tar.gz

On Tue, Jul 10, 2012 at 10:15 AM, Pedro Costa <pedrocostaarma@sapo.pt> wrote:

Hi guys,

I’m playing with pgrouting workshop of FOSS4G 2011.
There is any link to download the workshop material?

Thanks

Pedro


Pgrouting-users mailing list
Pgrouting-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/pgrouting-users


Georepublic UG & Georepublic Japan
eMail: daniel.kastl@georepublic.de
Web: http://georepublic.de

Hi Daniel,

thanks for your help

Em 10-07-2012 09:33, Daniel Kastl escreveu:

Hi Pedro,

The years before it was always available on OSGeo server: http://download.osgeo.org/pgrouting/foss4g2010/
It seems I forgot to place the 2011 workshop there as well.

The workshop documentation source is on Github: https://github.com/pgRouting/workshop
So all you're missing is the sample data. But you can download any OSM data or even use the sample data of 2010.

In case you're using Ubuntu/Debian you can install last years workshop as a package easily:
https://launchpad.net/~georepublic/+archive/pgrouting/+packages <https://launchpad.net/~georepublic/+archive/pgrouting/+packages&gt;
It contains the sample data of Denver as well. Or you download the tarball [1] and extract it.

Or, you use OSGeo Live DVD. It contains the workshop as well:
http://live.osgeo.org/en/quickstart/pgrouting_quickstart.html (see "What's next" at the end of the page).

Hope that helps,
Daniel

[1] https://launchpad.net/~georepublic/+archive/pgrouting/+files/pgrouting%2Bworkshop_0.6.1.orig.tar.gz <https://launchpad.net/~georepublic/+archive/pgrouting/+files/pgrouting%2Bworkshop_0.6.1.orig.tar.gz&gt;

On Tue, Jul 10, 2012 at 10:15 AM, Pedro Costa <pedrocostaarma@sapo.pt <mailto:pedrocostaarma@sapo.pt>> wrote:

    Hi guys,

    I'm playing with pgrouting workshop of FOSS4G 2011.
    There is any link to download the workshop material?

    Thanks

    Pedro
    _______________________________________________
    Pgrouting-users mailing list
    Pgrouting-users@lists.osgeo.org
    <mailto:Pgrouting-users@lists.osgeo.org>
    http://lists.osgeo.org/mailman/listinfo/pgrouting-users

--
Georepublic UG & Georepublic Japan
eMail: daniel.kastl@georepublic.de <mailto:daniel.kastl@georepublic.de>
Web: http://georepublic.de/&gt;

_______________________________________________
Pgrouting-users mailing list
Pgrouting-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/pgrouting-users

I'm trying to adapt this function (findnearestedge) [1] to my routing data that are in srs 27492.

Someone can help me with that?

thanks

[1]

$startEdge = findNearestEdge($startPoint);
  $endEdge = findNearestEdge($endPoint);

   function findNearestEdge($lonlat) {

SELECT gid, source, target, the_geom,
                   distance(the_geom, GeometryFromText(
                        'POINT(".$lonlat[0]." ".$lonlat[1].")', 4326)) AS dist
                  FROM ".TABLE."
                  WHERE the_geom && setsrid(
                        'BOX3D(".($lonlat[0]-0.1)."
                               ".($lonlat[1]-0.1).",
                               ".($lonlat[0]+0.1)."
                               ".($lonlat[1]+0.1).")'::box3d, 4326)
                  ORDER BY dist LIMIT 1"

Em 10-07-2012 09:33, Daniel Kastl escreveu:

Hi Pedro,

The years before it was always available on OSGeo server: http://download.osgeo.org/pgrouting/foss4g2010/
It seems I forgot to place the 2011 workshop there as well.

The workshop documentation source is on Github: https://github.com/pgRouting/workshop
So all you're missing is the sample data. But you can download any OSM data or even use the sample data of 2010.

In case you're using Ubuntu/Debian you can install last years workshop as a package easily:
https://launchpad.net/~georepublic/+archive/pgrouting/+packages <https://launchpad.net/~georepublic/+archive/pgrouting/+packages&gt;
It contains the sample data of Denver as well. Or you download the tarball [1] and extract it.

Or, you use OSGeo Live DVD. It contains the workshop as well:
http://live.osgeo.org/en/quickstart/pgrouting_quickstart.html (see "What's next" at the end of the page).

Hope that helps,
Daniel

[1] https://launchpad.net/~georepublic/+archive/pgrouting/+files/pgrouting%2Bworkshop_0.6.1.orig.tar.gz <https://launchpad.net/~georepublic/+archive/pgrouting/+files/pgrouting%2Bworkshop_0.6.1.orig.tar.gz&gt;

On Tue, Jul 10, 2012 at 10:15 AM, Pedro Costa <pedrocostaarma@sapo.pt <mailto:pedrocostaarma@sapo.pt>> wrote:

    Hi guys,

    I'm playing with pgrouting workshop of FOSS4G 2011.
    There is any link to download the workshop material?

    Thanks

    Pedro
    _______________________________________________
    Pgrouting-users mailing list
    Pgrouting-users@lists.osgeo.org
    <mailto:Pgrouting-users@lists.osgeo.org>
    http://lists.osgeo.org/mailman/listinfo/pgrouting-users

--
Georepublic UG & Georepublic Japan
eMail: daniel.kastl@georepublic.de <mailto:daniel.kastl@georepublic.de>
Web: http://georepublic.de/&gt;

_______________________________________________
Pgrouting-users mailing list
Pgrouting-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/pgrouting-users

Hi Pedro,

In which projection are your start and end point?You need to use ST_transform(,) if the projection is different.
In the workshop the data is in 4326 (WGS84) and so you can find this SRID in the SQL statement.

Daniel

On Tue, Jul 10, 2012 at 11:42 AM, Pedro Costa <pedrocostaarma@sapo.pt> wrote:

I’m trying to adapt this function (findnearestedge) [1] to my routing data that are in srs 27492.

Someone can help me with that?

thanks

[1]

$startEdge = findNearestEdge($startPoint);
$endEdge = findNearestEdge($endPoint);

function findNearestEdge($lonlat) {

SELECT gid, source, target, the_geom,
distance(the_geom, GeometryFromText(
‘POINT(“.$lonlat[0].” “.$lonlat[1].”)’, 4326)) AS dist
FROM “.TABLE.”
WHERE the_geom && setsrid(
‘BOX3D(“.($lonlat[0]-0.1).”
“.($lonlat[1]-0.1).”,
“.($lonlat[0]+0.1).”
“.($lonlat[1]+0.1).”)’::box3d, 4326)
ORDER BY dist LIMIT 1"

Em 10-07-2012 09:33, Daniel Kastl escreveu:

Hi Pedro,

The years before it was always available on OSGeo server: http://download.osgeo.org/pgrouting/foss4g2010/
It seems I forgot to place the 2011 workshop there as well.

The workshop documentation source is on Github: https://github.com/pgRouting/workshop
So all you’re missing is the sample data. But you can download any OSM data or even use the sample data of 2010.

In case you’re using Ubuntu/Debian you can install last years workshop as a package easily:
https://launchpad.net/~georepublic/+archive/pgrouting/+packages
It contains the sample data of Denver as well. Or you download the tarball [1] and extract it.

Or, you use OSGeo Live DVD. It contains the workshop as well:
http://live.osgeo.org/en/quickstart/pgrouting_quickstart.html (see “What’s next” at the end of the page).

Hope that helps,
Daniel

[1] https://launchpad.net/~georepublic/+archive/pgrouting/+files/pgrouting%2Bworkshop_0.6.1.orig.tar.gz

On Tue, Jul 10, 2012 at 10:15 AM, Pedro Costa <pedrocostaarma@sapo.pt> wrote:

Hi guys,

I’m playing with pgrouting workshop of FOSS4G 2011.
There is any link to download the workshop material?

Thanks

Pedro


Pgrouting-users mailing list
Pgrouting-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/pgrouting-users


Georepublic UG & Georepublic Japan
eMail: daniel.kastl@georepublic.de
Web: http://georepublic.de

_______________________________________________
Pgrouting-users mailing list
[Pgrouting-users@lists.osgeo.org](mailto:Pgrouting-users@lists.osgeo.org)
[http://lists.osgeo.org/mailman/listinfo/pgrouting-users](http://lists.osgeo.org/mailman/listinfo/pgrouting-users)


Pgrouting-users mailing list
Pgrouting-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/pgrouting-users


Georepublic UG & Georepublic Japan
eMail: daniel.kastl@georepublic.de
Web: http://georepublic.de

I'm confused.
My map is in srs 900913 and my tables in postgis are in srs 27492.

In workshop example the points are converted to srs 4326 why?
Because the funcion findnearestedge needs the data in srs 4326?
If yes, i just need to convert to my table srs (900913) correct?

Thanks

          [1] var startpoint = layer.features[0].geometry.clone();
              startpoint.transform(epsg_900913, epsg_4326);
              var finalpoint = layer.features[1].geometry.clone();
              finalpoint.transform(epsg_900913, epsg_4326);

Em 10-07-2012 11:09, Daniel Kastl escreveu:

Hi Pedro,

In which projection are your start and end point?
You need to use ST_transform(<geom>,<srid>) if the projection is different.
In the workshop the data is in 4326 (WGS84) and so you can find this SRID in the SQL statement.

Daniel

On Tue, Jul 10, 2012 at 11:42 AM, Pedro Costa <pedrocostaarma@sapo.pt <mailto:pedrocostaarma@sapo.pt>> wrote:

    I'm trying to adapt this function (findnearestedge) [1] to my
    routing data that are in srs 27492.

    Someone can help me with that?

    thanks

    [1]

    $startEdge = findNearestEdge($startPoint);
     $endEdge = findNearestEdge($endPoint);

      function findNearestEdge($lonlat) {

    SELECT gid, source, target, the_geom,
                      distance(the_geom, GeometryFromText(
                           'POINT(".$lonlat[0]." ".$lonlat[1].")',
    4326)) AS dist
                     FROM ".TABLE."
                     WHERE the_geom && setsrid(
                           'BOX3D(".($lonlat[0]-0.1)."
                                  ".($lonlat[1]-0.1).",
                                  ".($lonlat[0]+0.1)."
    ".($lonlat[1]+0.1).")'::box3d, 4326)
                     ORDER BY dist LIMIT 1"

    Em 10-07-2012 09:33, Daniel Kastl escreveu:

    Hi Pedro,

    The years before it was always available on OSGeo server:
    http://download.osgeo.org/pgrouting/foss4g2010/
    It seems I forgot to place the 2011 workshop there as well.

    The workshop documentation source is on Github:
    https://github.com/pgRouting/workshop
    So all you're missing is the sample data. But you can download
    any OSM data or even use the sample data of 2010.

    In case you're using Ubuntu/Debian you can install last years
    workshop as a package easily:
    https://launchpad.net/~georepublic/+archive/pgrouting/+packages
    <https://launchpad.net/~georepublic/+archive/pgrouting/+packages&gt;
    It contains the sample data of Denver as well. Or you download
    the tarball [1] and extract it.

    Or, you use OSGeo Live DVD. It contains the workshop as well:
    http://live.osgeo.org/en/quickstart/pgrouting_quickstart.html (see "What's
    next" at the end of the page).

    Hope that helps,
    Daniel

    [1]
    https://launchpad.net/~georepublic/+archive/pgrouting/+files/pgrouting%2Bworkshop_0.6.1.orig.tar.gz
    <https://launchpad.net/~georepublic/+archive/pgrouting/+files/pgrouting%2Bworkshop_0.6.1.orig.tar.gz&gt;

    On Tue, Jul 10, 2012 at 10:15 AM, Pedro Costa
    <pedrocostaarma@sapo.pt <mailto:pedrocostaarma@sapo.pt>> wrote:

        Hi guys,

        I'm playing with pgrouting workshop of FOSS4G 2011.
        There is any link to download the workshop material?

        Thanks

        Pedro
        _______________________________________________
        Pgrouting-users mailing list
        Pgrouting-users@lists.osgeo.org
        <mailto:Pgrouting-users@lists.osgeo.org>
        http://lists.osgeo.org/mailman/listinfo/pgrouting-users

    -- Georepublic UG & Georepublic Japan
    eMail: daniel.kastl@georepublic.de
    <mailto:daniel.kastl@georepublic.de>
    Web: http://georepublic.de/&gt;

    _______________________________________________
    Pgrouting-users mailing list
    Pgrouting-users@lists.osgeo.org <mailto:Pgrouting-users@lists.osgeo.org>
    http://lists.osgeo.org/mailman/listinfo/pgrouting-users

    _______________________________________________
    Pgrouting-users mailing list
    Pgrouting-users@lists.osgeo.org
    <mailto:Pgrouting-users@lists.osgeo.org>
    http://lists.osgeo.org/mailman/listinfo/pgrouting-users

--
Georepublic UG & Georepublic Japan
eMail: daniel.kastl@georepublic.de <mailto:daniel.kastl@georepublic.de>
Web: http://georepublic.de/&gt;

_______________________________________________
Pgrouting-users mailing list
Pgrouting-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/pgrouting-users

On Tue, Jul 10, 2012 at 12:47 PM, Pedro Costa <pedrocostaarma@sapo.pt> wrote:

I’m confused.
My map is in srs 900913 and my tables in postgis are in srs 27492.

In workshop example the points are converted to srs 4326 why?
Because the funcion findnearestedge needs the data in srs 4326?
If yes, i just need to convert to my table srs (900913) correct?

Hi Pedro,

OSM data imported with osm2pgrouting or osm2po are WGS84 (4326), so this is what you have in the database.
OpenLayers uses World Mercator projection (900913 and there are some aliases), so start point and end point in the workshop need to be transformed to 4326.

In your case you had to replace 4326 with 27492, I guess, assuming that you use OpenLayers (GeoExt) and your dataset.

Daniel

Thanks

[1] var startpoint = layer.features[0].geometry.clone();
startpoint.transform(epsg_900913, epsg_4326);
var finalpoint = layer.features[1].geometry.clone();
finalpoint.transform(epsg_900913, epsg_4326);

Em 10-07-2012 11:09, Daniel Kastl escreveu:

Hi Pedro,

In which projection are your start and end point?You need to use ST_transform(,) if the projection is different.
In the workshop the data is in 4326 (WGS84) and so you can find this SRID in the SQL statement.

Daniel

On Tue, Jul 10, 2012 at 11:42 AM, Pedro Costa <pedrocostaarma@sapo.pt> wrote:

I’m trying to adapt this function (findnearestedge) [1] to my routing data that are in srs 27492.

Someone can help me with that?

thanks

[1]

$startEdge = findNearestEdge($startPoint);
$endEdge = findNearestEdge($endPoint);

function findNearestEdge($lonlat) {

SELECT gid, source, target, the_geom,
distance(the_geom, GeometryFromText(
‘POINT(“.$lonlat[0].” “.$lonlat[1].”)’, 4326)) AS dist
FROM “.TABLE.”
WHERE the_geom && setsrid(
‘BOX3D(“.($lonlat[0]-0.1).”
“.($lonlat[1]-0.1).”,
“.($lonlat[0]+0.1).”
“.($lonlat[1]+0.1).”)’::box3d, 4326)
ORDER BY dist LIMIT 1"

Em 10-07-2012 09:33, Daniel Kastl escreveu:

Hi Pedro,

The years before it was always available on OSGeo server: http://download.osgeo.org/pgrouting/foss4g2010/
It seems I forgot to place the 2011 workshop there as well.

The workshop documentation source is on Github: https://github.com/pgRouting/workshop
So all you’re missing is the sample data. But you can download any OSM data or even use the sample data of 2010.

In case you’re using Ubuntu/Debian you can install last years workshop as a package easily:
https://launchpad.net/~georepublic/+archive/pgrouting/+packages
It contains the sample data of Denver as well. Or you download the tarball [1] and extract it.

Or, you use OSGeo Live DVD. It contains the workshop as well:
http://live.osgeo.org/en/quickstart/pgrouting_quickstart.html (see “What’s next” at the end of the page).

Hope that helps,
Daniel

[1] https://launchpad.net/~georepublic/+archive/pgrouting/+files/pgrouting%2Bworkshop_0.6.1.orig.tar.gz

On Tue, Jul 10, 2012 at 10:15 AM, Pedro Costa <pedrocostaarma@sapo.pt> wrote:

Hi guys,

I’m playing with pgrouting workshop of FOSS4G 2011.
There is any link to download the workshop material?

Thanks

Pedro


Pgrouting-users mailing list
Pgrouting-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/pgrouting-users


Georepublic UG & Georepublic Japan
eMail: daniel.kastl@georepublic.de
Web: http://georepublic.de

_______________________________________________
Pgrouting-users mailing list
[Pgrouting-users@lists.osgeo.org](mailto:Pgrouting-users@lists.osgeo.org)
[http://lists.osgeo.org/mailman/listinfo/pgrouting-users](http://lists.osgeo.org/mailman/listinfo/pgrouting-users)


Pgrouting-users mailing list
Pgrouting-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/pgrouting-users


Georepublic UG & Georepublic Japan
eMail: daniel.kastl@georepublic.de
Web: http://georepublic.de

_______________________________________________
Pgrouting-users mailing list
[Pgrouting-users@lists.osgeo.org](mailto:Pgrouting-users@lists.osgeo.org)
[http://lists.osgeo.org/mailman/listinfo/pgrouting-users](http://lists.osgeo.org/mailman/listinfo/pgrouting-users)


Pgrouting-users mailing list
Pgrouting-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/pgrouting-users


Georepublic UG & Georepublic Japan
eMail: daniel.kastl@georepublic.de
Web: http://georepublic.de

Thanks again Daniel.
Now i'm trying everything but i get this error in firebug:

"NetworkError: 500 Internal Server Error - http://mydomain.pt/routing/php/pgrouting.php?startpoint=89314.61677724583%20123959.32146482218&finalpoint=90696.99736799067%20123514.05047980057&method=SP&quot;

I don't have to define password of database in php file?

Em 10-07-2012 13:22, Daniel Kastl escreveu:

On Tue, Jul 10, 2012 at 12:47 PM, Pedro Costa <pedrocostaarma@sapo.pt <mailto:pedrocostaarma@sapo.pt>> wrote:

    I'm confused.
    My map is in srs 900913 and my tables in postgis are in srs 27492.

    In workshop example the points are converted to srs 4326 why?
    Because the funcion findnearestedge needs the data in srs 4326?
    If yes, i just need to convert to my table srs (900913) correct?

Hi Pedro,

OSM data imported with osm2pgrouting or osm2po are WGS84 (4326), so this is what you have in the database.
OpenLayers uses World Mercator projection (900913 and there are some aliases), so start point and end point in the workshop need to be transformed to 4326.

In your case you had to replace 4326 with 27492, I guess, assuming that you use OpenLayers (GeoExt) and your dataset.

Daniel

    Thanks

             [1] var startpoint = layer.features[0].geometry.clone();
                 startpoint.transform(epsg_900913, epsg_4326);
                 var finalpoint = layer.features[1].geometry.clone();
                 finalpoint.transform(epsg_900913, epsg_4326);

    Em 10-07-2012 11:09, Daniel Kastl escreveu:

    Hi Pedro,

    In which projection are your start and end point?
    You need to use ST_transform(<geom>,<srid>) if the projection is
    different.
    In the workshop the data is in 4326 (WGS84) and so you can find
    this SRID in the SQL statement.

    Daniel

    On Tue, Jul 10, 2012 at 11:42 AM, Pedro Costa
    <pedrocostaarma@sapo.pt <mailto:pedrocostaarma@sapo.pt>> wrote:

        I'm trying to adapt this function (findnearestedge) [1] to my
        routing data that are in srs 27492.

        Someone can help me with that?

        thanks

        [1]

        $startEdge = findNearestEdge($startPoint);
         $endEdge = findNearestEdge($endPoint);

          function findNearestEdge($lonlat) {

        SELECT gid, source, target, the_geom,
                          distance(the_geom, GeometryFromText(
                               'POINT(".$lonlat[0]."
        ".$lonlat[1].")', 4326)) AS dist
                         FROM ".TABLE."
                         WHERE the_geom && setsrid(
        'BOX3D(".($lonlat[0]-0.1)."
        ".($lonlat[1]-0.1).",
        ".($lonlat[0]+0.1)."
        ".($lonlat[1]+0.1).")'::box3d, 4326)
                         ORDER BY dist LIMIT 1"

        Em 10-07-2012 09:33, Daniel Kastl escreveu:

        Hi Pedro,

        The years before it was always available on OSGeo server:
        http://download.osgeo.org/pgrouting/foss4g2010/
        It seems I forgot to place the 2011 workshop there as well.

        The workshop documentation source is on Github:
        https://github.com/pgRouting/workshop
        So all you're missing is the sample data. But you can
        download any OSM data or even use the sample data of 2010.

        In case you're using Ubuntu/Debian you can install last
        years workshop as a package easily:
        https://launchpad.net/~georepublic/+archive/pgrouting/+packages
        <https://launchpad.net/~georepublic/+archive/pgrouting/+packages&gt;
        It contains the sample data of Denver as well. Or you
        download the tarball [1] and extract it.

        Or, you use OSGeo Live DVD. It contains the workshop as well:
        http://live.osgeo.org/en/quickstart/pgrouting_quickstart.html (see
        "What's next" at the end of the page).

        Hope that helps,
        Daniel

        [1]
        https://launchpad.net/~georepublic/+archive/pgrouting/+files/pgrouting%2Bworkshop_0.6.1.orig.tar.gz
        <https://launchpad.net/~georepublic/+archive/pgrouting/+files/pgrouting%2Bworkshop_0.6.1.orig.tar.gz&gt;

        On Tue, Jul 10, 2012 at 10:15 AM, Pedro Costa
        <pedrocostaarma@sapo.pt <mailto:pedrocostaarma@sapo.pt>> wrote:

            Hi guys,

            I'm playing with pgrouting workshop of FOSS4G 2011.
            There is any link to download the workshop material?

            Thanks

            Pedro
            _______________________________________________
            Pgrouting-users mailing list
            Pgrouting-users@lists.osgeo.org
            <mailto:Pgrouting-users@lists.osgeo.org>
            http://lists.osgeo.org/mailman/listinfo/pgrouting-users

        -- Georepublic UG & Georepublic Japan
        eMail: daniel.kastl@georepublic.de
        <mailto:daniel.kastl@georepublic.de>
        Web: http://georepublic.de/&gt;

        _______________________________________________
        Pgrouting-users mailing list
        Pgrouting-users@lists.osgeo.org <mailto:Pgrouting-users@lists.osgeo.org>
        http://lists.osgeo.org/mailman/listinfo/pgrouting-users

        _______________________________________________
        Pgrouting-users mailing list
        Pgrouting-users@lists.osgeo.org
        <mailto:Pgrouting-users@lists.osgeo.org>
        http://lists.osgeo.org/mailman/listinfo/pgrouting-users

    -- Georepublic UG & Georepublic Japan
    eMail: daniel.kastl@georepublic.de
    <mailto:daniel.kastl@georepublic.de>
    Web: http://georepublic.de/&gt;

    _______________________________________________
    Pgrouting-users mailing list
    Pgrouting-users@lists.osgeo.org <mailto:Pgrouting-users@lists.osgeo.org>
    http://lists.osgeo.org/mailman/listinfo/pgrouting-users

    _______________________________________________
    Pgrouting-users mailing list
    Pgrouting-users@lists.osgeo.org
    <mailto:Pgrouting-users@lists.osgeo.org>
    http://lists.osgeo.org/mailman/listinfo/pgrouting-users

--
Georepublic UG & Georepublic Japan
eMail: daniel.kastl@georepublic.de <mailto:daniel.kastl@georepublic.de>
Web: http://georepublic.de/&gt;

_______________________________________________
Pgrouting-users mailing list
Pgrouting-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/pgrouting-users

Hi Pedro,

You need to check your webserver and PostgreSQL log file.
Can you run SQL queries directly in your Terminal window?
Do you have postgresql extension for PHP installed?

Daniel

On Tue, Jul 10, 2012 at 5:17 PM, Pedro Costa <pedrocostaarma@sapo.pt> wrote:

Thanks again Daniel.
Now i’m trying everything but i get this error in firebug:

“NetworkError: 500 Internal Server Error - http://mydomain.pt/routing/php/pgrouting.php?startpoint=89314.61677724583%20123959.32146482218&finalpoint=90696.99736799067%20123514.05047980057&method=SP

I don’t have to define password of database in php file?

Em 10-07-2012 13:22, Daniel Kastl escreveu:

On Tue, Jul 10, 2012 at 12:47 PM, Pedro Costa <pedrocostaarma@sapo.pt> wrote:

I’m confused.
My map is in srs 900913 and my tables in postgis are in srs 27492.

In workshop example the points are converted to srs 4326 why?
Because the funcion findnearestedge needs the data in srs 4326?
If yes, i just need to convert to my table srs (900913) correct?

Hi Pedro,

OSM data imported with osm2pgrouting or osm2po are WGS84 (4326), so this is what you have in the database.
OpenLayers uses World Mercator projection (900913 and there are some aliases), so start point and end point in the workshop need to be transformed to 4326.

In your case you had to replace 4326 with 27492, I guess, assuming that you use OpenLayers (GeoExt) and your dataset.

Daniel

Thanks

[1] var startpoint = layer.features[0].geometry.clone();
startpoint.transform(epsg_900913, epsg_4326);
var finalpoint = layer.features[1].geometry.clone();
finalpoint.transform(epsg_900913, epsg_4326);

Em 10-07-2012 11:09, Daniel Kastl escreveu:

Hi Pedro,

In which projection are your start and end point?You need to use ST_transform(,) if the projection is different.
In the workshop the data is in 4326 (WGS84) and so you can find this SRID in the SQL statement.

Daniel

On Tue, Jul 10, 2012 at 11:42 AM, Pedro Costa <pedrocostaarma@sapo.pt> wrote:

I’m trying to adapt this function (findnearestedge) [1] to my routing data that are in srs 27492.

Someone can help me with that?

thanks

[1]

$startEdge = findNearestEdge($startPoint);
$endEdge = findNearestEdge($endPoint);

function findNearestEdge($lonlat) {

SELECT gid, source, target, the_geom,
distance(the_geom, GeometryFromText(
‘POINT(“.$lonlat[0].” “.$lonlat[1].”)’, 4326)) AS dist
FROM “.TABLE.”
WHERE the_geom && setsrid(
‘BOX3D(“.($lonlat[0]-0.1).”
“.($lonlat[1]-0.1).”,
“.($lonlat[0]+0.1).”
“.($lonlat[1]+0.1).”)’::box3d, 4326)
ORDER BY dist LIMIT 1"

Em 10-07-2012 09:33, Daniel Kastl escreveu:

Hi Pedro,

The years before it was always available on OSGeo server: http://download.osgeo.org/pgrouting/foss4g2010/
It seems I forgot to place the 2011 workshop there as well.

The workshop documentation source is on Github: https://github.com/pgRouting/workshop
So all you’re missing is the sample data. But you can download any OSM data or even use the sample data of 2010.

In case you’re using Ubuntu/Debian you can install last years workshop as a package easily:
https://launchpad.net/~georepublic/+archive/pgrouting/+packages
It contains the sample data of Denver as well. Or you download the tarball [1] and extract it.

Or, you use OSGeo Live DVD. It contains the workshop as well:
http://live.osgeo.org/en/quickstart/pgrouting_quickstart.html (see “What’s next” at the end of the page).

Hope that helps,
Daniel

[1] https://launchpad.net/~georepublic/+archive/pgrouting/+files/pgrouting%2Bworkshop_0.6.1.orig.tar.gz

On Tue, Jul 10, 2012 at 10:15 AM, Pedro Costa <pedrocostaarma@sapo.pt> wrote:

Hi guys,

I’m playing with pgrouting workshop of FOSS4G 2011.
There is any link to download the workshop material?

Thanks

Pedro


Pgrouting-users mailing list
Pgrouting-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/pgrouting-users


Georepublic UG & Georepublic Japan
eMail: daniel.kastl@georepublic.de
Web: http://georepublic.de

_______________________________________________
Pgrouting-users mailing list
[Pgrouting-users@lists.osgeo.org](mailto:Pgrouting-users@lists.osgeo.org)
[http://lists.osgeo.org/mailman/listinfo/pgrouting-users](http://lists.osgeo.org/mailman/listinfo/pgrouting-users)


Pgrouting-users mailing list
Pgrouting-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/pgrouting-users


Georepublic UG & Georepublic Japan
eMail: daniel.kastl@georepublic.de
Web: http://georepublic.de

_______________________________________________
Pgrouting-users mailing list
[Pgrouting-users@lists.osgeo.org](mailto:Pgrouting-users@lists.osgeo.org)
[http://lists.osgeo.org/mailman/listinfo/pgrouting-users](http://lists.osgeo.org/mailman/listinfo/pgrouting-users)


Pgrouting-users mailing list
Pgrouting-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/pgrouting-users


Georepublic UG & Georepublic Japan
eMail: daniel.kastl@georepublic.de
Web: http://georepublic.de

_______________________________________________
Pgrouting-users mailing list
[Pgrouting-users@lists.osgeo.org](mailto:Pgrouting-users@lists.osgeo.org)
[http://lists.osgeo.org/mailman/listinfo/pgrouting-users](http://lists.osgeo.org/mailman/listinfo/pgrouting-users)


Pgrouting-users mailing list
Pgrouting-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/pgrouting-users


Georepublic UG & Georepublic Japan
eMail: daniel.kastl@georepublic.de
Web: http://georepublic.de

Em 10-07-2012 16:31, Daniel Kastl escreveu:

Can you run SQL queries directly in your Terminal window?
Do you have postgresql extension for PHP installed?

yes and yes. postgresql extension for PHP is something called 'pg' right?

In main log of postgresql i have a lot of things of another time so i clean it and test again.....

Em 10-07-2012 16:43, Pedro Costa escreveu:

ostgresql extension for PHP

It is pgsql.so?

On Ubuntu the package name is “php5-pgsql”
http://packages.ubuntu.com/precise/php5-pgsql

Daniel

On Tue, Jul 10, 2012 at 5:53 PM, Pedro Costa <pedrocostaarma@sapo.pt> wrote:

Em 10-07-2012 16:43, Pedro Costa escreveu:

ostgresql extension for PHP

It is pgsql.so?


Pgrouting-users mailing list
Pgrouting-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/pgrouting-users


Georepublic UG & Georepublic Japan
eMail: daniel.kastl@georepublic.de
Web: http://georepublic.de

it's installed..
In postgresql log i don't have nothing after i try the routing.

Can you see my code:

client: http://pastebin.com/vCuLDQru

server: http://pastebin.com/tdWDgj54

I'm using only one algorithm (renamed to SP) and i want to find only the nearest vertices...

Em 10-07-2012 17:01, Daniel Kastl escreveu:

On Ubuntu the package name is "php5-pgsql"
http://packages.ubuntu.com/precise/php5-pgsql

Daniel

On Tue, Jul 10, 2012 at 5:53 PM, Pedro Costa <pedrocostaarma@sapo.pt <mailto:pedrocostaarma@sapo.pt>> wrote:

    Em 10-07-2012 16:43, Pedro Costa escreveu:

        ostgresql extension for PHP

    It is pgsql.so?

    _______________________________________________
    Pgrouting-users mailing list
    Pgrouting-users@lists.osgeo.org
    <mailto:Pgrouting-users@lists.osgeo.org>
    http://lists.osgeo.org/mailman/listinfo/pgrouting-users

--
Georepublic UG & Georepublic Japan
eMail: daniel.kastl@georepublic.de <mailto:daniel.kastl@georepublic.de>
Web: http://georepublic.de/&gt;

_______________________________________________
Pgrouting-users mailing list
Pgrouting-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/pgrouting-users

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@georepublic.de
Web: http://georepublic.de

right i corrected the missing quotation.

I'm already run the query in pgadmin and works....

You can see images attached of firebug.
I'm only received error when i click for the end point. That client get the point values [1] but have no response [2]...

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@georepublic.de <mailto:daniel.kastl@georepublic.de>
Web: http://georepublic.de/&gt;

_______________________________________________
Pgrouting-users mailing list
Pgrouting-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/pgrouting-users

1.png

2.png

I change the query routing putting a start and a end point in php testing if returns geojson but don't work...

in pgadmin with the same start and end point works

Em 10-07-2012 17:20, Pedro Costa escreveu:

right i corrected the missing quotation.

I'm already run the query in pgadmin and works....

You can see images attached of firebug.
I'm only received error when i click for the end point. That client get the point values [1] but have no response [2]...

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@georepublic.de <mailto:daniel.kastl@georepublic.de>
Web: http://georepublic.de/&gt;

_______________________________________________
Pgrouting-users mailing list
Pgrouting-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/pgrouting-users

_______________________________________________
Pgrouting-users mailing list
Pgrouting-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/pgrouting-users

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@georepublic.de <mailto:daniel.kastl@georepublic.de>
Web: http://georepublic.de/&gt;

_______________________________________________
Pgrouting-users mailing list
Pgrouting-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/pgrouting-users

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@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@georepublic.de
Web: http://georepublic.de

_______________________________________________
Pgrouting-users mailing list
[Pgrouting-users@lists.osgeo.org](mailto:Pgrouting-users@lists.osgeo.org)
[http://lists.osgeo.org/mailman/listinfo/pgrouting-users](http://lists.osgeo.org/mailman/listinfo/pgrouting-users)


Pgrouting-users mailing list
Pgrouting-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/pgrouting-users


Georepublic UG & Georepublic Japan
eMail: daniel.kastl@georepublic.de
Web: http://georepublic.de

And you’re maybe missing a space as well.

$con = pg_connect(“dbname=”.PG_DB." host=“.PG_HOST.” user=“.PG_USER.” password=".PG_PASS);

… might be better. Just ensure that “password” is correct.

Daniel

On Wed, Jul 11, 2012 at 12:14 PM, Daniel Kastl <daniel@georepublic.de> wrote:

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@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@georepublic.de
Web: http://georepublic.de

_______________________________________________
Pgrouting-users mailing list
[Pgrouting-users@lists.osgeo.org](mailto:Pgrouting-users@lists.osgeo.org)
[http://lists.osgeo.org/mailman/listinfo/pgrouting-users](http://lists.osgeo.org/mailman/listinfo/pgrouting-users)


Pgrouting-users mailing list
Pgrouting-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/pgrouting-users


Georepublic UG & Georepublic Japan
eMail: daniel.kastl@georepublic.de
Web: http://georepublic.de


Georepublic UG & Georepublic Japan
eMail: daniel.kastl@georepublic.de
Web: http://georepublic.de

Thanks Daniel...

I'm trying without defining password for now.

And now i get this error:

JSON.parse: unexpected character

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@sapo.pt <mailto:pedrocostaarma@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@georepublic.de
    <mailto:daniel.kastl@georepublic.de>
    Web: http://georepublic.de/&gt;

    _______________________________________________
    Pgrouting-users mailing list
    Pgrouting-users@lists.osgeo.org <mailto:Pgrouting-users@lists.osgeo.org>
    http://lists.osgeo.org/mailman/listinfo/pgrouting-users

    _______________________________________________
    Pgrouting-users mailing list
    Pgrouting-users@lists.osgeo.org
    <mailto:Pgrouting-users@lists.osgeo.org>
    http://lists.osgeo.org/mailman/listinfo/pgrouting-users

--
Georepublic UG & Georepublic Japan
eMail: daniel.kastl@georepublic.de <mailto:daniel.kastl@georepublic.de>
Web: http://georepublic.de/&gt;

_______________________________________________
Pgrouting-users mailing list
Pgrouting-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/pgrouting-users