data (#23) - how to draw a polyline route, curved line route??? (#302) - Message List

how to draw a polyline route, curved line route???

Hi everyone, I'm working on Fridastreet Data that get from:  http://frida.intevation.org/

I used PostGIS function to find route between 2 node, it worked. I want to draw the route on map using some added GIS Library (GIS.NET) but I can only draw a direct route, because i lookup start point and end point of the route then draw as a line. But some routes is polyline route or curved route.

How can i solve this problems? thanks

PS: when i import frida data to PostGres? i have 4 table: fridastreets, geometry_columns, spatial_ref_sys, vertices_tmp

  • Message #1112

    Hi,

    I don't think I understood you well.

    pgRouting doesn't create any new geometry - it selects lines you have in you edge table. So, it is up to your data set if your lines are curved or not.

    Anton.

    • Message #1114

      hi, i had frida data downloaded from internet as *.shp, i do as instruction to import data to PostGreSQL. after importing successfully, my PostGre? database (routingdb) has 4 tables: fridastreets table:  http://img136.imageshack.us/img136/9920/74547054.jpg geometry_columns table:  http://img209.imageshack.us/img209/8518/13054529.jpg spatial_ref_sys table:  http://img202.imageshack.us/img202/6148/42018779.jpg vertices_tmp table:  http://img208.imageshack.us/img208/9949/57762023.jpg

      i used x1,y1,x2,y2 from fridastreets table to draw direct line to show a street

      so that i don't know how to work with curved line? where can i know a street is a curved line or not???

      • Message #1115

        Can you also please post a screenshot of you shortest path result?

        • Message #1117

          hi,
          my algorithm is:

          - find a nearest node of start point (node A)

          - find a nearest node of destination point (node B)

          - use shortest_path_astar2_as_geometry_internal_id function to find edges that lead from node A to node B, the result i put in a dataset (routeDS)

          - for each edge in routeDS i find x1,y1,x2,y2 from fridastreets table, then i draw a line from (x1,y1) to (x2,y2) on the map

          • Message #1121

            OK, I think I got it. So, you draw your route segments as straight lines between source and target vertices of each edge in the result, right?

            Do you have the_geom column in your table? I think you have. What you need to do is to draw the geometry stored in that column, but instead of that you create new geometries which are just straight lines.

            • Message #1122

              yes, i knew me well

              i have the_geom columns in fridastreets table, some data looks like:

              01050000000100000001020000001A000000AE47E17AA72B4A41AE47E11A9A1E564148E17A74BE2B4A41F6285CEF8A1E5641B81E854BD42B4A4114AE47617B1E56415C8FC235DA2B4A4185EB5128771E5641B81E85CBF92B4A418FC2F588631E56411F85EB31FE2B4A417B14AEF7601E564185EB51D81E2C4A4185EB5128501E56417B14AE473E2C4A417B14AEB7431E5641C3F5289C462C4A41713D0AB7401E5641B81E85AB512C4A418FC2F5783D1E564114AE47A1682C4A415C8FC235371E5641A4703D4A802C4A4114AE4701311E5641AE47E15A962C4A4185EB51D82C1E564166666666A22C4A41295C8F022B1E564152B81E65BC2C4A41F6285C7F271E5641295C8F42CE2C4A41713D0A77251E564185EB51D8DB2C4A41B81E855B241E5641B81E854BF72C4A41E17A149E221E564152B81E050C2D4A4114AE47F1211E5641713D0A77282D4A41F6285CFF211E5641713D0A174D2D4A41B81E856B231E56410AD7A3507A2D4A417B14AEA7241E5641713D0A37AC2D4A4114AE47A1241E5641713D0AD7D42D4A41E17A14FE231E5641C3F528FCF92D4A410AD7A360221E56419A9999D93C2E4A4152B81E551E1E5641


              but i don't know how to use this data, how to draw this type of data on my map??
              my map library is GIS.NET got from  http://www.geoframework.com

              • Message #1123

                PostGIS stores geometry data in WKB (Well Known Binary) format. It also can be converted to WKT, GeoJSON and GML. It is better to ask GIS.NET people if it can support one of those formats.

                Anton.

                • Message #1127

                  thanks for your help. now i can work well with my data. Have a good time :D