Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.

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.

Filter by
Sorted by
Tagged with
33
votes
8answers
59k 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 ...
37
votes
1answer
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 ...
10
votes
0answers
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 ...
44
votes
11answers
96k 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 ...
8
votes
1answer
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 ...
7
votes
3answers
679 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 ...
9
votes
3answers
9k 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. ...
27
votes
2answers
72k 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 ...
11
votes
2answers
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 ...
9
votes
1answer
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 ...
3
votes
1answer
531 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 ...
0
votes
1answer
451 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 ...
7
votes
2answers
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 ...
11
votes
2answers
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 ...
7
votes
1answer
382 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 ...
4
votes
0answers
948 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) # ...
13
votes
2answers
3k 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 ...
7
votes
3answers
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 ...
4
votes
1answer
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....
4
votes
1answer
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?
2
votes
2answers
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?
2
votes
1answer
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 ...
8
votes
1answer
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 ...
4
votes
2answers
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 ...
3
votes
2answers
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 ...
1
vote
2answers
648 views

Centroids in QGIS 3.0 not using Python? [duplicate]

How do you calculate centroids in QGIS 3.0? In previous versions, there was an easily accessible tool in the vector geometry toolbar, but it is gone. I've seen ways to do it with Python on Stack ...
1
vote
1answer
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. ...
0
votes
2answers
313 views

Calculating Centroids with Zonal Geometry in ArcGIS

I have a shapefile containing polygons. Each polygon is defined by its postal code. I want to calculate the centroid of each polygon using Zonal Geometry. Sadly, for some polygons there are no ...