Closed brittanikedge closed 4 months ago
@tmieno2 I was thinking about this problem last night. Any thoughts? We wouldn't need another package as st_write enables .geojson extension. I imagine that .shp should be the default since that is the most common use case.
I think it is fine to have st_write to have geojson option as well, but with shp the default obviously as you suggested.
Okay, then I will put that on my list of things to implement today. It's quick, so it might be the first item.
@tmieno2 Did you test writing the files from that example? I am getting an error when I write to shapefile because of the linestring that was in the original boundary and now is in the trial design.
There is no error with the geojson driver, only shapefile.
I finished the edits to the write_trial_files(). I had to make modifications to the code because geojson doesn't support the append argument in st_write. Instead, I had to use unlink() instead to delete a previously created file. Let me know if there is another method you would prefer.
I tested this with other examples and had no errors for geojson or shapefiles. I pushed the edits and opened a new issue for the other problem.
DIFM website database uses geojsons
Two options: 1) We add an option to write_trial_files to handle allow saving as geojson and 2) I save them as geojsons within the R script for the website.