Skip to content

Add ability to parse OSM BoundingBox again #2133

Closed

Description

@hegerdes

Add OSM BBox parsing
It would be great if the OSMReader would support the OSM-Header-BoundingBox. Especially because osmosis lib supports this already.

I know that you don't use the OSM BBox for the GH graph. The OSM BBox almost always has ways and relation that intercept the BBox and have nodes in- and outside the BBox. This can cause problems. But it would be nice if the Reader supports it for people who want to customize the Reader.

You already had the feature but disabled it:

OSMFileHeader fileheader = new OSMFileHeader();
long milliSecondDate = header.getOsmosisReplicationTimestamp();
fileheader.setTag("timestamp", Helper.createFormatter().format(new Date(milliSecondDate * 1000)));
decodedEntities.add(fileheader);
// Build a new bound object which corresponds to the header.
/*
Bound bound;
if (header.hasBbox()) {
HeaderBBox bbox = header.getBbox();
bound = new Bound(bbox.getRight() * COORDINATE_SCALING_FACTOR, bbox.getLeft() * COORDINATE_SCALING_FACTOR,
bbox.getTop() * COORDINATE_SCALING_FACTOR, bbox.getBottom() * COORDINATE_SCALING_FACTOR,
header.getSource());
} else {
bound = new Bound(header.getSource());
}
// Add the bound object to the results.
decodedEntities.add(new BoundContainer(bound));
*/

I would like to reimplement this and add it to GH.

Activity

  1. michaz commented on Sep 22, 2020

    @michaz
    Member

    What would you suggest should be GraphHopper‘s behavior when reading this bounding box? What should it do with it?

    (I‘m not familiar with the commented-out code, so I don‘t know its history or original purpose..)

  2. hegerdes commented on Sep 23, 2020

    @hegerdes
    Author

    For those how want to use GH as a library. Or for those how want hard Graph BB edges that are identical with the OSM BB.

    I know that the GH BB is calculated differently.
    Couldn't find anything either to the old code. Just one old init commit

  3. easbar commented on Dec 21, 2020

    @easbar
    Member

    For those how want to use GH as a library. Or for those how want hard Graph BB edges that are identical with the OSM BB.

    What do you mean? What are users who want to use GH as a library supposed to do with the OSM BB?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions