[Qgis-user] visualize and export coordinates of centroids

Francesca Parente francescaparente.rse at gmail.com
Wed May 25 01:28:24 PDT 2022


That's great, thank you both and have a good day everyone!
Francesca

Il giorno mar 24 mag 2022 alle ore 17:04 C Hamilton <adenaculture at gmail.com>
ha scritto:

> 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
>>
>

-- 
----------------------------
Francesca Parente

_ SESS Euro PhD
<https://phd.uniroma1.it/web/FRANCESCA-PARENTE_nT1602922_IT.aspx> in
SocioEconomic and Statistical Studies
_ Luiss SEP <https://sep.luiss.it/> School of European Political Economy

email: francescaparente.rse at gmail.com
       parentef at luiss.it
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20220525/115c1c5b/attachment.htm>


More information about the Qgis-user mailing list