Relative Content

Tag Archive for rgis

Error Creating Lingstring from Long Format Data in R

I am trying to create linestring objects from data that I converted from the wide format to long format but I keep getting this error “Error in UseMethod(“st_crs<-“) :
no applicable method for ‘st_crs<-‘ applied to an object of class “c(‘tbl_df’, ‘tbl’, ‘data.frame’)””. I don’t understand why I am getting this error when the input object is a dataframe. Any help would be greatly appreciated and thank you in advance for any help.

Issues with Closed Polygons: Loop is not valid

I’ve been encountering an issue while working with spatial data in R. Specifically, I’m getting an error when trying to calculate centroids for my geometries using the st_centroid function from the sf package. The error message is as follows:

How to Filter Shapefile Data

I’m currently working with a shapefile that does not contain explicit latitude and longitude coordinates. My goal is to filter out areas with latitudes above 60 degrees. I want to delete the small area in the lower right corner, but I don’t have the latitude and longitude. Can anyone suggest a code to achieve this?