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

Speed up fill_overpass_data #247

Open
FlxPo opened this issue Nov 2, 2021 · 1 comment
Open

Speed up fill_overpass_data #247

FlxPo opened this issue Nov 2, 2021 · 1 comment

Comments

@FlxPo
Copy link

FlxPo commented Nov 2, 2021

I had performance issues with osmdata_sc used directly on OSM data (by providing a local .osm file), with medium to large files (30 Mo to 300 Mo, extracted with osmextract + osmium).

I think I found a way to speed things up : fill_overpass_data is loading the OSM xml data and then casting it as character, which appears to be very slow. I simply replaced doc <- as.character(doc) by doc <- readChar (doc, file.info (doc)$size) : on my machine, a quick test with a 50 Mo .osm file gives an execution time of 4s instead of 80s.

I'll make a PR with the proposed changes.

@mpadge
Copy link
Member

mpadge commented Nov 2, 2021

Thanks @FlxPo - that looks like a very important improvement indeed! I'll check it out asap and get back to you.

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