The ArcGIS Sort tool creates a new feature class with features sorted by geometry. For example, it can number features IDs from north to south, etc. Is there a way to renumber the cat field in a GRASS vector map based on geometry in a similar way?

1 Answer 1


In GRASS GIS, you can use v.reclass to achieve this goal. For each target category (ID) you can define a where statement to use attribute values to perform the job. See the manual for an example. Other tools like v.to.db help you to populate the attribute table properly for this task.

  • I had looked at v.reclass, but was holding out for something that didn't require me to put geometry in the attribute table beforehand. Guess I'll just bite the bullet, and maybe file an enhancement request later on.
    – dericke
    Dec 10, 2012 at 23:33
  • Is there a way to select only Y coordinates with v.to.db, or do I need to make a dummy column for the X and drop it later?
    – dericke
    Dec 10, 2012 at 23:47
  • The manual says: coor: point coordinates, X,Y or X,Y,Z, so you will need to drop the X column later.
    – markusN
    Dec 13, 2012 at 22:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.