I have a large geojson file with the following general structure:
{
"features": [{
"geometry": {
"coordinates": [
[
[-12.345, 26.006],
[-78.56, 24.944],
[-76.44, 24.99],
[-76.456, 26.567],
[-78.345, 26.23456]
]
],
"type": "Polygon"
},
"id": "Some_ID_01",
"properties": {
"parameters": "elevation"
},
"type": "Feature"
},
{
"geometry": {
"coordinates": [
[
[139.345, 39.2345],
[139.23456, 37.3465],
[141.678, 37.7896],
[141.2345, 39.6543],
[139.7856, 39.2345]
]
],
"type": "Polygon"
},
"id": "Some_OtherID_01",
"properties": {
"parameters": "elevation"
},
"type": "Feature"
}, {
"geometry": {
"coordinates": [
[
[143.8796, -30.243],
[143.456, -32.764],
[145.3452, -32.76],
[145.134, -30.87],
[143.123, -30.765]
]
],
"type": "Polygon"
},
"id": "Some_ID_02",
"properties": {
"parameters": "elevation"
},
"type": "Feature"
}
],
"type": "FeatureCollection"
}
I'm trying to remove duplicate ID, and keep the newest version (ie. Some_ID_01 and Some_ID_02 are considered duplicates for my purposes and I would like to keep Some_ID_02). The contents of these "duplicates" are not in any kind of order (though it would be great if I could order them in the process, probably alphabetically), nor do these duplicates necessarily contain the same coordinates value (they are newer versions of the same point)
So far I have read a couple of remove duplicate json entries (tried modifying the code from this guide here in particular), but I don't know enough JS to modify it to my particular needs. I am reading the underscore.js to see if that would help (based on suggestions in other threads) and also going to look into python or excel (as a CSV file) to see if any of those simplify.
Would it be possible to feed in the geojson in to the program and get a file in return (even if it's a text file) or would it be simpler to feed it inline?