sharedstreets / sharedstreets-js

SharedStreets (Node.js & Javascript)
https://sharedstreets.io
MIT License
76 stars 25 forks source link

API often generates duplicate geometries #30

Open emilyeros opened 5 years ago

emilyeros commented 5 years ago

For the example I looked at, about half of the geometries generated were unique, and the other half had at least one duplicate geometry with the same referenceID and metadata. There wasn't an obvious correlation to the match score. More details below.


image

I poked around in the data a little more and found that the match score doesn't (seem to) account for whether or not a street segment gets duplicated. The unique segments and the reference segments had a similar minimum and average match score, and the maximum match score actually came from one of the duplicates. I also compared the scores for each set of duplicates and didn't see anything obvious - on average, there was a small difference in scores (2.0), but sometimes the difference was extremely small (0.003) and sometimes it was extremely large (66).

The only thing I could glean is that some duplicates had very, very small disagreement about where an intersection is - in some cases, they would both be slightly wrong, but in different directions. It makes sense that they may have similar match scores. But that doesn't explain duplicates with larger differences.

image

emilyeros commented 5 years ago

Related: Sometimes the API generates geometries that are segmented in places I wouldn't expect - they are slightly off. Here's an example. Keep in mind that the view is very zoomed in, so the gap I point out is less than 0.5 metres wide. This could be a rounding issue in the math... but it's also generating duplicates.

image

emilyeros commented 5 years ago

@kpwebb here's the centerline file that generated the duplicates:

The example above uses the following matchURL: https://api.sharedstreets.io/v0.1.0/match/geoms?lengthTolerance=0.25&dataSource=osm/planet-180430&ignoreDirection=true&bearingTolerance=35&searchRadius=25&auth=bdd23fa1-7ac5-4158-b354-22ec946bb575

Note: the 18-04-30 tileset generated very different results than I got from other dates, so here's another example just in case:

MatchURL used: https://api.sharedstreets.io/v0.1.0/match/geoms?lengthTolerance=0.25&dataSource=osm/planet-180924&ignoreDirection=true&bearingTolerance=35&searchRadius=25&auth=bdd23fa1-7ac5-4158-b354-22ec946bb575

Example of duplicate: RefID = a3fdeb2166fc1afec2e8a58ca706b071 RefID = e0aa148850fd8cb24821b25dd38d565c