You do not have any ID column for each class in the original shapefiles, so there is no information to maintain. You should add an ID column, and edit this column such that it contains either text or a number to indicate the class. (There's no need for two separate shapefiles: just one with a column containing the ID.)

You can do this either in the other software, or directly in GRASS.


If you want to accomplish this in GRASS with the existing point layers, then:

  1. Add a column for the class_id to both using:
    • v.db.addcolumn <bare map> column="class_id INTEGER"
    • v.db.addcolumn <woody map> column="class_id INTEGER"
  2. Update this column for both: 
    • v.db.update <bare map> column="class_id" value=0  # for the bare
    • v.db.update <woody map> column=class_id value=1 # for the woody points
  3. Now merge:
    • v.patch -e input="woody,bare" output=training
On 18/02/2022 00:00, Daniel Jeffrey Kozar via grass-user wrote:
Hi everyone, 

I am generating a workflow for object-based image classification of drone imagery and am getting tripped up when utilizing vectors for training data. I have ".shp" files for each class created in another software and am trying to join them to create one vector file with an ID column corresponding to the class. I have been trying to use the command v.patch, which does join them, but doesn't seem to allow for maintaining information about the class. Does anyone have any recommendations to do this? Any help would be greatly appreciated. Ive attached two example ".shp" files for reference. 


Best, 
Daniel



_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user
-- 
Micha Silver
Ben Gurion Univ.
Sde Boker, Remote Sensing Lab
cell: +972-523-665918

_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Reply via email to