07-03-2018 12:30 AM
I have feature of type area containing a field that should calculate the area of each polygon,
I used "Vector > Update > Update Attributes" and r.click on the area field and choosed area.
But when drawing a new polygon its area is not calculated automatically, Is there a way to automatically assign a field to calculate area whenever a new polygon is drawn?
07-03-2018 06:32 PM
You can use Funtional Attributes ie AREA(Input.Geometry,ProjectedMeas,Meter) or Analyse Geometry commands to compute Area dynamically but to then insert value into column you still need to use Vector > Update > Update Attributes by selecting that query and the associated area attribute to update.
If you want it dynamically computed as you digitize , you could use a database Trigger if the database supports spatial Area function.
For example, I use a SQL Server Spatial database as my warehouse. GeoMedia requires you have insert and update triggers.
I have an area feature Property_Address with a primary key of ID1 and an area attribute area_m i want populated
I simply modified the Geomedia Insert Trigger by adding the following line.
update Property_Address set area_m = Geometry_SPA.STArea() where id1 = (SELECT ID1 FROM inserted)
Now when i digitise the area_m attribute is populated automatically