[pgrouting-users] pgr_costresult to geometry

Daniel Kastl daniel at georepublic.de
Tue Dec 10 07:27:39 PST 2013


On Wed, Dec 11, 2013 at 12:18 AM, Petros Apotsos <petrosapotsos at gmail.com>wrote:

> Dear list,
>
> I am sure this has been answered already, but I am new to this list (and
> pgRouting altogether) and haven't been able to find a suitable answer. The
> question is:
>
> I am using the 2nd version of the function pgr_trsp to do sequential
> routing between GPS signals on a road network. How can I convert the
> pgr_costresult to a useful geometry type (LINESTRING would be great)?
>

Hi Petros,

This chapter in the workshop might answer your question:
http://workshop.pgrouting.org/chapters/wrapper.html#return-route-with-network-geometry



> Bonus questions:
>
> -What type EXACTLY is the result of this function? Is it a SELECT list? An
> array?
>

The result type is a "set of records":
http://docs.pgrouting.org/2.0/en/src/common/doc/types/cost_result.html#type-cost-result

You can use the result like a SELECT result.


>  -Why the heck doesn't pgRouting produce (or include respective functions
> to do so) geometry results, but rather this kind of results. In most cases
> (if not all) it comes down to actually needing such an output.
>

Because there is such a variety of network data and each data might have
different column names, projections, etc.. For Dijkstra algorithm you even
don't need a geometry. Your network could be something totally abstract.

So pgRouting tries to make as less assumptions as possible.
In the previous version there were several "wrapper" functions, but it was
extra work to maintain them.
It's really easy to link your result with the original table, so once you
know how it works, you will hopefully agree. ;-)

Hope this helped.
Regards.
Daniel





>
>
> Thank you all in advance,
>
> *Petros Apotsos*
>
>
>
> Rural & Surveying Engineer
>
> Technical Chamber of Greece Registry Number 96798
>
> Τ: 2310 220345
>
> F: 2310 220346
>
> Ermou 18A, Postal Code 54624
>
> Thessaloniki, GREECE
>
>
>
>
> __________ Information from ESET Smart Security, version of virus
> signature database 9154 (20131210) __________
>
> The message was checked by ESET Smart Security.
>
> http://www.eset.com
>
> _______________________________________________
> 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/20131211/870f25b5/attachment.html>


More information about the Pgrouting-users mailing list