Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'Tiny line with length 0.0072m' (and importing Kraków center in general) #130

Closed
matkoniecz opened this issue Jul 6, 2020 · 12 comments
Closed

Comments

@matkoniecz
Copy link
Contributor

matkoniecz commented Jul 6, 2020

#98 comment mentions tiny geometries, but neither posted log nor comments mention this exact error message.

I run into the same on attempting to import Kraków, Poland (thread 'main' panicked at 'Tiny line with length 0.0072m', geom/src/line.rs:14:13).

I tried to process '50.05217,19.92569,50.06550,19.94619' bbox.

I obtained map data with following Ruby script:

require 'rest-client'

def download(bb, name)
  puts "downloading: start"
  query = '
  [timeout:1250];
  (
    nwr(' + bb + ');
  );
  out meta;'
  download_by_query(query, name)
end

def download_by_query(query, name)
  puts query
  query = query.gsub("\n", "")
  url = URI.escape("http://overpass-api.de/api/interpreter?data=" + query)
  puts url
  text = RestClient.get(url, user_agent: "please ban me for not specifying user agent").to_str
  puts "downloading: end"

  filename = "#{name}.osm"
  if File.exist?(filename)
    puts "deleting old file: start"
    File.delete(filename)
    puts "deleting old file: end"
  end
  puts "saving new file: start"
  f = File.new(filename, "w")
  f.write text
  f.close
  puts "saving new file: end"
end

download('50.05217,19.92569,50.06550,19.94619', 'krakow_center')

log dump: https://gist.github.com/matkoniecz/812a58eeb0448db85a373a2907fdbfee

@matkoniecz
Copy link
Contributor Author

Less than 1cm way in OSM sounds suspicious, maybe mentioning OSM way id would be helpful?

@dabreegster
Copy link
Collaborator

Thanks for reporting! The problem is here. I think there's a building with two nodes super close to each other. I will

  1. Print a better error here and point out the weird building

  2. Just be robust to this and not try to trim the driveway based on infinitesmally small lines along the building outline

  3. Import this slice of Krakow and deal with any other problems that come up. (I guarantee there will be some)

@dabreegster dabreegster added the bug label Jul 6, 2020
@matkoniecz
Copy link
Contributor Author

Import this slice of Krakow and deal with any other problems that come up. (I guarantee there will be some)

Thanks! Working import of entire Kraków also would be nice, but I am unsure whatever my computer will be able to run it :)

Let me know if anything is dubious in the OSM data! Either by commenting there, or even better by opening an OSM note. I am an active mapper and live there. In case of things clearly broken in OSM it may be also possible to add it to JOSM validator/iD validator.

And in case of missing useful data that is actually used by AB - I may be able to add it to StreetComplete or map it manually. So report of clearly missing data in OSM also would be an useful feature.

@matkoniecz matkoniecz changed the title 'Tiny line with length 0.0072m' 'Tiny line with length 0.0072m' (and importing Kraków center in general) Jul 6, 2020
@matkoniecz
Copy link
Contributor Author

Import this slice of Krakow and deal with any other problems that come up. (I guarantee there will be some)

I changed the title so other potentially interested in doing this will easily find this issue (please revert if you prefer to do it differently)

@dabreegster
Copy link
Collaborator

Actually there was just a bug in the importer, failing to dedupe points. It's possible that https://www.openstreetmap.org/relation/1863016 has some points really close to each other, but it's not an issue for A/B Street.

Otherwise Kraków imports just fine! No big issues jump out to me. I don't see any parking lanes mapped (I've yet to find a city in OSM that already has good coverage on these). I'll keep this bug open in case you find other issues in the area. If you're interested in including it as a default map bundled in the release, we can also discuss that.

(Also, I'm too lazy to install Ruby, so I grabbed an extract from http://download.geofabrik.de/europe/poland/malopolskie.html, drew a polygon in geojson.io (and put it in the above commit), and used osmconvert to get the extract.)

@matkoniecz
Copy link
Contributor Author

don't see any parking lanes mapped (I've yet to find a city in OSM that already has good coverage on these)

In Poland OSM community teds to map the as areas if at al. See for example https://www.openstreetmap.org/?mlat=52.22805&mlon=21.00880#map=19/52.22805/21.00880&layers=N in Warsaw, capital of Poland.

And yes, it would be probably a nightmare to convert this kind of data into format usable by abstreet.

If streetcomplete/StreetComplete#771 will succeed then mapping of this kind of data may get a boost, openstreetmap/iD#6178 is also nice idea but less straightforward to implement.

@dabreegster
Copy link
Collaborator

Screenshot from 2020-07-06 08-00-57
The parking areas work, but there's really hacky inference of individual spots. Most of the time in Seattle, if there's street parking, it mostly covers the whole block. If not, sometimes I'll split the way.

I'd love to see StreetComplete support happen. A third option is https://dabreegster.github.io/abstreet/map_parking.html. When A/B Street has proper web support, this might be a really easy way to get lots of help from people. The downside is that it doesn't handle splitting ways.

@matkoniecz
Copy link
Contributor Author

The downside is that it doesn't handle splitting ways.

This is a bit tricky to implement, if you would be planning to do this then streetcomplete/StreetComplete#1329 is what implemented it in StreetComplete and lists some things that were needed to do it properly.

I'll keep this bug open in case you find other issues in the area

I will try to play with map of the Kraków. Where I should report various deficiencies like potential suboptimal tagging support or other issues related to that region that are not game breaking? I undestard this comment as indicator that it should be done in this issue (as it is less relevant compared to the primary target), rather by creating a new ones.

@dabreegster
Copy link
Collaborator

If it's just a few things, in this bug is fine. If not, feel free to split into separate issues however makes sense to you. Thanks!

@matkoniecz
Copy link
Contributor Author

And one more before I will report them - are you also interested also in bugs/feature requests that are not useful in USA, but are relatively easy to fix? What about important missing features that are not going to be useful in USA?

I assume that first group is OK to report, second makes sense to report only if I am willing to also prepare a PR.

@dabreegster
Copy link
Collaborator

Both are fine. I can't promise to prioritize harder stuff. If there's some tasks particular to an area, we can maybe add labels for them, and try to drum up interest from people in those areas to contribute.

@matkoniecz
Copy link
Contributor Author

OK, this one is fixed and I opened issues for new topics. I will close this one and do probably more in-depth testing once highway=pedestrian are appearing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants