others (#15) - road network problem (#390) - Message List

road network problem

I've been drawing a road network, each path is connected. and when the routing process using dijkstra_sp, there are several roads that dead / not connected. and I try to edit the path. but still the same and no change.

thanks for the response and the answer

  • Message #1690

    I've been drawing a road network, each path is connected. and when the routing process using dijkstra_sp, there are several roads that dead / not connected. and I try to edit the path. but still the same and no change. thanks for the response and the answer

    i'm using shapefile and postgresql n postgis

    • Message #1691

      I assume you ran the function "assign_vertex_id()" to build the network topology, right? This function contains a "snapping" tolerance value in the unit of your data. (You can find more about this in the tutorial).

      • Message #1694

        if I send a shp file, can you check it? only 140 road this for my final project for college.

         http://www.4shared.com/file/QE0HIGNc/roads.html

        thanks for everything God Bless U

        • Message #1695

          Could you list your steps (commands) to get your data into the routing database?

          • Message #1697

            ALTER TABLE roads_polyline ADD COLUMN source integer;

            ALTER TABLE roads_polyline ADD COLUMN target integer;

            ALTER TABLE roads_polyline ADD COLUMN length double precision;


            SELECT assign_vertex_id('roads_polyline', 0.00001, 'the_geom', 'gid');

            UPDATE roads_polyline SET length = length(the_geom);


            CREATE INDEX source_idx ON roads_polyline(source);

            CREATE INDEX target_idx ON roads_polyline(target);

            CREATE INDEX geom_idx ON roads_polyline USING GIST(the_geom GIST_GEOMETRY_OPS);


            DROP TABLE IF EXISTS dijsktra_result;

            CREATE TABLE dijsktra_result(gid int4) with oids;

            SELECT AddGeometryColumn?('dijsktra_result', 'the_geom', '-1', 'MULTILINESTRING', 2);

            INSERT INTO dijsktra_result(the_geom)

            SELECT the_geom FROM dijkstra_sp('roads_polyline', 10,1);

            thanks for your help

            • Message #1698

              First, it seems your data is imported to the database. I guess you used shp2pgsql for that, right?

              But there are a few points that might be a problem:

              SELECT assign_vertex_id('roads_polyline', 0.00001, 'the_geom', 'gid');
              

              If your projection unit is "meter", this is very small, but even if it's "degree" unit (I think this is the case with your data), it's still small and then - if your original data isn't digitalized perfectly - the network might not be connected. You can try to increase this value to 0.0001 or 0.001 and see what happens.

              SELECT AddGeometryColumn?('dijsktra_result', 'the_geom', '-1', 'MULTILINESTRING', 2);
              

              Second, it's better not to have "-1" as spatial reference. Do you know the EPSG code of your data projection?

              • Message #1700

                ok. thanks for everything... daniel...

                God Bless daniel.

                • Message #1702

                  I was confused, with diagnostic tools .. I have in my database: Table roads_polyline | gid | id | Name | the_geom | Source | Target | length | Table vertices_tmp Table dijkstra_result Table spatial_ref_sys Table geometry column

                  I've tried a diagnostic tool, but the query results it appears ERROR: missing FROM-clause entry for table "roads_polyline"

                  I need your help

                  • Message #1708

                    Sorry, what is diagnostics tool?

                    • Message #1710

                      sorry ....

                      in http://pgrouting.postlbs.org/wiki/tools especially View intersections and detect deadends.....

                      i'm so confuse.

                      • Message #1711

                        This wiki page Steve wrote to give show a possibility how to check your network for possible errors. It's nothing you have to do, but you better write an email to the mailing list if you're interested in it, because Steve usually doesn't read the forum.

                        • Message #1713

                          thank you daniel .. finally the problem which a few days ago I ask you, are resolved. was the location of errors in its digitization process ..... to find a location within a radius of several kilo meters, what functions should be used, in pgrouting? thanks

                          • Message #1714

                            soryy my english is poor, i'm using google translate. hahaha

                          • Message #1715

                            Sorry, but this question isn't clear to me. I think it's more a PostGIS question than a pgRouting problem.

                            Though I think this has nothing to do with the initial question in this forum thread. May I ask you to start new topic if the question changes? Otherwise this will help nobody else, who searches for an answer in the forum.