Load timestamp from geojson

This commit is contained in:
pietervdvn 2021-04-22 20:08:03 +02:00
parent b5862ab8a9
commit c20e2def5b
2 changed files with 13 additions and 5 deletions

View file

@ -179,7 +179,12 @@ export default class GeoJsonSource implements FeatureSource {
} }
self.seenids.add(feature.properties.id) self.seenids.add(feature.properties.id)
newFeatures.push({feature: feature, freshness: time}) let freshness : Date = time;
if(feature["_timestamp"] !== undefined){
freshness = new Date(feature["_timestamp"])
}
newFeatures.push({feature: feature, freshness: freshness})
} }
console.log("Downloaded "+newFeatures.length+" new features and "+skipped+" already seen features from "+ url); console.log("Downloaded "+newFeatures.length+" new features and "+skipped+" already seen features from "+ url);

View file

@ -156,10 +156,13 @@ async function postProcess(targetdir: string, r: TileRange, theme: LayoutConfig)
} }
} }
} }
const featuresFreshness = geojson.features.map(feature => ({ const featuresFreshness = geojson.features.map(feature => {
freshness: osmTime, feature["_timestamp"] = rawOsm.osm3s.timestamp_osm_base;
feature: feature return ({
})); freshness: osmTime,
feature: feature
});
});
// Extract the relationship information // Extract the relationship information
const relations = ExtractRelations.BuildMembershipTable(ExtractRelations.GetRelationElements(rawOsm)) const relations = ExtractRelations.BuildMembershipTable(ExtractRelations.GetRelationElements(rawOsm))
MetaTagging.addMetatags(featuresFreshness, relations, theme.layers); MetaTagging.addMetatags(featuresFreshness, relations, theme.layers);