Questions tagged [centroids]

In geometry, the centroid, geometric center, or barycenter of a plane figure or two-dimensional shape X is the intersection of all straight lines that divide X into two parts of equal moment about the line. Informally, it is the "average" (arithmetic mean) of all points of X. The definition extends to any object X in n-dimensional space: its centroid is the intersection of all hyperplanes that divide X into two parts of equal moment.

28 questions
Filter by
Sorted by
Tagged with
57k views

How to determine the centroid of polygons?

I have a polygon vector and I want to quickly attain the centroid of this polygon for insertion in a text document. I am working with QGIS. I searched through other questions and although some are ...
34k views

Finding center of geometry of object?

Given a set of 2D or 3D points: How to find the center of geometry of an object? According to the following figure, the center of geometry differs from the center of mass if it is calculated in the ...
39k views

How to add Lat/long columns to a point layer which is not in WGS84? [duplicate]

I need to extract the Lat/long coordinates of the centroids of districts. My QGIS project SCR and the different layers have all been set on "WGS 84 / UTM zone 18N". I've created the centroids using ...
95k views

Obtaining up-to-date list of US ZIP Codes with Latitude and Longitude Geocodes? [closed]

NOTE: This began as a question on Stack Overflow, which has subsequently been closed. I also noticed a similar question about Most Up-To-Date Source for US Zip Code Boundaries, but I believe this ...
10k views

Calculating Centroid of all lands of Earth using SQL Server Spatial?

I want to find the center point of all lands of the earth. What I have tried up to now is downloading shapefile of all countries and polar parts of the earth. Then I imported that shapefile into a ...
531 views

Creating centerline of river in QGIS? [duplicate]

I made two river bank lines and I want to associate them. I want to make a centerline using two rows as a base. I managed to make the centre line with a lot of work creating several lines from one ...
8k views

Using Field Calculator in QGIS to update columns with centroid coordinates

In QGIS I would like to update two columns with the centroid easting and northing of my polygons. I am using the field calculator. I have tried using \$x and \$y but this only seems to work for points. ...
71k views

find the centroid of a cluster of points

While searching the web, solutions for finding centroids of polygons come up rather often. What I'm interested in is finding a centroid of a cluster of points. A weighted mean of sorts. I would ...
6k views

Calculating a spherical polygon centroid

I'd like a general way to calculate centroids for polygons on a sphere. So far, the best online reference appears to be: Tools for Graphics and Shapes by Jeff Jenness. The method described there ...
5k views

calculate {minimal} distance between polygons in R

I have calculated the surface area of species distributions (merging polygons from shapefiles), but since this area can be comprised of quite distanced polygons, I would like to calculate some measure ...
490 views

Real centroid plugin QGIS3

I am looking to use realcentroid where I'm assuming it puts all points within the polygons rather than the tool in QGIS Vector -> geom -> centroid tool, which in my result some bendier polygons have ...
435 views

Calculating centroids in decimal degrees using ArcPy without reprojecting vector data?

I have vector data not in geographical coordinate system (i.e. not in WGS 1984). How to calculate object's centroids using arcpy without reprojecting the data itself? I have tried to do this but it ...
5k views

How do I calculate a weighted centroid with respect to a raster, e.g. population weighted centroid

In ArcGIS 10.0, how do I calculate the weighted centroid of a collection of polygons, where I want the weight to be a raster layer. In particular I am using a raster of population counts and would ...
5k views

How does ArcGIS Desktop calculate INSIDE point for Feature to Point?

Let me back up and say that from what I understand there are two common ways to calculate the centroid of a polygon in ArcGIS Desktop: Using Calculate Geometry on fields within the attribute table of ...
381 views

Connecting centroids of lines sharing same intersection in QGIS?

I have this street network of the center of Turin (IT), composed by lines representing streets, and black points representing intersections. I have computed the centroids of each line and displayed ...
892 views

Shapely polygons crossing the antimeridian

Sample data Consider the following WKT Polygon, crossing the international dateline (antimeridian): POLYGON((176 49,-65 49,-65 11,176 11,176 49)) And the following points: POINT(-140 32) # ...
2k views

Centroid coordinates for odd-shaped polygons

I have a problem in computing the centroids of certain polygons in QGIS (via the geometry tools): for certain polygons - with a strange and rather long shape - the centroids computed are off the ...
2k views

How to place multiple symbols on one polygon centroid?

I am using QGIS for visualizing the health conditions of elderly living in an old age home, some of the elderly have multiple medical device with them and I want to show them on the map. Suppose I ...
2k views

How to use the field calculator's centroid() Geometry function in qgis 2.0?

There is an option in the field calculator for centroids under geometry which when you double click gives you "centroid( ". What information is required here in order to use this function?
3k views

How do I get the centroid of line with OGR

Can somebody explain how to get the centroid of a feature with ogr? I have no idea what the centroid() function itself does. >>> linelyr = lineshp.GetLayer() >>> f = linelyr....
6k views

Is it possible to extract Coordinates of Polygon Centroid in QGIS?

I have created polygon centroids using one of the "Geometry Tools" but I would like to extract the actual coordinates into Excel for further work. Is this possible?
1k views

Calculate The Minimum Distance from Polygon Centroid to Edge

I am looking to calculate the minimum distance from the Center of a polygon (A crescent shaped polygon would have a center inside the polygon) to its edge. I have parcel data and I am trying to ...
2k views

How to create point labels from midpoints of road polylines in QGIS?

I have a road polyline layer (singlepart ie has several features per road, grouped by an id field), and i want to (after merging the parts) find the mid point of the resulting lines. This is for roads ...
2k views

How to get mean coordinates of features from a point layer?

I have a vector layer containing several points and I would like to generate the mean coordinates of these points, using QGIS only if possible. I'm looking for something similar to centroids, but for ...
3k views

Finding coordinates of raster centroid? [duplicate]

How do I find the coordinates of the centre / centroid of a raster? I have tried Zonal Geometry but this does not give me the coordinates. I need to find the centroids of two rasters and create ...
2k views

Obtaining Centroid from Polygon in SQL Server 2008 R2

I have several spatial layers created in QGIS that are held as spatial data in SQL Server 2008 R2. What I want to do is to find the centroid (OS Easting and Northing) of the polygon from the geometry. ...