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
3
votes
1answer
23 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? ...
0
votes
0answers
48 views

Using PostGIS operations

I'm new on PostGIS I have this The orange ones are buffers, the red dots are the centroids of each brown polygon So I've tried to cover the brown polygons by making buffers of the centroids (red dots)...
0
votes
0answers
29 views

Translate polygon using QGIS 3 [duplicate]

I would like to move a polygon's center to another location by specifying a latitude and longitude. I am using a EPSG:4326 - WGS 84 projection.
1
vote
2answers
49 views

Creating Hexagon from centroids of polygons using ArcMap

How do I create a hexagon from its centroids using ArcMap? I will show the image below. It is H3 resolution 9. This picture illustrate the centroid of the hexagon so I would like to know how to ...
3
votes
1answer
76 views

QGIS: Create point layer (centroids) with radius attribute from circle polygon layer

I have polygon layer which consists of many circles with different radius (see below) and I want to convert it to centroids and write new attribute into attribute table of centroids with value of ...
2
votes
4answers
113 views

Calculate distance from polygon feature centroid to coordinate in QGIS 3.18

I have a shapefile with a lot of polygon features in it. For each polygon, I want to calculate the distance from the centroid of each polygon to a certain coordinate. How can I achieve this using the ...
2
votes
2answers
134 views

R st_centroid GEOS error Unknown WKB type 12

I’m trying to calculate centroids of polygons of postcode areas (wfs shapefile), but I’m getting the following error message: Error in CPL_geos_op(“centroid”, x, numeric(0), integer(0), numeric(0), : ...
1
vote
2answers
42 views

QGIS distance between centroids from NUTS1 information

I have calculated the centroids from NUTS1 information. Now for every neighbor centroids, I would like to calculate the distance. I want to connect only the neighbor's Centroids regarding the NUTS1. I ...
2
votes
2answers
51 views

How do you create a point within a polygon that is the farthest from all edges of the polygon in ArcGIS Pro?

I am curious how one could create a centroid for an irregularly shaped polygon in ArcGIS Pro, that lies within that polygon's boundaries, with the concept of centroid in this case meaning a point ...
0
votes
1answer
62 views

Get image pixel centroids in Google Earth Engine

I would like to create a feature collection consisting of the centroid points of the pixels in an image. The question of how to do this has been asked before on Stack Exchange, but not actually ...
2
votes
1answer
70 views

Plotting data with centroids only

I am fairly new to spatial analysis and I am trying to create a map of the spatial distribution of pollution in the UK using publicly available data retrieved from https://uk-air.defra.gov.uk/data/pcm-...
1
vote
2answers
90 views

Calculating perpendicular distance from centroid of polygon to multiple lines in QGIS

In QGIS 3.10.4, I have two shapefiles (polyline and polygon, layer name 'boundaries', 'lines' respectively), look like below: My goal is to calculate the perpendicular distance from the centroid of ...
1
vote
1answer
45 views

Match centroids from one dataset with polygons of another

I want to make a data frame showing which voting precincts are in each school zone. To do this, I want to see which precincts' center points are in which school zones. library(sf) precincts <- ...
2
votes
1answer
56 views

Spatial Query for centroid of one feature falls within another

I am looking at doing a spatial query where I can find when the center of one feature falls within another. Both geometries are on different layers. For example, when the center (centroid) of an area (...
2
votes
0answers
60 views

Manually adding centroids to arrows in Virtual Layers in QGIS

Currently, I'm making a map that depicts the migration flows of people who have finished their university degrees and decide to move to a different Dutch city after their studies. By following Anita ...
1
vote
1answer
90 views

Why does the location of the mean of a set of points not coincide with the location of a point I created in QGIS?

So I've made a number points for a set of locations in the Netherlands. Here they are: The location of the purple point was computed by means of the “mean coordinate(s)” tool in QGIS. It represents ...
0
votes
1answer
32 views

Unable to get latitude and longitude of the US map from TopoJSON's us-atlas repository when using GeoPandas

To do some geospatial analysis I am using the USA counties map from topojson/us-atlas repository After loading the link https://cdn.jsdelivr.net/npm/us-atlas@3/counties-10m.json in geopandas I get the ...
1
vote
3answers
72 views

Drawing points in layer given its coordinates using PyQGIS [closed]

I want to draw points in a certain polygon layer. Specifically, I want to display the centroid over each respective feature. All this using PyQGIS. So far, none of the answers I found helped me. I am ...
0
votes
1answer
38 views

Find mean / median point based on ID attribute and point density (hot spots)

I have a point feature class within ArcGIS Pro, with 10.000 features, data are structured like this: ObjectID | MemberID | Lat | Long 1 ID_1 Y1 X1 2 ID_1 Y2 X2 3 ...
1
vote
0answers
24 views

Why does dropping a single point dramatically affect location of polygon centroid?

I'm a relative novice working with some coordinate data using shapely and have found a weird behavior when trying to identify outlier points. The approach I am using is to iterate over a series of ...
1
vote
1answer
55 views

Create feature collection of polygons' centroids in GEE

I am trying to determine the distance between province centroids and a polygon. Based on this past post, I was able to store the geographic coordinates of the province centroids into their feature ...
6
votes
1answer
235 views

How to ensure centroid is calculated within polygon?

I am working with a Search Cursor approach to calculate centroids within polygon features. You can see from the screenshot that the script calculates centroids within polygon features, however, some ...
0
votes
1answer
45 views

Centroid in British National Grid

I am trying to work out centroid of a polygon, but I need this in British National Grid. Does anyone know a way of getting it to work in QGIS 3.10?
4
votes
2answers
148 views

Creating Virtual layer that is the centroid of another polygon layer

There's a polygon layer building and I want to create a point layer centroid containing centroids of building layer. I have 2 more requests: to keep all attributes in the building layer in the newly-...
5
votes
1answer
720 views

Creating centroid inside of polygon [closed]

I want to get the centroids of my multipolygons using Python and GeoPandas. But when viewing the polygons and the centroids points on QGIS, the centroids are not inside the polygons. Here is the code ...
2
votes
1answer
396 views

Spatial join with GeoPandas with two geometry columns

I have one GeoDataFrame which contains two geometry fields - one is polygon and one is the polygon centroids. The table has also other fields. I have run spatial join between the gdf and another ...
2
votes
1answer
34 views

Distance from one city to others by a mutual ID

I don't understand spatial.data at all. I have been studying but I'm missing something. What I have: data.frame enterprises with the columns: id, parent_subsidiary, city_cod. What I need: the mean and ...
4
votes
2answers
458 views

Getting lat/long for centroids using QGIS

I have a series of polygons (lakes) in Kansas, Oklahoma and a few in Texas. I created centroids of each lake, which I need for distance measurements. These centroids have derived lat/long information ...
3
votes
1answer
198 views

How do I create centroids inside polygons in Python?

When creating centroids from polygons, ArcMap has an option to placing the centroids inside (within the bounds of) the polygons. I am attempting to create centroids in Python. I have tried: df['...
0
votes
1answer
38 views

Determining the centroid of the thickness calculation used in Zonal Geometry

I have a need to determine the coordinates at the centroid of the "deepest" point within an irregular polygon feature. I have done some researching and found that Zonal Geometry calculates ...
1
vote
1answer
26 views

Cut linestring segment at centroid in PostGIS

In a table of linestring three segments are connected. first--second--third could Postgis generate the centroid of second segment and merge first and third at center? Is it possible? first--...
0
votes
1answer
200 views

Get longitude and latitude from a shapefile with Leaflet in R

I've been trying to map with leaflet to add addCircles() but my shapefile doesn't seem to have the latitude lat and longitude lng parameters so I got the centroids for each city as is the code below ...
2
votes
1answer
92 views

Distance Matrix between centroids QGIS

I'm using QGIS and I would like to measure the distance between the centroid of King County in the US and the centroids of all other US counties. I have imported the shapefile and I have executed the "...
2
votes
1answer
267 views

Calculate irregular polygon center-point that falls within the polygon boundary

I have an SDE.ST_GEOMETRY polygon FC in an Oracle 18c/10.7.1 geodatabase. I can calculate the X and Y of the polygon centroids using the SDE.ST_GEOMETRY ST_Centroid function: sde.st_x(sde....
0
votes
0answers
52 views

Find centroid of a set of points [duplicate]

I have a set of points in 2 dimension plan : A(x1,y1), B(x2,y2), C(x3,y3) .... How can I know which point of these points (A,B,C, ...) is the centroid of the other points
3
votes
1answer
110 views

Creating ellipse with SatScan output using QGIS

I need to use QGIS to create an ellipse employing a SatScan output with information on spatial risk clusters for the occurrence of an. The output contains the coordinates of the centroid point of ...
1
vote
1answer
854 views

Finding the centroid of a merged polygon using shapely function

I have a polygon shapefile and I want to find the centroid of the polygon, and output the centroid as a new shapefile before I geocode. How I should do this with Python functions shapely and Fiona and ...
1
vote
1answer
54 views

Workaround for Mean Coordinates in graphical modeler

I am searching for a workaround to build mean coordinates in graphical modeler since I have noticed a bug which I have reported here: https://github.com/qgis/QGIS/issues/35385 Basically, I just need ...
0
votes
0answers
52 views

Find one centroid instead of multiple centroids?

I'm trying to find the centroid (center of mass) for several IUCN species range maps. Using the code below I've run into an issue in R. library(rgdal) library(rgeos) shp <- readOGR("/Documents/...
4
votes
1answer
46 views

Create centroids from point layer based on unique field names

I have a point layer in QGIS, which I want to filter by attribute values of a specific attribute column. For each unique attribute value, a centroid should be calculated from the respective features. ...
2
votes
1answer
116 views

Generate N polygon centroids based on attribute in QGIS

I have a number of polygons with an integer value in a field. I would like to create N number of centroid points for each polygon where N corresponds to the value in the polygon's field. So sort of ...
1
vote
0answers
259 views

Auto-generate Grid Reference for Point and Polygon features within existing Shapefile, QGIS

I have various point and polygon layers (shapefiles) which I use regularly in QGIS (3.6.3), and often need to work out their location as an 8 figure grid reference (British co-ordinates, EPSG-code ...
3
votes
1answer
245 views

Centroid of multiple polygons based on value in attribute table

I have a (polygon) shapefile with multiple zones. Now, I would like to calculate the centroid of groups of these zones. The zones have to be grouped based on a value in the attribute table: AreaNr ...
3
votes
0answers
106 views

Creating convex hull by expression by aggregating points

I would like to recieve the centroid of a convex hull of a group of points in a layer, grouped by its name. This needs to be done by expressions, available in QGIS 3.4. E.g. I have this list of points:...
8
votes
1answer
733 views

QGIS Point on Surface

As far as I can tell, the option to "Create point on surface for each part" in the QGIS Centroid tool is not returning the correct geometry when activated in QGIS (version 3.8.1-Zanzibar/GDAL v 2.2.3 ...
2
votes
1answer
408 views

Get midpoint of SDE.ST_GEOMETRY polylines?

I have a polyline SDE.ST_GEOMETRY feature class in an Oracle 12c geodatabase (10.7.1). I want to create a view on the feature class that has X and Y columns that contain the coordinates of the ...
0
votes
0answers
223 views

Getting polyline midpoint coordinates using ArcGIS REST API

I have an ArcGIS 10.7.1 feature service that integrates polyline GIS assets to a work order management system. In the work order management system, I want to retrieve the midpoint coordinates of the ...
1
vote
1answer
92 views

PostGIS - How to extract polygons in a rectangle by their centroid?

I'm new to PostGIS and I'm amazed what can be done with it! Currently I'm running a query from a large database where I need to split the extracts into smaller chunks so that I'm not bouncing at the ~...
2
votes
1answer
81 views

Speedup function to calculate distance from centroid of building to river segment in PostgreSQL

I am trying to measure the distance from the centroid of a building to a river segment using the following function. CREATE OR REPLACE FUNCTION river_foo_mapper () RETURNS trigger LANGUAGE plpgsql AS ...
1
vote
3answers
107 views

QGIS: Finding Centre of Dominant shape

I have shapes with attribute BLUE. I have shapes with attribute ORANGE. The attribute table has two entries - BLUE, ORANGE - even though there are more isolated shapes ( islands in fact). I wish to ...

1
2 3 4 5