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
0 votes
1 answer
9 views

How to find PLSS section corners, given the ring of nodes?

Given a ring of nodes and centroid representing a US Public Land Survey System (PLSS, or Canada DLS) section, find the four corner nodes. Do the same, but without needing the centroid.
Dan Jacobson's user avatar
4 votes
3 answers
137 views

Splitting polygons though centroid like Pizza Slices in QGIS

I am aware of how to create centroids and how to divide a polygon by line, but not how to create those lines from each centroid. I was wondering if anybody knows a technique/algorithm/plugin that ...
Alex_P's user avatar
  • 81
1 vote
1 answer
51 views

Drawn centroid with function make_circle

I'm using the following function to draw a circle at the centroid position of a layer of points grouped by the "ID" field and excluding NULL values: make_circle(centroid( concave_hull( ...
Acperience's user avatar
  • 1,050
1 vote
1 answer
60 views

Selection by Location with Have their center in - GeoPandas

I have two polygon GeoDataFrames. I have read them in with the following: import geopandas as gpd poly1_path = r”.\Input\poly1.shp” poly2_path = r”.\Input\poly2.shp” poly1 = gpd.read_file(poly1_path) ...
DaceK's user avatar
  • 13
0 votes
1 answer
68 views

Can I utilize vectorization to improve performance instead of iterating over QGIS Features?

I am using Python to write a standalone application with QGIS. The application uses requests to allow the user to update a shapefile from the internet on demand. After fetching the shapefile, I need ...
Zach Longhofer's user avatar
0 votes
0 answers
75 views

Export all polygons to SVG using QGIS

For a game, I needed to draw the districts of my city in QGIS. I created a layer and drew many polygons on it. I have now a table with four columns, being "fid", "name" and "...
Hemmelig's user avatar
  • 143
1 vote
1 answer
80 views

Multipolygon to Points

I'm currently mapping out around 10 layers worth of polygons all in a polygon feature as shown in the image below. I'm now trying to create a heatmap for each layer to show where lies the highest ...
Sheng-Ru Lai's user avatar
2 votes
1 answer
107 views

Centroid data points for US states

I need to map some data related to states in the USA. I have polygon data for each state but my dataset needs to be mapped by points. How do I find centroid points for each state (not polygons)?
Kerry Billington's user avatar
2 votes
1 answer
82 views

Creating centroid layer from selection using PyQGIS

I'm trying to create a centroid layer from a selection with Python. I manage to make a selection based on features with expression : code_com = '001' section = '\'0A\'' numero = '0502' layer = iface....
vince's user avatar
  • 21
1 vote
1 answer
45 views

mviewer/OpenLayers: Create proportional circles from the centroids of each polygon in a layer

I have created a mviewer map. This one is based on OpenLayers 7.1. I created a map from a point layer added as WFS from my GeoServer. This layer shows the population using proportional circles. The ...
GisUser's user avatar
  • 633
0 votes
2 answers
179 views

Convert centroid data to lat/long coordinates

I have a geoJSON file from Alameda County, California, that says it is based on "crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:...
Zachary Russell Heineman's user avatar
3 votes
2 answers
494 views

QGIS: centroid of polygon layer

I would like to determine the center of this layer, when I look for the centroid I get the centroid of each separate shape but I want the centroid of the total layer.
N_LLC's user avatar
  • 615
1 vote
0 answers
24 views

How to create a copy of a geodataframe switching polygons for centroids (points)? [duplicate]

I'd like to take an existing geopandas geodataframe (polygon) and create a copy, retaining all attributes of the first geodataframe but swapping out each feature's polygon geometry for its centroid. ...
auslander's user avatar
  • 1,497
3 votes
2 answers
116 views

Population weighted centroids imported into QGIS are located off the coastline

I am new to QGIS. Imported the census population weighted centroids shape file retrieved from NHGIS as a vector layer into QGIS and they are nearly always where I would expect them but a sprinkling of ...
ClaireR's user avatar
  • 31
0 votes
1 answer
260 views

Extract coordinates out of list() in R (bbox) and get centroid of bbox

I have a data.frame with a column called geo. In this column, there are lists with coordinates that represent a bounding box. I would like to grab the coordinates that are inside each list and ...
Daniel AG's user avatar
-1 votes
1 answer
92 views

How to make the grid polygons assume the inside centroid attributes of another layer QGIS

I have a square grid and I have multiple centroids on another layer. These centroids have many attributes as values. I want for each grid cell to assume the attributes of the centroids inside them. ...
John Silva's user avatar
0 votes
1 answer
324 views

GeoPandas - can't write to file because field names are tuples (AttributeError)

I have created a new shapefile by dissolving and computing centroids from an existing shapefile. I have also aggregated values of the existing shapefile to use in the new shapefile. However, when I ...
Maarten 's user avatar
0 votes
1 answer
626 views

