[Qgis-user] Measuring area

Spencer Gardner spgardner at HNTB.com
Wed May 18 19:01:45 PDT 2011


I'm developing a Python plugin for which I need to measure the area (in acres) of every selected feature. I'm having no problem iterating through the selected features and it appears that I can use QgsDistanceArea.measurePolygon for the area measurement. I assume that the measurement is passed in the data layer's own units, so if my underlying shapefile is in feet I receive an area in square feet.

My questions:
     1 - Am I correct to assume the data are passed in the source layer's units?
     2 - Since I need this measurement in acres regardless of the source layer's unit of measure, does the API provide me an easy way to do this conversion, or will I need to read the source layer's units and then provide for all possible conversion ratios myself?

I'm handy with Python but by no means an expert so I appreciate your help.

Thanks,
Spencer Gardner
This e-mail and any files transmitted with it are confidential 
and are intended solely for the use of the individual or entity 
to whom they are addressed. 

If you are NOT the intended recipient or the person responsible for 
delivering the e-mail to the intended recipient, 
be advised that you have received this e-mail in error and that any use, 
dissemination, forwarding, printing or copying this e-mail is strictly prohibited.




More information about the Qgis-user mailing list