AmericanRedCross / street-view-green-view

BSD 3-Clause "New" or "Revised" License
8 stars 9 forks source link

enhance method for finding associated image and not having duplicates #23

Closed danbjoseph closed 1 month ago

danbjoseph commented 4 months ago

[for prioritization after the MVP]

in @dragonejt's current implementation...

Hey Dan, so the current way I'm avoiding to have the same picture for multiple points is to store a set of all downloaded image IDs while I'm downloading, and filtering out the existing images before searching for the closest image. I think this is a simpler method and avoids the two passes, However, with this method, while that image may be the closest unique image for a point, that point may not be the closest point to that image. Is this method OK, or do you want to ensure that an image is tied to its closest point (probably requiring a second pass)?

is there an elegant way to both find the closest image to each point and ensure that each image is only used once in the resulting output (of sample points with associated street-level images)? note: at some point the image search may include other filters which may happen at the API query parameter level (if the Mapillary API supports it) or may happen once we have a set of images in response to an API query.

because how distinct road segments may be spatially close and have sampled points closer than the distance they are spaced along the segments, and because of inaccuracies introduced across steps dude to the complexities of spatial calculations involving features re-projected from the funky surface of the earth to a flat plane... the Mapillary API search bounds for each sample point (which are a bounding box and not the circular buffer shown below) are going to overlap. for example:

310555667-770fe9f2-57ed-487a-8ed7-5580804953a6
danbjoseph commented 1 month ago

@dragonejt resolved this issue here: https://github.com/AmericanRedCross/street-view-green-view/blob/24d4159bc2d34a7687e3576e0a179a5b11bfec9c/src/download_images.py#L70-L84