grids_as_csv = {
const geojson = grids_100m;
const csvRows = [];
turf.featureEach(geojson, (feature) => {
const geometry = feature.geometry;
const properties = feature.properties;
if (geometry.type === "Point") {
const coordinates = geometry.coordinates;
const long = coordinates[0];
const lat = coordinates[1];
const row = {
...properties,
lat,
long
};
csvRows.push(row);
} else {
console.warn("Skipping non-Point feature:", feature);
}
});
return csvRows;
}