demo (#22) - Showing the route. (#82) - Message List

Showing the route.

I made the (06.index.html) page almost work. I think my issues are more with Openlayers than with pgrounting but help will be apreciated.

I made the db enviroment work already.

I have a few questions. 1) I can´t see the route. I put an alert on the displayRoute function and get an edges.length value I pun another alert on "var g = parser.read" and got MULTILINESTRING(-13731833.8094298, 6144839.91418116, -13731811.9796777, 6144974.53872339)) so i think im getting the route. I try changing the color, strokewidth for the var result_style but still cant see the route.

2) The start and stop points features are too small, i try changing start_style = OpenLayers?.Util.applDefaults({

externalGraphic: "./img/marker-green.png" ---because i dont know where is start.png. graphicwidth:50, graphicheight:50, almost double size

3) What is the layer downtown for? I only see a big black square on the middle of the map.

4) What use is the navigate option? i got a hand cursor but i cant move the map.

Thanks in advice

  • Message #318

    Sorry, I can't help here. Let's wait for Daniel.

    • Message #323

      When daniel return?

  • Message #325

    Hi Juan,

    Sorry for let you wait so long. Orkney office moved last weekend with all the servers, so a lot to prepare before and setup after.

    Well, this OpenLayers? demo has been written by some people of Camptocamp, so it's not exactly the way how I would write it and I didn't look at each detail. Did you try the files from the downloaded ZIP file? If there was a bug, then it might not have been changed there, but the online tutorial should be correct. Just copy and past from the TRAC pages directly should be more safe.

    1. As far as I remember this was a bug (or something changed with the OpenLayers? API).
      features.push(g); is enough there.
      It should be changed already on the Wiki page.
    2. The markers directory can be defined in the OpenLayers? CSS file.
    3. "Downtown" layer draws a rectangle, which shows the extent of the sample routing data. (We didn't create a topology for the complete Geobase data at the workshop.)
    4. If "Navigate" is enabled, then clicking on the map shouldn't draw a point.

    Maybe you want to take a look at more up-to-date (extended) examples:

    • Message #367

      Thanks for you reply, i was on vacations, but now im back on the horse and want finish my trial.

      I was trying get root priveligies on foss4g image but i can't. When i use 'su -' command and use 'foos4g' as password i got 'su: Authentication failure'

      What is the correct password?

      Im trying to instal the VMware-tools and require super user priveligies.

      • Message #368

        In Ubuntu the "root" account is disabled by default and "su" command doesn't work.
        You can type a command as super user with "sudo [command]". The password then is "foss4g" (Workplace).
        A little trick to become "root" is "sudo su -", but usually this shouldn't be necessary.

        • Message #384

          Ok, all your help finally work for me (Yahhooo!!) I have all the samples working. Now i setup my own data from caracas (ccs)

          I load the data on a new database. Did the same steps and im able to get routes using the query i saw on topic 71.

          SELECT * FROM shortest_path_shooting_star('SELECT gid as id, source, target, cost, reverse_cost, x1, y1, x2, y2, rule, to_cost FROM roads_edges order by gid', 9, 10, false, true);

          Even the query use one way streets restrictions in the proper way.

          The new questions:


          The query you have on the workshop for shooting star have a column [the_geom]. 1) How i create that column? i have [x1, y1, x2, y2] on the database

          The ax_routing.php use it to calculate distance from the Point[x,y]

          SELECT gid, source, target, the_geom, distance(the_geom, GeometryFromText?( 'POINT(-66.807175 10.493085)', 54004)) AS dist FROM ccsroad WHERE the_geom && setsrid( 'BOX3D(-66.907175 10.393085, -66.707175 10.593085)'::box3d, 54004) ORDER BY dist LIMIT 1

          2) My maps use WGS84, do i have to change the value 54004 to create the Geometry?

          • Message #388

            For a new question, what about a new topic? ;-)

            1. Didn't you import your data as shape file? Then "the_geom" column should already exist. For routing itself you even don't need the geometry information, but you might need it for visualization, finding closest links as you mentioned, etc.. Well, I recommend you to take a look at the PostGIS documentation at  http://www.postgis.org if you want to create a geometry column.
            1. Using "the_geom" as well as [x1, y1, x2, y2], they both must have the same projection as the map. If not, you need to reproject either for each query or you do it once for your complete data.