r-spatialecology/landscapemetrics

Landscape metrics with polygon shapefiles or csv

Closed this issue · 4 comments

cpcnn commented

Dear all,

Thanks for the package, it's very useful and user friendly.
Is there a way to apply the metrics to polygon shapefiles or csv datasets?
I have tables (both shapefile and csv) regarding marine seascapes made by observations as rows and different features for columns such as year (6 levels), geographical location (3 levels) and bathymetric range (2 levels).
I always used Patch analyst toolbox in GIS but i would like to switch to R.
In Patch analyst i used to split my datasets according to a specific column level (e.g. bathymetric range) in order to have only two features (e.g. year and geographic. location) and perform class analysis.
How can i do with Your package?

Thanks for Your help.
Regards,
Luca.

Hey Luca,

Thanks for your question.

There is no way to apply the metrics to a polygon shapefile or a csv datasets.

However, converting the csv dataset into a raster first is very straightforward. You can have a look at the rasterFromXYZ() function from the raster package which allows to create a raster from a matrix. You can also find many other ways to convert a csv file into a raster in R on Googl (e.g. https://gis.stackexchange.com/questions/267507/convert-csv-to-raster-grid-in-r).

Once you converted everything into a raster, the package is able to calculate class level metrics for you.

Hope that helps.

cpcnn commented

Hi Maximilian,
thank you so much for your reply.
Actually i tried to convert shapes into rasters and then combine multiple rasters into one in order to analyze it with the package. Unfortunately i lose details and accuracy during these procedure but never mind, i will keep your features in my mind for the future.
If you are interested in implementing the package in order to use shapes or csv text me without any problem.
Lot of seascape data i work on are gained manually from rasters (without any spectral information human accuracy still better than computer) so that my first level data are shapes and then csv.
Whatever, thanks once again for your help!

Ciao,
Luca.

We actually thought about creating a package for vector data at some point and also started a little bit with it. But just don't have the time at the moment to dig deeper into that.

cpcnn commented

I can imagine!
Whatever, good job and good luck for the future, ciao!