data (#23) - New OSM-Converter (#335) - Message List

New OSM-Converter

Hey folks,

here's another one. It's rather experimental but works even with larger sets like Germany. It's purely written in Java without any dependencies to other libraries. The focus of this converter is on reduction of data, not on pulling each info piece into DB. The result is a single SQL file, you can push into your routing db.

Feedback welcome.

Here is the link:

 http://rapidshare.com/files/353030545/osm2pgr-0.8.zip.html

Password is "osm"

Rapidshare says 10 downloads are the limit. So contact me, if the bag is empty.

Greetings.

Carsten. Germany.

PS.

Sorry, the program is under CC-BY-NC-ND.

  • Message #1385
  • Message #1428

    New version with some major bug fixes.

     http://www.load.to/YNqRHuB89X/osm2pgr-0.8.3.zip

    Fixes:

    1) Now ST_ - works correctly.
    2) Backslash-Problem when importing great-britain.osm
    3) Accoustic signal for phase 1 - 3 (beep, beep, beep)
    4) handles new boundings tag from extracted osm files.

    New experimental features:

    1) Crop-Mode
    2) Merge-Mode

    Future:

    1) Creating directed graph for e.g. shooting*

    some people asked for a short How-To ...

    Precondition: Java 1.6 and above

    java -Xmx128m -jar osm2pgr-0.8.3.jar 0 hh hamburg.osm
    

    If you have more memory available you can speed up things a lot

    java -Xmx1280m -jar osm2pgr-0.8.3.jar 0 de germany.osm tileGrid=3x3
    

    The latter uses more memory cache but fewer cache files.

    On a 2-Gig/2-Gig-Windows-Home-Box this takes about 75 minutes to create the sql file and another 45 minutes to push it into db via psql.

    you can also run the phases separately.

    java -Xmx1024m -jar osm2pgr-0.8.3.jar 1 de germany.osm tileGrid=2x2
    java -Xmx1024m -jar osm2pgr-0.8.3.jar 2 de tileGrid=2x2
    java -Xmx1024m -jar osm2pgr-0.8.3.jar 3 de tileGrid=2x2
    

    If you extract the config.properties from the jar you can also use a call like this:

    java -Xmx128m -jar osm2pgr-0.8.3.jar 0 hb bremen.osm config=my.properties
    

    Every parameter is overridable on the command line with the pattern:

    property=value (no spaces!)

    Some successful tests:

    germany.osm (from geofabrik) great-britain.osm (from geofabrik) africa.osm (from geofabrik) new-york.osm (from claudmade) south of europe.osm (from geofabrik)

    Regards

    Carsten

    • Message #1455

      + Great work

      - I'm a newbie in routing

      To my Problems: I'm trying to understand the tutorial from http://pgrouting.postlbs.org/wiki/WorkshopOL2.7andOSM

      The result of using your tool is a table os_topo (with the osnabrueck.osm file from the tutorial). But there are not tables like classes, nodes, types, vertices_tmp. If I understand the tutorial right then it is mandatory to have those tables.

      My table os_topo looks similar to the table ways from the tutorial except that it has no "gid" column. Is your "id" column identical to the "gid" from the tutorial?

      The result of the tutorial is always an alert box "wrong" if I start a route calculation (if ignoring the missing tables and using id as gid). So I need a little help to figure out how to work around the missing data to match the requirements of the tutorial. Or is there a more Windows friendly guide available?

      Any help, hints, tutorials?

      Thanks and Regards, R.L.

      • Message #1456

        Hey LongRed?,

        all you need is this single table.
        assigning vertices etc. is already processed by the converter.
        To get a first impression just test a simple dijkstra.
        e.g. From Vertex 4711 to 4712 you would call:

        SELECT * FROM Shortest_path('select * from os_topo', 4711, 4712, false, true);
        

        Shortest_Path expects an id, not a gid. I don't remember the example exactly but in most tutorials the gid is aliased for id. Sth. like "SELECT gid AS id ..."

        If you'd like to print the street names in one shot plus having the ability to visualize it in QuantumGIS:

        CREATE OR REPLACE VIEW my_route AS
        SELECT topo.id, topo.osm_name, topo.geom_way AS edge
        FROM Shortest_Path('SELECT * FROM os_topo', 217188, 354000, false, true)
        AS path, os_topo AS topo
        WHERE path.edge_id = topo.id;
        

        By the way. There are some other columns in this table. Most of them I use in QuantumGIS where you can visualize your route and topo very nicely.

        Regards,

        Carsten

  • Message #1475

    Hey guys.. The links you 've posted don't work.....Please post valid links.. Thanks!!

    • Message #1476

      Hi pimapper,

      pgRouting is going to move website, mailing lists and subversion to OSGeo servers. We can also provide space for file downloads ( http://download.osgeo.org/pgrouting). You're welcome to put your files there if you like.

      Just contact me so we can see how that works with server access (daniel at georepublic dot de)

      • Message #1477

        Ups !!!

        Load.to killed that file.

        Hey Daniel, can you give me an account and an own folder under binaries?

        Thanks,

        PIMapper.

        Additional info:

        New features of the next version:

        - Bidirected graph creation
        - Interface for implementing your own writer
        - Cropping and Merging of tiles
        - Parallel converting with more than one machine

        • Message #1478

          Hi PIMapper,

          I'm trying to understand the OSGeo wiki page about the download server and the reponse of Frank Warmerdam in my ticket to create a download directory for pgRouting. Maybe it's too early to understand ;-)

           http://wiki.osgeo.org/wiki/Download_Server#Management
           http://trac.osgeo.org/osgeo/ticket/558#comment:2

          So far I can login or upload files but don't really get what means "so anyone from the pgrouting team should be able to write" ... who is pgRouting team? ;-)

          Maybe I need to ask Frank. Though do you have an OSGeo ID already?

          • Message #1480

            Hmmm...

            sounds comlicated ;-(

            Until everything is more clear I will be waiting. In the meantime I'm going on bothering load.to with my jar. Maybe you can help me at this point, download it and put it on a stable download server. I don't know how long it will survive this time but imform me if it's down again. Here is the new Link:

             http://www.load.to/AjSwi1Gmq2/osm2pgr-0.8.3.zip

            I'm still working on the next version. But I don't want to release it now because there are some professional things I want to integrate first. Things like versioning, comprehensive documentation, reference and tutorial. The tutorial will be written in german but I hope there is s.o. out there who can translate it one day. Ring Ring!!! - Is there anyone who can do this for me?

            Regards,

            Carsten, alias PIMapper.

            • Message #1481

              Thank you! I put the file on the OSGeo download server:

               http://download.osgeo.org/pgrouting/osm2pgr/

              I think once you made an account for OSGeo (whether it's for the Drupal website or their TRAC it's all the same) you might be able to upload files yourself or at least I can ask to add you to the list)

              Since we also want to move this TRAC to OSGeo servers (will be the last step though), I'm thinking now to cleanup the wiki and organize it better. It would be nice to also have the tools around pgRouting around, so users can find them easily. We can also share the Subversion repository (needs some better structure as well).
              pgRouting is also looking for contributors and I think most important to achieve this is to make it easy for everyone to participate. I might be able to translate your tutorial. I might also make use of your import tool in the pgRouting workshop at FOSS4G in Barcelona.

              • Message #1482

                Thank you!

                But I hope it's ok that this tool is under CC-BY-NC-ND?
                OSGEO is a pure OpenSource?-Place, isn't it?

                Regards,

                Carsten.

                • Message #1485

                  Hi Carsten,

                  Thanks for the hint! ;-) Sorry, I actually didn't check the license in detail and missinterpreted the meaning of "NC-ND".

                  Just out of curiousity: do you have a particular reason to chose this license type? It is not so common one and I'm afraid it might retain people to use your software or contribute.

                  I don't think OSGeo has such a policy regarding their download server and assume it's OK. It would be not OK probably if you would like to become an OSGeo project.

                  Personally your license choice would make it impossible to use osm2pgr for projects of my company (Georepublic), so I would prefer alternative tools then.

                  • Message #1486

                    Sorry, I haven't found an appropriate licence, yet. So I've chosen a quite strict one. May be I will open the results even for commercial use. I've written an interface for implementing your own writer. So at least the ND doesn't make sense anymore. But I don't want s.o. messing around in the sources. As a consequence "OpenSource?" is not the right choice for me. Do you know another licence model for my purpose?

                    • Message #1492

                      Probably your software would be then some sort of "Freeware". I actually don't think people "mess around" with source code, instead they would review your source code and do a lot of testing.

                      pgRouting in my opinion makes it too difficult for users at the moment to participate, what I want to change, because it's great for a project to have an active community.
                      On the other hand I'm in favor of licenses with copyleft ( http://en.wikipedia.org/wiki/Free_software_licence#Restrictions) like GPL does.

                      I think to provide good code quality + developer participation, it's just about providing the right infrastructure and tools.

                      • Message #1499

                        Hi Daniel,

                        in the meantime I've renamed the converter to osm2po and have put it under a freeware licence. Before posting it here or somewhere else I would like to post it to you. I have also finished the german documentation. Can you give me your email-addi for this purpose?

                        Regards

                        Carsten

                        • Message #1500

                          daniel at georepublic dot de

                  • Message #1488

                    Hey Daniel,

                    you said you can translate the doc into english? May I send you the first draft (meanwhile 14 illustrated pages) via email?

                    Regards,

                    Carsten.

                    • Message #1491

                      Well, you can send me a first draft but it would be probably better to wait until there are no big changes anymore. though I can't tell when I will have a time to help with translation. Depends a bit on the amount of text.

  • Message #1517

    Hi pimapper!!

    i have downloaded your app and it works well!! Thank you!! Now I have some questions about some things that I don't understand. 1- How do you calculate the column "cost"? Normally this columns have to be directly the column lengh, isn't it? 2- Which app can I use to visualize the solution? I was thinking about QGIS!! Isn't there any other better? 3- I don't understand so much the table solution. What is edge_id? and why do I have a lot of lines? what does it mean each line?

    thank you far all!! :DDD

    Jorge

    • Message #1518

      The cost is based on the real length in km and the estimated speed from the config.properties (inside jar). I don't use the max-speed from *.osm. The cost itself is measured in real hours. I tested it against google maps. I chose a route from the south to the north of germany. The distance was exactly the same (633 km). The estimated time differed around 10 minutes or so.

      Regards,

      PiMapper?

      PS: QGIS is the best!

      • Message #1520

        Thank youuu!! But I have another question...

        With QGIS, can you visualize the number of each node, or the name of each street?¿ I hope that yes, but I don't have any idea of how do it!

        Thankssss :)

        • Message #1521

          Yes, it is possible. Double click on the layer in the tree view. A dialog will pop up where you can edit properties for labels, colors etc. You can also restrict data, classify them (even IDs in yellow, odd in blue) or sth. like that.

          Regards

          Carsten

          • Message #1524

            I did it!! thank you!!

            Now I've got a problem...I don't know how to use the wrapper functions with your program osm2pgRouting... I have tried by this way (I want to use, for example, the routing dijkstra_sp):

            SELECT * FROM dijkstra_sp('SELECT id AS gid, source, target, cost AS lenght, geom_way AS the_geom FROM cat_topo', 119745, 120158);

            But it doesn't work!!

            How can i solve it??

            Thank youu! :)

            • Message #1525

              I've never tested the wrappers. I don't really know what parameters they do expect... Your cat_topo has id, source, target, x1, y1, x2, y2, cost. This is exactly what shortest_path or shortest_path_astar expect. I don't know if the wrappers need renamed attributes. If so, create a query with aliased attributes like SELECT gid as id, etc... Maybe Daniel can help at this point.

              Regards

              Carsten (from Hamburg, Germany)

              • Message #1526

                Yess!! that's what I am trying to do!!

                Now I have another query to ask you...Can you give me the equation which you calculate the row COST? I know that there's the time on the middle, but I would like to know how you calculate exactly.

                Thank youu! :)

              • Message #1527

                Can I have too the code source of your app osm2pgrouting? Because on the web there's only the binary .jar, and I would like to have the source. Can I?

                Thanksss a lot :)

                • Message #1528

                  Here is a good link for calculating distances on earth:

                   http://www.movable-type.co.uk/scripts/latlong.html

                  ... no, sorry. I'm not going to put it open source. see discussion above. Maybe the next version will be free. If you have detailed question you can ask me directly via e m ail: cmindividual ( a t ) web (d o t) de.

                  Regards

                  Carsten.

                  • Message #1548

                    What about a documentation?

                    What is the meaning of "highway.tertiary = 3, 40" for example? 40 km/h and 3 because it is tertiary?

                    Thanks and Regards, R.L.

                    • Message #1552

                      3 is a self defined priority. I use this for data reduction on PostGIS 40 km/h is correct. You may contact me via EMail. See above.

                    • Message #1596

                      LAST INFO ON THIS THREAD:


                      I RENAMED osm2pgr TO osm2po.

                      I ALSO PUT IT UNDER ITS OWN DOMAIN.

                      LOOK AT  http://osm2po.de

                      REGARDS

                      Carsten