[Talk-ca] geobase2osm.py work / questions

William Lachance wrlach at gmail.com
Tue Jun 30 20:09:59 BST 2009


2009/6/26 Steve Singer <ssinger_pg at sympatico.ca>:
> On Fri, 26 Jun 2009, William Lachance wrote:
>
>> Hi all,
>>
>> I've been needing to use geobase2osm in a project of mine (not
>> directly related to the geobase import), and noticed (as other people
>> have) that it's generating a lot of duplicated nodes. Aside from being
>> unclean and wasteful, this makes the generated osm file non-routable.
>> Well, today I decided to do something about it. Looking at the source,
>> I noticed quite a bit of complicated code to "merge" identical OSM
>> nodes at junctions (trusting geobase to provide the right hints of
>> where junctions are). Evidently this wasn't working quite as expected.
>
>
>>
>> I decided to try something simpler: just keep a hashtable of node
>> "keys" (latitude and longitude) as you go along, and reuse nodes that
>> have occurred before. :) At first glance, this approach seems to work
>> fairly well. It seems intuitively "right" to me that if two ways have
>> a common lat/lng point in common, they should be connected. A quick
>> count of running the two algorithms on Edmonton, Alberta, reveals that
>> where the old script resulted in 77242 (!) overlapping nodes
>> (sometimes up to 8 on a single lat/lng position!), my code resulted in
>> 0.
>
> Is this because the geobase data doesn't define Junction objects for those
> positions or some other reasons? Can you post a few examples of these?
> I wasn't aware that recent versions of the script were still doing this. (I
> probably won't get to look into the details for a few days though)

Here's a few examples of this:

1. Intersection at spruce grove of two highways with dual carraigeways:

http://www.openstreetmap.org/?lat=53.5578961&lon=-113.9100716&zoom=14&layers=B000FTF

8 duplicated nodes here.

2. Intersection in Saint Albert of a highway with dual carraigeways
with some dead-end roads:

http://www.openstreetmap.org/?lat=53.6560873&lon=-113.6120644&zoom=14&layers=B000FTF

6 duplicated nodes here.

I've uploaded a full list of duplicated nodes for the Edmonton area,
if anyone wants to see more evidence. :) It's just a raw list of
lat/lng coordinates, prefixed with the number of duplicated nodes that
geobase2osm is generating at that position. Check it out at:

http://wlach.masalalabs.ca/edmonton-dupe-nodes

Do we have consensus that it would be better to use my approach? If
so, how do we go about updating the "official" script?
-- 
William Lachance
wrlach at gmail.com




More information about the Talk-ca mailing list