[Qgis-user] visualize and export coordinates of centroids

C Hamilton adenaculture at gmail.com
Tue May 24 08:04:38 PDT 2022


Once you have your centroids you can use the Lat Lon Tools plugin and run
the "Point Layer to Fields" algorithm to extract the geometry and add it to
one or two attribute fields. You can also specify the CRS that you want it
in and what format (ie. decimal degrees, DMS and a lot of other formats)
you want it in.

Best wishes,

Calvin

On Tue, May 24, 2022 at 2:53 PM Thayer Young via Qgis-user <
qgis-user at lists.osgeo.org> wrote:

> Hi Francesca,
>
> Assuming that your layer has a geographic coordinate system like 4326. And
> you have found your centroids already:
> Use the field calculator to add a new or virtual field with a numeric data
> type, e.g. double, and name it something like "lat". Then in the expression
> area enter the expression: $y
> and press OK. Do the same for "lon" and the expression will be: $x
>
> If you want to find the centroid of a polygon and its latitude in one step
> your expression would be: y(centroid($geometry))
> For longitude it would be: x(centroid($geometry))
>
> Note that different methods will give you different coordinates for your
> centroid. So you may need to use a spatial join to do your match.
>
> -Thayer
>
>
> On Tuesday, May 24, 2022, 06:22:46 AM EDT,
> qgis-user-request at lists.osgeo.org <qgis-user-request at lists.osgeo.org>
> wrote:
>
> ----------------------------------------------------------------------
> Date: Tue, 24 May 2022 09:52:26 +0200
> From: Francesca Parente <francescaparente.rse at gmail.com>
> To: QGIS User List <qgis-user at lists.osgeo.org>
> Subject: [Qgis-user] visualize and export coordinates of centroids
> Message-ID:
>     <CAA8dZSc04zGiUy5JZhEARj0+ddP1L8z_abcSdXpRS5CYi6oieg at mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> Hello group,
>
> I would like to ask you what is in your opinion the best way to identify
> the lat-lon attributes of derived centroids in order to export them to an
> extra-QGis database where corresponding coordinates should match with
> identified locations.
>
> So far I've tried with Geocoding and MMQGIS plugins, but the resulting
> attributes table doesn't inlcude the coordinates of geocoded points.
>
> Thanks a lot for any advice!
> Francesca
>
> --
> ----------------------------
> Francesca Parente
>
> _______________________________________________
> Qgis-user mailing list
> Qgis-user at lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20220524/47898730/attachment.htm>


More information about the Qgis-user mailing list