@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; } }
/** * <code>repeated string optional_features = 5;</code> */ @java.lang.Override public java.util.List<java.lang.String> getOptionalFeaturesList() { return java.util.Collections.unmodifiableList( instance.getOptionalFeaturesList()); } /**
size += 1 * getOptionalFeaturesList().size();