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

Read OSM PBF file header and bounds? #147

Open
WalterSharpJr opened this issue Mar 20, 2023 · 1 comment
Open

Read OSM PBF file header and bounds? #147

WalterSharpJr opened this issue Mar 20, 2023 · 1 comment

Comments

@WalterSharpJr
Copy link

I'm busy converting a library I originally wrote in c++ with libosmium to c# and OsmSharp.

One issue I'm having is that with the libosmium library I could retrieve the bounding box for the PBF file like so:

auto header = pbfReader.header();
auto box = header.box();

if (box.valid()) {
	auto topRight = box.top_right();
	auto bottomLeft = box.bottom_left();

	bounds.SetBounds(bottomLeft.lon(), topRight.lat(), topRight.lon(), bottomLeft.lat());
}

I'm trying to find a way to do the same with OsmSharp but I'm not coming up with anything. Is this something that can be done with OsmSharp?

Thanks.

@xivk
Copy link
Contributor

xivk commented Mar 20, 2023

I never implemented this feature but it would be an excellent addition... I personally don't have the time at the moment do this but I can't image this being very difficult.

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