GeoPandas centroids based on field, while keeping aggregated values

I have a shapefile containing 85.000 points representing houses. I want to create a new shapefile containing the centroid of each subset of houses with the same postal code. This centroids file should ...
Maarten 's user avatar
2 votes
1 answer
496 views

Spatial join based on polygon centroids in GeoPandas

I have two polygon shapefiles. I'd like to spatially join them in Geopandas based on their centroids. Basically doing the same thing as have_their_centers_in in ArcGIS but with GeoPandas. I see the ...
Nick C's user avatar
  • 37
0 votes
2 answers
666 views

QGIS distance in meter instead of decimal degrees

I use a shapefile of the US counties and I want to create buffer zones around the centroid of each county. However, the distance is measured in decimal degrees. As far as I understood, I have to ...
Julian H.'s user avatar
3 votes
0 answers
675 views

How to compute weighted mean centroid of lat+lon points taking into account spheroid

I have a bunch of points (lat+lon coordinates). Each one has a weight. I would like to get a weighted mean centroid of the points, taking into account the spheroid (as my points are scattered across ...
bill999's user avatar
  • 125
3 votes
1 answer
374 views

Creating/generating centroids point features from raster image in console in QGIS [duplicate]

I have a 1-band TIFF/raster file showing a value for each raster cell. I want to get those cell/pixel values of the TIFF extracted to a CSV file. I guess there are two ways of doing this. First, ...
Brigitte Colin's user avatar
0 votes
1 answer
140 views

Creating raster from centroids of another raster using QGIS/GDAL

I have a raster that is input into a model which generates outputs in a CSV format (Lon, Lat, Z value). The Lon and Lat are the centroids of the original raster's pixels. I want to use these centroids ...
Jake's user avatar
  • 11
4 votes
1 answer
1k views

Finding the centroid of every pixel in a raster Python

I am trying to get the centroid of every pixel in a aviris hyperspectral image (a raster) but my results are not quite as expected. The centroids don't seem to line up with the center of every pixel, ...
simplesyrup's user avatar
5 votes
2 answers
509 views

Ordering polygons from north to south in QGIS

In QGIS 3.10 I want to order 22 polygons north to south based on their position using their centroids. I have used the centroids tool to determine where their middle is. But now I'm not sure now how ...
anon's user avatar
  • 53
2 votes
3 answers
225 views

Plot points around defined centroid using degrees and distance in QGIS

I have a shapefile plot_center of plot centroid points (like picture below) and then I have a Excel table with trees which corresponds to plot centroid points by common field ID. The excel table ...
g123456k's user avatar
  • 608
0 votes
1 answer
244 views

QGIS rotate CRS around a new centre

I've been given some NetCDF data in a Mercator projection with a centre longitude of 173.9581, centre latitude of -41.0870 and rotation of 40 degrees. I have tried to create a new CRS based on ...
Seagus's user avatar
  • 231
1 vote
1 answer
744 views

Computing visual "center" of irregular polygon

UPDATE: centroid is fine, my initial implementation was not weighing the edge length. With that fix all is well. I am using the centroid to render a marker in the "center" of a parcel, but ...
ca0v's user avatar
  • 2,931
0 votes
1 answer
411 views

Rasterize a vector layer where pixels just need to include a vector inside, not necessarily on the center

QGIS(3.22) I'm trying to compare a vector layer to a raster layer by rasterizing the layer to the same pixel size as the raster and then using raster calculator. I just want to know which pixels in ...
Carter Dills's user avatar
3 votes
1 answer
198 views

Centre of mass w.r.t. a raster

I have a vector layer of polygons, and a raster layer with real numbers. I would like to get for each polygon, a 'centroid', not purely based on the geometry of the polygon (such as provided by Vector ...
mspices's user avatar
  • 155
3 votes
1 answer
149 views

Scaling polygons in vector grid around polygon centers in QGIS

I have a aerial image with a vector grid overlaid in QGIS. Is it possible to scale the individual polygons (scale all of them by the same size) around their individual centroids? For example, to cut ...
nburner's user avatar
  • 61
1 vote
1 answer
401 views

Create polygons around centroids, maintaining information

I have a csv file which contains points (latitude, longitude) around all the African continent (see the picture for clarification). Apart from the latitude and longitude, it contains more information. ...
OgeiD's user avatar
  • 534
1 vote
1 answer
1k views

Getting centroid of area and info in popup in Leaflet

I'm trying to get the centroids of each of the features of a polygon layer, and the popup with its info inside: but I'm not able to show those centroids. Something is wrong in my code, the variables ...
Vincent Dc's user avatar
1 vote
3 answers
1k views

Convert MultiLineString to one LineString

TLDR: I was not able to change the String type from MultiLineString to LineString and keep the line together but there is a way to still represent that as a symbology. So my problem is solved, but the ...
e-shirt's user avatar
  • 667
4 votes
1 answer
178 views

Creating centroid on curved surface in QGIS

I am using QGIS 3.16.13 to build a map in which I have 98 adjacent polygons that represent areas of ocean around the coastline of an island. I want to have a centroid inside of each polygon, even ...
Hafro530's user avatar
3 votes
1 answer
568 views

Generation of centroids outside polygon

I have a polygons layer and creating a centroid layer of it, some of them are generated outside my polygon, what cause a selection problem after. Does anyone know how to solve this?
J.Patordi's user avatar
  • 313
0 votes
1 answer
26 views

Getting minimum latitude of centroid geometries in a folder using ArcPy

My goal is to print names of feature classes and corresponding minimum latitude of centroids of geometry for all shapefiles in a folder. In total I have 5 shapefiles and I'm trying to loop through ...
puredata's user avatar
  • 491
5 votes
1 answer
490 views

Calculating raster weighted centroids for polygon in QGIS

I need to calculate centroids for each feature in a polygon layer, weighted by the values of a raster. So the centroids are shifted towards higher raster values. I found a way, but it is complicated. ...
BERA's user avatar
  • 71.2k
7 votes
1 answer
1k views

QGIS - how to use geometry generator to place a centroid in each segment of a multiline?

With geometry generator in QGIS I'm trying to place a marker in the midpoint of each segment of a multiline vector (I don't want to use the Highlight line option). My main issue is how to read each ...
Francesco Stefanini's user avatar
0 votes
0 answers
25 views

Storing the standard distance of a centroid alongside the centroid coordinates

I'd like to calculate and save a centroid (the central tendency) of a set of points as well as the standard distance (i.e. the root mean squared distance to the centroid). I can store the centroid as ...
Shawn's user avatar
  • 1,718
0 votes
1 answer
442 views

Calculating/obtaining a "centerpoint" inside a multipolygon entity with FME software?

Obviously, this point does not necessarily have to be the real centroid, but it does have to be a, only one, single interior point of each multipolygon. What I have found is the CenterPointReplacer ...
XSS's user avatar
  • 1
4 votes
1 answer
154 views

Filtering on centroid distance between layers in Rule based layer styling in QGIS

By using Rule based layer styling for a polygon shapefile I want to display only those features whose centroid is separated by 1.000m from the feature centroids of another polygon layer ('layerB'). ...
Hans Roelofsen's user avatar
1 vote
1 answer
500 views

Extracting centroids from property of polygons

I have been using a function to get the centroid of each polygon (building) in my dataset. var buildings = ee.FeatureCollection('GOOGLE/Research/open-buildings/v1/polygons') Map.addLayer(buildings, {...
Emma's user avatar
  • 61
0 votes
1 answer
64 views

Drawing routes combining a geographic dataset and a dataset containing routes in R

I want to draw migration routes on a map in R. The basic idea is that I have a dataset containing 3 municipalities inside Mexico through which an individual has passed. I want to draw a line ...
jpugliese's user avatar
  • 103
1 vote
2 answers
620 views

Preserving IDs when using gCentroid to find centroids of multiple polygons in R

This seems like it should be simple. I have multiple polygons contained in one shapefile, and I am using the gCentroid() function from rgeos to create a bunch of centroid points. The function has an ...
seak23's user avatar
  • 169
1 vote
2 answers
267 views

Create a database of the world divided into .25km squares

I would like to build a database of GPS coordinates spaced out .25km over all of the land in the entire world. It's a discovery project for a client that wants to perform visualization and I'm not a (...
DKinnison's user avatar
  • 121
0 votes
0 answers
774 views

Finding centroid of features within polygon using ArcGIS Pro

I have some polygon features and within those polygons are some coordinates for some other features. How do I find the centroid of those coordinate points within the polygon (NOT the geometric ...
GeekSpidey's user avatar
1 vote
3 answers
3k views

Google Earth Engine: How to obtain coordinates of centroids of polygons of a FeatureCollection

I need to obtain coordinates (longitude, latitude) of the centroids of a FeatureCollection of polygons in Google Earth Engine. I would like to download the coordinates if possible. I am new to GEE and ...
Dan B's user avatar
  • 11
4 votes
1 answer
2k views

Splitting concave polygons into convex polygons in QGIS

I want to optimize and decompose several concave polygon into convex ones but not too small or to complicated ones.Ideally cutting in places that would minimize the creation of convex polygons and in ...
Stephanie Maalouf's user avatar
3 votes
1 answer
575 views

GEE Download data around buffers on multiplie points, adding coordinates of each point to table

I want to download a time series of the average pixel value of a buffer around a number of points. In the resulting table, I'd like to have the coordinates of each point as a variable. How to do this? ...
Raimundo's user avatar
  • 657

1
2 3 4 5 6