Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/agustinkassis/citytax-gps-log-parser
Parser for GPS log data
https://github.com/agustinkassis/citytax-gps-log-parser
Last synced: about 1 month ago
JSON representation
Parser for GPS log data
- Host: GitHub
- URL: https://github.com/agustinkassis/citytax-gps-log-parser
- Owner: agustinkassis
- Created: 2017-05-25T03:31:15.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2022-04-07T16:15:10.000Z (over 2 years ago)
- Last Synced: 2024-08-13T01:19:27.955Z (3 months ago)
- Language: JavaScript
- Size: 3.91 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# citytax-gps-log-parser
Parser for GPS log data## Usage
```js
const parser = require('./parser');
const filePath = './data/full.log';parser.getRawData(filePath)
.then(parser.parseRawData)
// Filter location data only
.then(data => data.filter(a => a.type === 'location'))
.then(data => {
console.info('Total gps points : ' + data.length);
return parser.groupIds(data);
})
/*
{
date: 2017-05-23T03:00:19.000Z,
ip: '171.117.138.208',
type: 'location',
data:
{
lat: -34.60429,
lng: -58.40219,
id: 9999,
index: '2920',
unknown: '*21<'
}
}
*/
.then(index => {
console.info('Total ids : ' + Object.keys(index).length);
})
.catch(err => {
console.error(err);
});
```