[pgrouting-users] pgrouting workshop

Daniel Kastl daniel at georepublic.de
Tue Jul 10 05:22:23 PDT 2012


On Tue, Jul 10, 2012 at 12:47 PM, Pedro Costa <pedrocostaarma at 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 at 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/%7Egeorepublic/+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<https://launchpad.net/%7Egeorepublic/+archive/pgrouting/+files/pgrouting%2Bworkshop_0.6.1.orig.tar.gz>
>>
>>
>>
>> On Tue, Jul 10, 2012 at 10:15 AM, Pedro Costa <pedrocostaarma at 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 at lists.osgeo.org
>>> http://lists.osgeo.org/mailman/listinfo/pgrouting-users
>>>
>>
>>
>>
>>  --
>> Georepublic UG & Georepublic Japan
>> eMail: daniel.kastl at georepublic.de
>> Web: http://georepublic.de
>>
>>
>> _______________________________________________
>> Pgrouting-users mailing listPgrouting-users at lists.osgeo.orghttp://lists.osgeo.org/mailman/listinfo/pgrouting-users
>>
>>
>>
>>
>> _______________________________________________
>> Pgrouting-users mailing list
>> Pgrouting-users at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/pgrouting-users
>>
>>
>
>
>  --
> Georepublic UG & Georepublic Japan
> eMail: daniel.kastl at georepublic.de
> Web: http://georepublic.de
>
>
> _______________________________________________
> Pgrouting-users mailing listPgrouting-users at lists.osgeo.orghttp://lists.osgeo.org/mailman/listinfo/pgrouting-users
>
>
>
>
> _______________________________________________
> Pgrouting-users mailing list
> Pgrouting-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/pgrouting-users
>
>


-- 
Georepublic UG & Georepublic Japan
eMail: daniel.kastl at georepublic.de
Web: http://georepublic.de
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/pgrouting-users/attachments/20120710/3c62bfe0/attachment.html>


More information about the Pgrouting-users mailing list