I have lat/longs of a particular area. How do I insert multiple lat/lons corresponding to a single area in CSV file? I am just using random numbers right now in my CSV file. I have attached a screenshot to show my CSV file. I don't want single latitude and longitude but multiple corresponding to a single area. I have to plot them later on map box
This is the code I am using to convert my csv file to geojson file
library(geojsonio)
library(rgdal)
file_to_geojson(input = "FINAL DATA ENTRY.csv",method ="web" )
geojson file when created gives coordinates as this. If you see red highlighted area in my geojson output file I converted from a csv file, What I want is geometry should be polygon or multipolygon and it should include 100 coordinates not single one. How do I provide those 100+ coordinates to csv file? Ill be more clear if someone is not able to understand me. Let me know. Ignore my bad English, please.
Added My csv file.
Try this:
Using the
sf
-package which allows to combine points of a group (such as a state) toMULTIPOINT
orPOLYGON
. In your file, some states only have one point so I just can convert it toMULTIPOINT
.And then save the sf-class as geojson.
You'll have to remove the other columns however. Because you have different information in them on each point you want to aggregate.
EDIT: In case you want to group by more columns: