I'm trying to perform maximum likelihood classification of landsat imagery using R, I have been searching for a package that implements it but so far I haven't found it.

What is the easiest way to achieve this? I know package rasclass has some maximum likelihood classification method but what it receives as input is a format completely different than the one I have, as far as I can see.

Is there a package that allows me to do this, or a code snipped anyone could provide? I have been looking at rasclass' source code and thinking about modifying it to do receive the format I want as input, but I'm afraid it's a bit too complicated and I'll make a mistake somewhere.

  • Take a look at the mle function in stats4. I would say that R is not ideal for your application. Remote sensing software uses short-cuts to deal with dimensionality issues in maximum likelihood. There are numerous very good, free, remote sensing software's available. If you would like to use the rasclass package, it would be quite simple to get your data into an ArcGIS ascii (asc) format using R. This can be done using either the raster or rgdal packages by reading your current data and then writing it back out as the asc format. – Jeffrey Evans Apr 1 '15 at 16:08
  • Thank you for your answer. So would you say it's easy to convert a rasterstack and a shapefile to formats usable by rasclass? My issue is that I'm trying to compare MLC with other algorithms like random forest, so I'd like to do it all the same way, and not using RF in R and then MLC in qgis.. – jon_ Apr 1 '15 at 16:38
  • Yes, coercion into suitable classes would be quite straightforward. – Jeffrey Evans Apr 1 '15 at 19:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.