/** * Clear the metadata properties. */ default void clearMetadata() { setLocationAltitude(null); setLocationLongitude(null); setLocationLatitude(null); // Remove all other metadata properties getPropertyKeys().stream() .filter(e -> e.startsWith(META_DATA_PROPERTY_PREFIX)) .forEach(e -> { setMetadata(e.substring(META_DATA_PROPERTY_PREFIX.length()), null); }); }
/** * Set the location information. * * @param loc */ default void setLocation(Location loc) { Objects.requireNonNull(loc, "A valid location object needs to be supplied. Got null."); setLocationLatitude(loc.getLat()); setLocationLongitude(loc.getLon()); Integer alt = loc.getAlt(); if (alt != null) { setLocationAltitude(alt); } }