<br><br><div class="gmail_quote">On Tue, Jul 10, 2012 at 12:47 PM, Pedro Costa <span dir="ltr"><<a href="mailto:pedrocostaarma@sapo.pt" target="_blank">pedrocostaarma@sapo.pt</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


  
    
  
  <div bgcolor="#FFFFFF" text="#000000">
    <div>I'm confused.<br>
      My map is in srs 900913 and my tables  in postgis are in srs
      27492.<br>
      <br>
      In workshop example the points are converted to srs 4326 why?<br>
      Because the funcion findnearestedge needs the data in srs 4326?<br>
      If yes, i just need to convert to my table srs (900913) correct?<br></div></div></blockquote><div><br></div><div><br></div><div>Hi Pedro,</div><div><br></div><div>OSM data imported with osm2pgrouting or osm2po are WGS84 (4326), so this is what you have in the database.</div>

<div>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.</div><div><br></div><div>In your case you had to replace 4326 with 27492, I guess, assuming that you use OpenLayers (GeoExt) and your dataset.</div>

<div><br></div><div>Daniel</div><div><br></div><div><br></div><div><br></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div bgcolor="#FFFFFF" text="#000000">

<div>
      <br>
      <br>
      Thanks<br>
      <br>
      <br>
      <br>
      <br>
               [1] var startpoint = layer.features[0].geometry.clone();<br>
                   startpoint.transform(epsg_900913, epsg_4326);<br>
                   var finalpoint = layer.features[1].geometry.clone();<br>
                   finalpoint.transform(epsg_900913, epsg_4326);<br>
      <br>
      <br>
      <br>
      <br>
      <br>
      <br>
      Em 10-07-2012 11:09, Daniel Kastl escreveu:<br>
    </div><div><div class="h5">
    <blockquote type="cite">
      <div>Hi Pedro,</div>
      <div><br>
      </div>
      In which projection are your start and end point?
      <div>You need to use ST_transform(<geom>,<srid>) if
        the projection is different.</div>
      <div>In the workshop the data is in 4326 (WGS84) and so you can
        find this SRID in the SQL statement.</div>
      <div><br>
      </div>
      <div>Daniel</div>
      <div><br>
      </div>
      <div><br>
        <br>
        <div class="gmail_quote">On Tue, Jul 10, 2012 at 11:42 AM, Pedro
          Costa <span dir="ltr"><<a href="mailto:pedrocostaarma@sapo.pt" target="_blank">pedrocostaarma@sapo.pt</a>></span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div bgcolor="#FFFFFF" text="#000000">
              <div>I'm trying to adapt this function (findnearestedge)
                [1] to my routing data that are in srs 27492.<br>
                <br>
                Someone can help me with that? <br>
                <br>
                <br>
                thanks<br>
                <br>
                <br>
                <br>
                <br>
                <br>
                [1]<br>
                <br>
                $startEdge = findNearestEdge($startPoint);<br>
                 $endEdge   = findNearestEdge($endPoint);<br>
                <br>
                  function findNearestEdge($lonlat) {<br>
                <br>
                SELECT gid, source, target, the_geom, <br>
                                  distance(the_geom, GeometryFromText(<br>
                                       'POINT(".$lonlat[0]."
                ".$lonlat[1].")', 4326)) AS dist <br>
                                 FROM ".TABLE."  <br>
                                 WHERE the_geom && setsrid(<br>
                                       'BOX3D(".($lonlat[0]-0.1)." <br>
                                              ".($lonlat[1]-0.1).", <br>
                                              ".($lonlat[0]+0.1)." <br>
                                             
                ".($lonlat[1]+0.1).")'::box3d, 4326) <br>
                                 ORDER BY dist LIMIT 1"<br>
                <br>
                <br>
                <br>
                <br>
                <br>
                <br>
                <br>
                <br>
                <br>
                <br>
                <br>
                <br>
                Em 10-07-2012 09:33, Daniel Kastl escreveu:<br>
              </div>
              <blockquote type="cite">Hi Pedro,
                <div><br>
                </div>
                <div>The years before it was always available on OSGeo
                  server: <a href="http://download.osgeo.org/pgrouting/foss4g2010/" target="_blank">http://download.osgeo.org/pgrouting/foss4g2010/</a></div>
                <div> It seems I forgot to place the 2011 workshop there
                  as well. </div>
                <div><br>
                </div>
                <div>The workshop documentation source is on Github: <a href="https://github.com/pgRouting/workshop" target="_blank">https://github.com/pgRouting/workshop</a></div>
                <div>So all you're missing is the sample data. But you
                  can download any OSM data or even use the sample data
                  of 2010.</div>
                <div><br>
                </div>
                <div>In case you're using Ubuntu/Debian you can install
                  last years workshop as a package easily:</div>
                <div><a href="https://launchpad.net/%7Egeorepublic/+archive/pgrouting/+packages" target="_blank">https://launchpad.net/~georepublic/+archive/pgrouting/+packages</a></div>
                <div>It contains the sample data of Denver as well. Or
                  you download the tarball [1] and extract it. </div>
                <div><br>
                </div>
                <div>Or, you use OSGeo Live DVD. It contains the
                  workshop as well:</div>
                <div><a href="http://live.osgeo.org/en/quickstart/pgrouting_quickstart.html" target="_blank">http://live.osgeo.org/en/quickstart/pgrouting_quickstart.html</a> (see

                  "What's next" at the end of the page).</div>
                <div><br>
                </div>
                <div>Hope that helps,</div>
                <div>Daniel</div>
                <div><br>
                </div>
                <div>[1] <a href="https://launchpad.net/%7Egeorepublic/+archive/pgrouting/+files/pgrouting%2Bworkshop_0.6.1.orig.tar.gz" target="_blank">https://launchpad.net/~georepublic/+archive/pgrouting/+files/pgrouting%2Bworkshop_0.6.1.orig.tar.gz</a></div>


                <div><br>
                </div>
                <div><br>
                  <br>
                  <div class="gmail_quote">On Tue, Jul 10, 2012 at 10:15
                    AM, Pedro Costa <span dir="ltr"><<a href="mailto:pedrocostaarma@sapo.pt" target="_blank">pedrocostaarma@sapo.pt</a>></span>
                    wrote:<br>
                    <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi
                      guys,<br>
                      <br>
                      I'm playing with pgrouting workshop of FOSS4G
                      2011.<br>
                      There is any link to download the workshop
                      material?<br>
                      <br>
                      Thanks<br>
                      <br>
                      Pedro<br>
                      _______________________________________________<br>
                      Pgrouting-users mailing list<br>
                      <a href="mailto:Pgrouting-users@lists.osgeo.org" target="_blank">Pgrouting-users@lists.osgeo.org</a><br>
                      <a href="http://lists.osgeo.org/mailman/listinfo/pgrouting-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/pgrouting-users</a><br>
                    </blockquote>
                  </div>
                  <br>
                  <br clear="all">
                  <span><font color="#888888">
                      <div><br>
                      </div>
                      -- <br>
                      <span style="font-family:arial,sans-serif;font-size:13px;border-collapse:collapse">Georepublic

                        UG & Georepublic Japan<br>
                        eMail: <a href="mailto:daniel.kastl@georepublic.de" style="color:rgb(66,99,171)" target="_blank">daniel.kastl@georepublic.de</a><br>
                        Web: <a href="http://georepublic.de/" style="color:rgb(66,99,171)" target="_blank">http://georepublic.de</a></span><br>
                    </font></span></div>
                <span><font color="#888888"> <br>
                    <fieldset></fieldset>
                    <br>
                    <pre>_______________________________________________
Pgrouting-users mailing list
<a href="mailto:Pgrouting-users@lists.osgeo.org" target="_blank">Pgrouting-users@lists.osgeo.org</a>
<a href="http://lists.osgeo.org/mailman/listinfo/pgrouting-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/pgrouting-users</a>
</pre>
                  </font></span></blockquote>
              <br>
              <br>
            </div>
            <br>
            _______________________________________________<br>
            Pgrouting-users mailing list<br>
            <a href="mailto:Pgrouting-users@lists.osgeo.org" target="_blank">Pgrouting-users@lists.osgeo.org</a><br>
            <a href="http://lists.osgeo.org/mailman/listinfo/pgrouting-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/pgrouting-users</a><br>
            <br>
          </blockquote>
        </div>
        <br>
        <br clear="all">
        <div><br>
        </div>
        -- <br>
        <span style="font-family:arial,sans-serif;font-size:13px;border-collapse:collapse">Georepublic
          UG & Georepublic Japan<br>
          eMail: <a href="mailto:daniel.kastl@georepublic.de" style="color:rgb(66,99,171)" target="_blank">daniel.kastl@georepublic.de</a><br>
          Web: <a href="http://georepublic.de/" style="color:rgb(66,99,171)" target="_blank">http://georepublic.de</a></span><br>
      </div>
      <br>
      <fieldset></fieldset>
      <br>
      <pre>_______________________________________________
Pgrouting-users mailing list
<a href="mailto:Pgrouting-users@lists.osgeo.org" target="_blank">Pgrouting-users@lists.osgeo.org</a>
<a href="http://lists.osgeo.org/mailman/listinfo/pgrouting-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/pgrouting-users</a>
</pre>
    </blockquote>
    <br>
    <br>
  </div></div></div>

<br>_______________________________________________<br>
Pgrouting-users mailing list<br>
<a href="mailto:Pgrouting-users@lists.osgeo.org">Pgrouting-users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/pgrouting-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/pgrouting-users</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><span style="font-family:arial,sans-serif;font-size:13px;border-collapse:collapse">Georepublic UG & Georepublic Japan<br>eMail: <a href="mailto:daniel.kastl@georepublic.de" style="color:rgb(66,99,171)" target="_blank">daniel.kastl@georepublic.de</a><br>

Web: <a href="http://georepublic.de/" style="color:rgb(66,99,171)" target="_blank">http://georepublic.de</a></span><br>