Repository navigation
Closed
Description
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:
graphhopper/reader-osm/src/main/java/com/graphhopper/reader/osm/pbf/PbfBlobDecoder.java
Lines 97 to 116 in c0aaffa
| 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.
Metadata
Metadata
Assignees
Labels
No labels
Activity
michaz commentedon Sep 22, 2020
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..)
hegerdes commentedon Sep 23, 2020
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
easbar commentedon Dec 21, 2020
What do you mean? What are users who want to use GH as a library supposed to do with the OSM BB?