pgRouting

Forum #22 - Topic #44 - Message List

Problem with PHP/MapScript

I'm using php mapscript from sample of routing application, I try to add this script at first php sections of gmap75.phtml,(Applications Packaged for MS4W) but the result of that routing script didn't appear in my map window, it just shown in ms4w temp folder.

So The question is how to include this routing application in gmap template?.

Note : my gmap75.phtml using java mode only. Regards,

Ari Sutanto

  • Message #154

    Well, I'm not sure this has to do with pgRouting so much. Maybe you better try to find an answer at ms4w or gmap related websites.

    Are you sure your php mapscript library has the correct name and is at the right place?

    • Message #155

      Hi anton, thank’s for your suggestion, I will try to ask mapserver milis, Anyway, I have some problems again, How if I wish to present other attribute besides gid and the_geom from result of funngsi pgrouting? (The sql function : $sql="the_geom from (select gid, the_geom from "."shortest_path_astar2_...bla-bla..) it means, the attribute that can be present only gid and the geom.right? how if an other field add on this function?

      • Message #156

        The last reply was from Daniel, not from me :)

        Well, I thinl it is quite easy to rename the columns you have. Or you can create a temp table or even a view if you don't want to touch your table.

        • Message #180

          How to create temporary table?, Can I select that table to used in zoom or pan activity?.

          note: I'm use gmap template from maptools.org

          Regards,

          ant

          • Message #181

            Hi Ant,

            This is a standard PostgreSQL question. Using Google the first search result will tell you how to create a temporary table: http://www.postgresql.org/docs/8.1/static/sql-createtable.html

            If you want to keep your result while panning or zooming you better store it in a session or cookie. If you use a Javascript based framework like OpenLayers, you can store the geometry as a Javascript object.

            • Message #182

              Thanks, Actually my question is based on what Anton say : About temporary table. I thnk it should look like this: 1. Make a temporarty table executing something like SELECT * INTO tmp_table FROM shortest_path_function(bla-bla-bla); 2. When you zoom or pan, you need to select the data from temporary table. 3. When you want to calculate new path, you need to drop the table and execute the query from step 1.

              from that I use Javascript to do that without success. Can You give me more details (perhaps some sample) to do that step, because when I tried the error.logs say that relation tmp_table doesn't exist. I don't know how to create session too, I'm just used script from routing sample that look like didn't create session,right?.

              • Message #183

                I never used temporary tables, so I can't tell you for sure I'm right, but having a look at the PostgreSQL documentation it says:

                TEMPORARY or TEMP

                If specified, the table is created as a temporary table. Temporary tables are automatically dropped at the end of a session, or optionally at the end of the current transaction (see ON COMMIT below). Existing permanent tables with the same name are not visible to the current session while the temporary table exists, unless they are referenced with schema-qualified names. Any indexes created on a temporary table are automatically temporary as well.

                So probably the temporary table is dropped automatically after your query/transaction is done. I can't help you with sample code, because I never did that way. Probably you better take a look at the PostgreSQL mailing list.