OSMDeepOD icon indicating copy to clipboard operation
OSMDeepOD copied to clipboard

Two possible enhancement

Open tufftuff93 opened this issue 7 years ago • 0 comments

Hello,

Two little remarks after finishing using OSMDeepOD. These are not a issues, the program is great and the results quite good.

1 - OSMDeepOD with the option FollowStreets = yes. In my work, i have to use a topology rule, « a point crosswalk must be on a road street line »

Looking at the code in node_merger.py, it seems that when nodes are merged by the function box_walker.walk(), the process doesn't try to snap (capture) the merged node on the nearest road street line. The pink points are the detected nodes vs the streets lines.

image

image

It would have been of use for me to find this option in the config.ini file. But it is not a problem, i will snap point to the nearest line with qgis or similar.

Looking at the code in node_merger.py, it seems possible :

@staticmethod
def _merge(sub_graph):
    node_count = len(sub_graph)
    latitude_sum = 0
    longitude_sum = 0
    for node in sub_graph:
        latitude_sum += node.latitude
        longitude_sum += node.longitude

    latitude = latitude_sum / node_count
    longitude = longitude_sum / node_count
_« « «  May be something to snap (capture) node to street if option = true» » »_
    merged = Node(latitude, longitude, 0)
return merged

2 – Config.ini, stepwidth vs step_distance :

For me, it was hard to understand the StepWidth option of the ini file, even with the docs. Was it a distance ? a ratio of something ? But if it is a ratio, why is it a step ?

After looking at the code, I discover the self._step_distance property of Walker() Object. This step_distance is much easier to understant for me ; ) It may help others.

And, you still can calculate step_width if you fix the step_distance in the config.ini. self._step_distance = resolution * (self._square_image_length * self._step_width).

Bye

tufftuff93 avatar Apr 07 '17 13:04 tufftuff93