for (String feature : header.getRequiredFeaturesList()) { if (supportedFeatures.contains(feature)) { } else {
@Override public Map<String, Object> apply(Osmformat.HeaderBlock header) { // Check if there are any unsupported features in the file. // Build the list of active and unsupported features in the file. List<String> unsupportedFeatures = new ArrayList<>(); for (String feature : header.getRequiredFeaturesList()) { if (!SUPPORTED_FEATURES.contains(feature)) { unsupportedFeatures.add(feature); } } // We can't continue if there are any unsupported features. We wait // until now so that we can display all unsupported features instead of // just the first one we encounter. if (unsupportedFeatures.size() > 0) { throw new OsmosisRuntimeException("PBF file contains unsupported features " + unsupportedFeatures); } Map<String, Object> osmosisMetadata = new HashMap<>(); if (header.getOptionalFeaturesList().contains("LocationsOnWays")) { osmosisMetadata.put(WayNode.METADATA_KEY_LOCATION_INCLUDED, true); } else { osmosisMetadata.put(WayNode.METADATA_KEY_LOCATION_INCLUDED, false); } return osmosisMetadata; } }
@Override public void parse(Osmformat.HeaderBlock block) { for (String s : block.getRequiredFeaturesList()) { if (s.equals("OsmSchema-V0.6")) { continue; // We can parse this. } if (s.equals("DenseNodes")) { continue; // We can parse this. } throw new IllegalStateException("File requires unknown feature: " + s); } if (block.hasOsmosisReplicationTimestamp()) { long timestamp = block.getOsmosisReplicationTimestamp(); LOG.info("PBF file has a replication timestamp of {}", Instant.ofEpochSecond(timestamp)); entitySink.setReplicationTimestamp(timestamp); } else { LOG.info("PBF file has no replication timestamp."); } }
for (String feature : header.getRequiredFeaturesList())
size += 1 * getRequiredFeaturesList().size();
for (String feature : header.getRequiredFeaturesList()) { if (supportedFeatures.contains(feature)) { } else {
for (String feature : header.getRequiredFeaturesList()) { if (supportedFeatures.contains(feature)) { } else {
@Override public void parse(Osmformat.HeaderBlock block) { for (String s : block.getRequiredFeaturesList()) { if (s.equals("OsmSchema-V0.6")) { continue; // We can parse this. } if (s.equals("DenseNodes")) { continue; // We can parse this. } throw new OsmosisRuntimeException("File requires unknown feature: " + s); } if (block.hasBbox()) { String source = OsmosisConstants.VERSION; if (block.hasSource()) { source = block.getSource(); } double multiplier = .000000001; double rightf = block.getBbox().getRight() * multiplier; double leftf = block.getBbox().getLeft() * multiplier; double topf = block.getBbox().getTop() * multiplier; double bottomf = block.getBbox().getBottom() * multiplier; Bound bounds = new Bound(rightf, leftf, topf, bottomf, source); sink.process(new BoundContainer(bounds)); } }
/** * <pre> * Additional tags to aid in parsing this dataset * </pre> * * <code>repeated string required_features = 4;</code> */ @java.lang.Override public java.util.List<java.lang.String> getRequiredFeaturesList() { return java.util.Collections.unmodifiableList( instance.getRequiredFeaturesList()); } /**