Hi, Pascal. Thanks for your answer!
The code I'm using is:
entity Pixel {
property Cell cell
property Integer cover
}
datafacer LandCoverRaster {
data RasterFile ("data/Cover2019.tif","EPSG:3116")
match Pixel {
cover : "1"
}
}
let lcRaster = new LandCoverRaster
let landCover = lcRaster.readAllPixel
println("We have obtained "+landCover.size+" land cover pixels entities.")
And the error I got is:
java.lang.NullPointerException
at fr.ocelet.runtime.raster.ORaster.getRaster(ORaster.java:272)
at fr.ocelet.runtime.raster.ORaster.<init>(ORaster.java:153)
at fr.ocelet.datafacer.ocltypes.RasterFile.createGrid(RasterFile.java:368)
at fr.ocelet.model.riogrande.LandCoverRaster.readAllPixel(LandCoverRaster.java:19)
at fr.ocelet.model.riogrande.RioGrande.run_RioGrande(RioGrande.java:97)
at fr.ocelet.model.riogrande.RioGrande.main(RioGrande.java:32)
Exception in thread "main" java.lang.NullPointerException
at fr.ocelet.datafacer.ocltypes.RasterFile.createGrid(RasterFile.java:374)
at fr.ocelet.model.riogrande.LandCoverRaster.readAllPixel(LandCoverRaster.java:19)
at fr.ocelet.model.riogrande.RioGrande.run_RioGrande(RioGrande.java:97)
at fr.ocelet.model.riogrande.RioGrande.main(RioGrande.java:32)
I think the problem would be with the "cover" property. The image has 6 different colors where each one represents a land cover, and I was testing the code with one of them.
Thank you so much!