Applying shape files

135 views
Skip to first unread message

National Plant Phenomics Center

unread,
Oct 5, 2020, 9:27:25 AM10/5/20
to FIELDimageR: A R package to analyze orthomosaic images from field trials.
Thank you for the fantastic script!

I have run a image set through your script and go the results out, i also as a precaution saved the shapefile but I’ve now had a additional image to analyse.

Ive loaded the shapefile ShapeFile <- readOGR("Other_Software_ShapeFile.shp") but i couldnt work out how I apply the shapefile to the image,  can anyone help

fmatias

unread,
Oct 5, 2020, 9:06:19 PM10/5/20
to FIELDimageR: A R package to analyze orthomosaic images from field trials.
Hi there,

Well, I am not sure if I understood your question. But you did right loading back the shape file to R (new pic script):

library(raster)
library(FIELDimageR)
library(rgdal)
ShapeFile <- readOGR("Other_Software_ShapeFile.shp")
plot(ShapeFile)

However to overlayer the same shape file to two different pictures it is super important remember that these two pictures must have the same geographic position (GCPs) and the same rotation theta (fieldRotate function). If you follow those rules the Shapefile should work well. Then you can 1) rotate (fieldRotate), 2) remove the soil if is necessary (fieldMask), 3) calculate vegetation indices (fieldIndex), and 4) extract data (fieldInfo). You do not need to draw the shapefile again (fieldShape).
Is that make sense?

Please see more information in this tutorial:

Let me know if it works..!!!
All the best,
Filipe

National Plant Phenomics Center

unread,
Oct 7, 2020, 4:04:49 AM10/7/20
to FIELDimageR: A R package to analyze orthomosaic images from field trials.
Hi Filipe

Thank you for your response, the image is of the exact same field with GCP's flown with the same automated routine as the original. However, I think I have worked it out, you use the shapefile in the extraction of data like this?

EX1.Canopy<-fieldArea(mosaic = EX1.RemSoil$mask, fieldShape = Shapefile, n.core = 8)
EX1.Info<- fieldInfo(mosaic = EX1.Indices,fieldShape = Shapefile, n.core = 8)

If you have added in a data table, does this affect using a shapefile?

DataTable<-read.csv("DataTable.csv",header = T)  
fieldMap<-fieldMap(fieldPlot=DataTable$Plot, fieldColumn=DataTable$Block, fieldRow=DataTable$Row)


Jason

fmatias

unread,
Oct 7, 2020, 4:51:39 PM10/7/20
to FIELDimageR: A R package to analyze orthomosaic images from field trials.
Hi Jason,

I am sorry but I am not understanding your question. 
Could you share the print of what are you looking for (output)?

You can send a table of results or what is wrong with your output, maybe with images I can understand better. 
Sometimes people make drawings on powerpoint to show what they are looking for and to be easy to understand.

Best,
Filipe

Ricardo Zárate Sotelo

unread,
Mar 9, 2021, 5:31:20 PM3/9/21
to FIELDimageR: A R package to analyze orthomosaic images from field trials.
Hi Matias,

I have problems when I run this line of code and advise me this error:

source(system.file("extdata", "fieldRotate.R", package = "FIELDimageR"))
EX1.Rotated<-fieldRotate(mosaic = EX1.Crop, theta = 1.131, extentGIS=TRUE)

Error in source(system.file("extdata", "fieldRotate.R", package = "FIELDimageR")) : 
  cannot coerce type 'closure' to vector of type 'character'

How can I solve it?

Regards,

Ricardo

fmatias

unread,
Mar 9, 2021, 6:43:53 PM3/9/21
to FIELDimageR: A R package to analyze orthomosaic images from field trials.
Hi Ricardo,

Which version of FIELDimageR are you using?

This line only works from version 0.2.9.

Let me know if it solved.

Thank you,
Filipe

Ricardo Zárate Sotelo

unread,
Mar 9, 2021, 7:03:30 PM3/9/21
to FIELD...@googlegroups.com
Oh so I need to update my version, how can I do that?

Thanks for responding

Ricardo

--
You received this message because you are subscribed to a topic in the Google Groups "FIELDimageR: A R package to analyze orthomosaic images from field trials." group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/FIELDimageR/qwnTrRj04UE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to FIELDimageR...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/FIELDimageR/d30c4699-df09-4b14-a09b-d0d7f33d4dc5n%40googlegroups.com.

fmatias

unread,
Mar 10, 2021, 9:21:24 AM3/10/21
to FIELDimageR: A R package to analyze orthomosaic images from field trials.
Ricardo,

I believe that running this line of code below will works:

devtools::install_github("filipematias23/FIELDimageR")

If not, please try one of the suggestions in this link: https://github.com/OpenDroneMap/FIELDimageR#Instal

Best,
Filipe

Reply all
Reply to author
Forward
0 new messages