When i draw rectangle / polygons, a “geometry” layer is created. The default attributes in this vector file are “geometry” and “style_css”. How do i add new fields to it, for example a “name” attribute and display the name as a label on the viewer?
I prefer to modify the snap-desktop code to add this attribute, would like to know which function(s) to modify… Otherwise a manual method can do as well… I attempted loading a csv file with the attributes I need, but i realized I can’t modify it through the rectangle / polygon drawing tools.
what you see here is not an attribute table in a classic GIS sense
Vectors are stored as a WKT in SNAP: https://en.wikipedia.org/wiki/Well-known_text
This format usually only stores the geometry itself, but not attributes attached to it.
Thanks for the reply!
I’m trying to label the rectangles/polygons like how I can do so for the Pins.
Any idea how it can be done? Or do i need to write a plugin to do that?
I can’t think of any. SNAP is primarily designed for image analysis. Its GIS features are limited.
What I needed was already available in parts in different function (eg attribute table with label for Pins / GCP), I just needed to combine it with the rectangle/polygon drawing somehow, say via a plugin or modifying the source code. So wondering which is a better option