[postgis-users] Issues with pgrouting workshop code in postgis 2.11/pgrouting 2.0
Emmanuel Adegboye
eaadegboye at googlemail.com
Thu Jan 9 19:29:34 PST 2014
Hello Stephen, Daniel and all.
Thank you very much for your candid comments and taking out time to respond
to the issues I raised.
Even though it probably appears so, I am not just copying random pieces of
code. The workshop builds on previous versions and I have tried to follow
it as closely as possible and only make modifications based on the data I
am working with.
I am not working with OSM data, instead I started with shapefiles loaded as
a table (eastlegon) into a postgis database (which I named routing). My
data is also entirely in ESPG 4326 and I am working from a windows machine
but was able to install pgrouting easily using the installer at
http://winnie.postgis.net/download/pg2/buildbot/postgis-bundle-pg92x32-setup-2.1.1-1.exeto
my already existing PostgreSQL database. I loaded the data, added the
additional columns, ran the topology function, added indices, ran queries
using the algorithms (bearing in mind my table name) and I got results
similar to the workshop.
All of this I fully understand and I've done it more than once just to be
sure I am not making any mistakes so much that I can almost do it in my
sleep. However, if you advise that I start again from scratch, create a
database 'pgrouting-workshop', and table 'ways' instead of my existing
setup, I will!
Everything works fine till I get to the wrappers part of the workshop. The
one with link Daniel shared. I must admit, I've tried to understand the
code, and I'm still working on it, and that's why it appears I simply copy
it.
Two simple questions I now have are:
1) Is there any existing resource that explains (as straightforward as
possible) the basics of how to write a wrapper from scratch for a beginner
like me?
2) Do I actually need to write custom wrappers (based on my dataset) to get
my application to work? All I'm simply trying to do is create a simple
application that allows users to set a start and end point, calculate route
using at least dijkstra algorithm and display the results as a new layer,
all in a web browser. If I do, how best do you advise I go about it. If
not, how best can I build on the workshop to achieve my goal.
Thanks once again for your time. Without you guys and the work you've done
I would not even know where to get started. I really appreciate.
Regards,
Emmanuel Adegboye
On Jan 10, 2014 1:18 AM, "Daniel Kastl" <daniel at georepublic.de> wrote:
>
>>> I tried running thr pgr_fromAtoB wrapper function in pgAdmin and I
>>> initially get an error:
>>>
>>> ERROR: relation "vertices_tmp" does not exist
>>> SQL state: 42P01
>>> Context: PL/pgSQL function pgr_fromatob(character varying,double
>>> precision,double precision,double precision,double precision) line
>>> 11 at EXECUTE statement
>>>
>>>
>> I think Daniel will have to answer this. pgr_fromatob() must be a wrapper
>> as that is part of the tutorial because it is not part of the pgrouting
>> release.
>>
>>
> This is the function:
> http://workshop.pgrouting.org/chapters/wrapper.html#route-between-lat-lon-points-and-return-ordered-geometry-with-heading
>
> As Steve mentioned, you will not be successful to copy pieces of code
> (randomly) without understanding what actually is going on there.
>
> The workshop really tries to explain everything, and I don't think it
> makes sense to just copy the text from the link above. It should be all
> explained. If you're missing some information, or something is unclear,
> then feel free to ask.
>
> Daniel
>
>
>
>
>
>
>
> --
> Georepublic UG & Georepublic Japan
> eMail: daniel.kastl at georepublic.de
> Web: http://georepublic.de
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at lists.osgeo.org
> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20140110/09a94a40/attachment.html>
More information about the postgis-users
mailing list