Timeline for Convert dataframe with polygon geometry variable into SF object
Current License: CC BY-SA 4.0
7 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Sep 5, 2022 at 19:12 | vote | accept | user157564 | ||
Sep 5, 2022 at 8:21 | answer | added | Spacedman | timeline score: 1 | |
Sep 4, 2022 at 22:32 | comment | added | user157564 | I tried to download the geoJSON and convert it to an ESRI shapefile online. This yields an object that looks a lot more like what I have in mind. But I cannot implement any sf commands over it. I can plot it using plot( ) but I need to be able to do more with it than that. Any suggestions? | |
Sep 4, 2022 at 21:22 | comment | added | user157564 | Thank you. I want to make sure I understand your suggestion fully. You are recommending that I download the dataframe that I obtain through the API, then do something to it to make it more readable in, say, Excel, then try reading it again in R? If that's the case, do you have any sources on how to make a "full geo JSON"? | |
Sep 4, 2022 at 21:16 | comment | added | Spacedman |
The data appears to be a mix of 2-d "POLYGON" objects and 3-d "POLYGON Z" objects, which sf doesn't like and throws an error. This is also a problem with the downloaded geoJSON objects of the whole data set, like: 149613070.v2.pressablecdn.com/coordinates/…
|
|
Sep 4, 2022 at 21:08 | comment | added | Spacedman |
The JSON returned is almost a geoJSON file. It's mentioned in the docs: "The data comes down from these as a list of features, though not a full geoJSON. This should still be useful in any web application. " with a template of how to make a full geoJSON from it. That would be the best way to do this. Download the API response and make a correct geoJSON file, then read that with st_read .
|
|
Sep 4, 2022 at 20:01 | history | asked | user157564 | CC BY-SA 4.0 |