I would like to format the geojson into a specific format. As you can see from the sample csv, Alcona is a polygon that is composed of the 3 points. Is there a way to output Alcona as 1 polygon? Currently its only outputting as 3 points. Thanks in advance!
Gar
This is a sample of the csv:
LABEL,Longitude,Latitude
Alcona,-83.31528,44.59827
Alcona,-83.3164,44.59826
Alcona,-83.31735,44.59826
Hi Tom,
Thanks for the code.
I would like to format the geojson into a specific format. As you can see from the sample csv, Alcona is a polygon that is composed of the 3 points. Is there a way to output Alcona as 1 polygon? Currently its only outputting as 3 points. Thanks in advance!
This is a sample of the csv: LABEL,Longitude,Latitude Alcona,-83.31528,44.59827 Alcona,-83.3164,44.59826 Alcona,-83.31735,44.59826
This is what its outputting: { "type": "FeatureCollection", "features": [ { "type": "Feature", "properties": { "LABEL": "Alcona", "Longitude": "-83.31528", "Latitude": "44.59827" }, "geometry": { "type": "Point", "coordinates": [ -83.31528, 44.59827 ] } }, { "type": "Feature", "properties": { "LABEL": "Alcona", "Longitude": "-83.3164", "Latitude": "44.59826" }, "geometry": { "type": "Point", "coordinates": [ -83.3164, 44.59826 ] } }, { "type": "Feature", "properties": { "LABEL": "Alcona", "Longitude": "-83.31735", "Latitude": "44.59826" }, "geometry": { "type": "Point", "coordinates": [ -83.31735, 44.59826 ] } } ] }
This is how I'd like the geojson to look like: { "type": "FeatureCollection", "features": [ { "type": "Feature", "properties": { "LABEL": "Alcona"
}, "geometry": { "type": "Polygon", "coordinates": [[[-83.31528,44.59827],[-83.3164,44.59826],[-83.31735,44.59826]]] } } ] }