Commit 6d1b9d6f authored by oscar's avatar oscar

提交地图

parent cbf7f86f
Pipeline #1046 canceled with stages
const readline = require('readline');
const fs = require('fs');
function csv2json(csvFile, parsetime) {
const objReader = readline.createInterface({
input: fs.createReadStream(csvFile)
})
let lastTs = 0
console.log("[")
let num = 0;
objReader.on('line', (line) => {
let items = line.split(',')
// let tm = parseInt(items[0])
// if (parseInt(parsetime) == 1) {
// tm = Moment(tm).format("YYYY-MM-DD HH:mm:ss.SSS");
// }
//PtcType: Car, Person, Bicycle, Bus, Truck
let typeName = "Car";
if(items[24] == 1)
typeName = "Car";
else if(items[24] == 2)
typeName = "Truck";
else if(items[24] == 3)
typeName = "Bus";
else if(items[24] == 4)
typeName = "Person";
else if(items[24] == 5)
typeName = "Bicycle";
let obj = { ID: items[3], PtcType: typeName, time: parseInt(items[2]), PtcHeading: items[31], PtcLon: items[35], PtcLat: items[36], DataType: '3', Dev: '1' }
if( num == 0)
{
}
else if(num == 1)
{
console.log(JSON.stringify(obj));
}
else
{
console.log("," + JSON.stringify(obj));
}
num++;
})
objReader.on('close', () => {
console.log("]")
})
}
const args = process.argv.splice(2);
if (args.length < 1) {
process.exit()
}
csv2json(args[0])
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
[{"OBJID": "2030875711", "MeshID": 20168942, "RoadIDS": "1058624228", "LaneIDS": "1348337513;1387354938", "OH_type": 1, "geometry": [[121.159340157767, 31.2838960141348, 16.0037315925583], [121.159326047916, 31.2839643674101, 16.51]]}]
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
[{"OBJID": "157783753", "MeshID": 20168943, "RoadID": "1962332781", "LaneID": "2537398761", "Color": 1, "geometry": [[121.188876338572, 31.2818366937406, 13.6376500800252], [121.188868694356, 31.2818430122737, 13.6430176869035], [121.188886269618, 31.2818590756484, 13.7004358191043], [121.188893881627, 31.2818530043096, 13.6975311059505], [121.188876338572, 31.2818366937406, 13.6376500800252]]}, {"OBJID": "163034261", "MeshID": 20168943, "RoadID": "1835981789", "LaneID": "1386351215", "Color": 1, "geometry": [[121.186108524408, 31.279261437817, 13.7594351852313], [121.186100055234, 31.2792687339828, 13.768041706644], [121.186115794004, 31.2792832615964, 13.7017688397318], [121.186124137395, 31.2792768037625, 13.7021437166259], [121.186108524408, 31.279261437817, 13.7594351852313]]}, {"OBJID": "678133873", "MeshID": 20168940, "RoadID": "1552038438", "LaneID": "124518048", "Color": 1, "geometry": [[121.170868565103, 31.2656482321004, 13.073837691918], [121.170860860125, 31.2656531632862, 13.0619377512485], [121.170874523619, 31.2656719634321, 13.069122212939], [121.170882023131, 31.265666313115, 13.0734467823058], [121.170868565103, 31.2656482321004, 13.073837691918]]}, {"OBJID": "748158045", "MeshID": 20168943, "RoadID": "1736954580", "LaneID": "3513778529", "Color": 1, "geometry": [[121.184830675698, 31.2771908845214, 13.4864856898785], [121.184841264098, 31.277190935618, 13.4652505358681], [121.184840968223, 31.2771702835191, 13.4074334623292], [121.184830242742, 31.2771704018692, 13.4503737175837], [121.184830675698, 31.2771908845214, 13.4864856898785]]}, {"OBJID": "879695376", "MeshID": 20168943, "RoadID": "1374999127", "LaneID": "1985711340", "Color": 2, "geometry": [[121.185768571767, 31.2789403975182, 14.0155607815832], [121.185759890459, 31.2789481163298, 13.9757702816278], [121.18577864246, 31.2789657854322, 13.9036911856383], [121.185787077085, 31.2789585347833, 13.9117783140391], [121.185768571767, 31.2789403975182, 14.0155607815832]]}, {"OBJID": "1041767581", "MeshID": 20168942, "RoadID": "1813720573", "LaneID": "", "Color": 2, "geometry": [[121.161154261164, 31.2823133480677, 13.268054259941], [121.161153522881, 31.2823279898854, 13.2966355672106], [121.161218583508, 31.2823330451195, 13.1735556917265], [121.161219779037, 31.282318867514, 13.1618882203475], [121.161154261164, 31.2823133480677, 13.268054259941]]}, {"OBJID": "1185987810", "MeshID": 20168940, "RoadID": "1552038438", "LaneID": "629141558", "Color": 1, "geometry": [[121.170835074133, 31.2656672377124, 13.0313656637445], [121.170826906856, 31.2656729907625, 13.0046480167657], [121.170842727744, 31.2656909176775, 13.0126209333539], [121.170850689554, 31.2656850618944, 13.0325108077377], [121.170835074133, 31.2656672377124, 13.0313656637445]]}, {"OBJID": "1348015376", "MeshID": 20168942, "RoadID": "1997051082", "LaneID": "", "Color": 2, "geometry": [[121.1607580353, 31.2822818032401, 13.3399443440139], [121.160758046152, 31.2822951172461, 13.3294142745435], [121.160816569732, 31.2822999362731, 13.1834151120856], [121.160816869255, 31.2822865086803, 13.1866635894403], [121.1607580353, 31.2822818032401, 13.3399443440139]]}, {"OBJID": "1367610562", "MeshID": 20168940, "RoadID": "1964545428", "LaneID": "3308576250", "Color": 1, "geometry": [[121.170723403321, 31.265485502969, 13.0818241657689], [121.170716006542, 31.2654915642182, 13.0700378483161], [121.170733265692, 31.2655094397668, 13.0592024819925], [121.170740148806, 31.2655029675854, 13.0727273141965], [121.170723403321, 31.265485502969, 13.0818241657689]]}, {"OBJID": "1386839739", "MeshID": 20168943, "RoadID": "1936837671", "LaneID": "1925952536", "Color": 1, "geometry": [[121.185020856956, 31.2782341837653, 13.8146850410849], [121.185012516559, 31.2782399556881, 13.8402620563284], [121.185030246918, 31.2782575209115, 13.7778171291575], [121.185037877394, 31.2782517372565, 13.7554654972628], [121.185020856956, 31.2782341837653, 13.8146850410849]]}, {"OBJID": "1530087170", "MeshID": 20168943, "RoadID": "2019343813", "LaneID": "1371040805", "Color": 1, "geometry": [[121.185935651513, 31.2790974083424, 13.8105973331258], [121.185926257613, 31.2791040727476, 13.8120717359707], [121.185941475334, 31.2791201304078, 13.7441062116995], [121.185950171175, 31.2791143002419, 13.7430761102587], [121.185935651513, 31.2790974083424, 13.8105973331258]]}, {"OBJID": "1546486468", "MeshID": 20168940, "RoadID": "1964545428", "LaneID": "2510287490", "Color": 1, "geometry": [[121.170694227138, 31.2655082069703, 13.0192474639043], [121.170687241292, 31.2655158092151, 12.9993297783658], [121.170703370379, 31.2655316301029, 12.9848293904215], [121.170711383555, 31.2655245415233, 12.9999637845904], [121.170694227138, 31.2655082069703, 13.0192474639043]]}, {"OBJID": "1657094839", "MeshID": 20168943, "RoadID": "123759002", "LaneID": "1136182262", "Color": 1, "geometry": [[121.185349001416, 31.2785089426823, 13.8920342335477], [121.18535680791, 31.2785026184346, 13.9085393203422], [121.185338032799, 31.2784867584072, 13.8486037692055], [121.185331066245, 31.2784926379812, 13.8581982497126], [121.185349001416, 31.2785089426823, 13.8920342335477]]}, {"OBJID": "1688867351", "MeshID": 20168943, "RoadID": "1936837671", "LaneID": "1336206165", "Color": 1, "geometry": [[121.18513774729, 31.2783096803028, 13.8587018642575], [121.185145884368, 31.2783035528571, 13.8558668326586], [121.185128774894, 31.2782866832741, 13.7980925347656], [121.185121045773, 31.2782932370429, 13.7931635966524], [121.18513774729, 31.2783096803028, 13.8587018642575]]}, {"OBJID": "1696222070", "MeshID": 20168943, "RoadID": "123759002", "LaneID": "1136182262", "Color": 2, "geometry": [[121.185483551779, 31.2786360990872, 14.0092970337719], [121.185492532194, 31.2786277446633, 13.9885520767421], [121.185474669309, 31.2786105098798, 13.9241780843586], [121.185465819696, 31.278619379222, 13.9267657194287], [121.185483551779, 31.2786360990872, 14.0092970337719]]}, {"OBJID": "1821393815", "MeshID": 20168943, "RoadID": "2044301547", "LaneID": "288954737", "Color": 1, "geometry": [[121.184829337771, 31.2770409669282, 13.4261308908463], [121.184840063712, 31.2770407817737, 13.4281737878919], [121.184839497851, 31.2770196784649, 13.3782150484622], [121.184829171341, 31.2770198303333, 13.399265313521], [121.184829337771, 31.2770409669282, 13.4261308908463]]}, {"OBJID": "1839311011", "MeshID": 20168942, "RoadID": "1813720573", "LaneID": "3648354523", "Color": 2, "geometry": [[121.161483793822, 31.2823368686215, 13.321048213169], [121.161484150445, 31.2823519751604, 13.3467651689425], [121.161535692419, 31.2823526147272, 13.2159476373345], [121.16153559009, 31.2823372567583, 13.2378925029188], [121.161483793822, 31.2823368686215, 13.321048213169]]}, {"OBJID": "1880761569", "MeshID": 20168943, "RoadID": "1936837671", "LaneID": "1925952536", "Color": 1, "geometry": [[121.184891824318, 31.2780856326655, 13.7512585632503], [121.184882538741, 31.2780889978135, 13.7995692193508], [121.184894392575, 31.2781088893268, 13.7547058463097], [121.184903166659, 31.278105401331, 13.7167677301914], [121.184891824318, 31.2780856326655, 13.7512585632503]]}, {"OBJID": "1899100237", "MeshID": 20168943, "RoadID": "1438983979", "LaneID": "505251513", "Color": 1, "geometry": [[121.188743479963, 31.281707293704, 13.5279729543254], [121.188732431502, 31.2817190710588, 13.6128425933421], [121.18875115975, 31.2817353193447, 13.5843246998265], [121.188761662175, 31.2817244877524, 13.5499641522765], [121.188743479963, 31.281707293704, 13.5279729543254]]}]
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
lon,lat,alt
121.1578465478,31.2643719798,11.3581008582887
121.192698293791,31.2882167570137,33.0603790283203
{"max_node": {"lon": 121.192698293791, "lat": 31.2882167570137, "alt": 33.0603790283203}, "min_node": {"lon": 121.1578465478, "lat": 31.2643719798, "alt": 11.3581008582887}}
\ No newline at end of file
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment