Skip to content

Commit

Permalink
Update CHANGELOG
Browse files Browse the repository at this point in the history
  • Loading branch information
ingalls committed Dec 6, 2023
1 parent 17f09e5 commit 3beda3d
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 13 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@

## Version History

### v2.3.0

- :rocket: Add denver timezone & add explicit fields

### v2.2.0

- :bug: remove status property
Expand Down
26 changes: 23 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"eslint-plugin-node": "^11.1.0"
},
"dependencies": {
"@tak-ps/etl": "^2.0.1"
"@tak-ps/etl": "^2.0.1",
"moment-timezone": "^0.5.43"
}
}
31 changes: 22 additions & 9 deletions task.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import fs from 'fs';
import ETL from '@tak-ps/etl';
import moment from 'moment-timezone';

try {
const dotfile = new URL('.env', import.meta.url);
Expand Down Expand Up @@ -50,6 +51,12 @@ export default class Task extends ETL {
incident_type: {
type: 'string'
},
incident_status: {
type: 'string'
},
startTime: {
type: 'string'
},
lastUpdated: {
type: 'string'
},
Expand Down Expand Up @@ -85,14 +92,20 @@ export default class Task extends ETL {

const features = [];
for (const feature of incidents.map((incident) => {
incident.id = incident.properties.id;
incident.properties.remarks = incident.properties.travelerInformationMessage;
incident.properties.callsign = incident.properties.type;
incident.properties.incident_type = incident.properties.type;
delete incident.properties.type;
delete incident.properties.status;
incident.properties.type = 'a-f-G'
return incident;
return {
id: incident.properties.id,
type: 'Feature',
properties: {
remarks: incident.properties.travelerInformationMessage,
callsign: incident.properties.type,
type: 'a-f-G',
incident_type: incident.properties.type,
incident_status: incident.properties.status,
startTime: moment(incident.properties.startTime).tz('America/Denver').format('YYYY-MM-DD HH:mm z'),
lastUpdated: moment(incident.properties.lastUpdated).tz('America/Denver').format('YYYY-MM-DD HH:mm z')
},
geometry: incident.geometry
};
})) {
if (feature.geometry.type.startsWith('Multi')) {
const feat = JSON.stringify(feature);
Expand All @@ -119,7 +132,7 @@ export default class Task extends ETL {
const fc = {
type: 'FeatureCollection',
features: features.filter((feat) => {
return allowed.includes(feat.geometry.type)
return allowed.includes(feat.geometry.type);
})
};

Expand Down

0 comments on commit 3beda3d

Please sign in to comment.