1

I want to perform some machine learning classification of images using R. I'm having issues finding out how to export my training data from ArcGis into R and I'm looking for some help. Currently I do not have access to ArcGis but I will provide visual examples of what I am trying to achieve.

I have an image (with multiple landsat layers) and some points already classified, as the following image shows.

I want to select polygons around that image that I know are the same class as the points, like in the following image:

enter image description here

And then I want to export these classes as training data for R, so I can classify the rest of the image. How can I achieve this? I've been searching in the gis stackexchange site and I found a similar answer (in this case for random forest classification) in https://gis.stackexchange.com/a/39103/48810, my issue is regarding the part

# READ POINT SHAPEFILE TRAINING DATA
sdata <- readOGR(dsn=getwd() layer="inshape")

where only one shapefile is read? I have also found another answer in https://gis.stackexchange.com/a/26916/48810 where multiple shapefiles are apparently exported, but I don't know if it's possible to import multiple shapefiles into R. So I'm asking for help on the proper way to do this kind of export and classification using ArcGis and R.

The arcGis version I will be using is the 10.2.2 one, in case it matters. If necessary I will provide additional information.

  • 1
    Point data rather than polygon data are typically used as training data in machine learning algorithms such as randomForests. If you have multiple training datasets, why not merge them prior to importing into R? – Aaron Mar 12 '15 at 18:48
  • Thank you for your reply. Could you please provide an example of such merging? Or point me to where I can do that in ArcGis? – jon_ Mar 12 '15 at 18:58
  • Using the Merge (Data Management) tool in ArcGIS will accomplish what you want: resources.arcgis.com/en/help/main/10.2/index.html#//…. You can accomplish the merge in QGIS too: igismap.com/merge-two-shapefile-qgis. – Aaron Mar 12 '15 at 19:03
  • Thank you, this seems to be what I was looking for. I will confirm it as soon as I have access to ArcGis. Thank you for your time. – jon_ Mar 12 '15 at 19:17

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.