[Qgis-user] Coordinate Min Max of a feature within a Polygon

Neil B osgeo+qgis at benneb.ca
Wed Dec 4 00:37:04 PST 2013


Hi,

A bit late on the reply, but this solution had solved the task. Thank-you
Micha.

One change was required for the ALTER TABLE statements. No comma needed
after the table name.

Cheers!

~Neil B.


On Thu, Nov 28, 2013 at 12:16 PM, Micha Silver <micha at arava.co.il> wrote:

>  If you bring your shapefile into a Spatialite DB, you can use the
> MbrMinX(), MbrMaxX(), etc functions to find the min and max X and Y
> coordinates of the feature's bounding box.
> For example, if you have a Spatialite table called 'polys', you would do:
>
> ALTER TABLE polys, ADD COLUMN minx DOUBLE PRECISION;
> ALTER TABLE polys, ADD COLUMN miny DOUBLE PRECISION;
> ALTER TABLE polys, ADD COLUMN maxx DOUBLE PRECISION;
> ALTER TABLE polys, ADD COLUMN maxy DOUBLE PRECISION;
>
> UPDATE polys SET minx = MbrMinX(geometry);
> UPDATE polys SET maxx = MbrMaxX(geometry);
> etc...
>
>
>
> On 11/28/2013 06:13 PM, Neil B wrote:
>
> Hi,
>
>  I am trying to find a way to populate an attribute table with the
> min/max XYs of individual features within a shapefile (polyline or polygon).
>
>  Is there a way to do this in the base QGIS application or with an
> available plugin?
>
>  Unfortunately I have not been successful in any searches on the internet.
>
>  Using QGIS v2.0.1 (both the linux and windows installer versions)
>
>  Thanks!
>
> This mail was received via Mail-SeCure System.
>
>
> _______________________________________________
> Qgis-user mailing listQgis-user at lists.osgeo.orghttp://lists.osgeo.org/mailman/listinfo/qgis-user
> This mail was received via Mail-SeCure System.
>
>
>
>
>
> --
> Micha Silver
> GIS Consultant, Arava Development Co.http://www.surfaces.co.il
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20131204/66c20476/attachment.html>


More information about the Qgis-user mailing list