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
1
vote
3answers
58 views

Finding coordinates of centroids?

I have a few thousands of polygons, which I found the centroid for each one of them. Now I want to find the coordinates of each centroid. But for some reason the x and y columns are empty and I don't ...
2
votes
0answers
15 views

Real Centroids plugin QGis 3.4.4 Inavlid Geometry?

The plugin gives on a specific feature the following error message: "Invalid or empty geometries found". Is the following topology not supported?
1
vote
1answer
25 views

Spatial Join Polygon to Polygon with Centroids Inside features

I have a parcel feature class with +5M features. I want to spatially join it to a feature class of regions to check if the regional code matches that in the parcel data. I've tried using "have their ...
3
votes
1answer
61 views

Making path between polygon using QGIS?

I am trying to draw a line (vector layer) of a certain length that that tries as much as possible to dodge the green polygons. Assuming a starting point, is there some sort of line centroid ...
1
vote
1answer
45 views

Combining st_snaptogrid with st_centroid and group by using PostGIS?

I have a table of devices, each of them has a field 'location' that is a postGis geometry(Point,4326) I need to operate a GROUP BY based of the placement on a grid, I'd use ST_SnapToGrid and then I ...
3
votes
1answer
58 views

Displaying a legend for a centroid, simple marker with size overwrite?

I am new to QGIS and can't figure out how to display a legend for the dot size of a centroid, simple marker. The size of the dot is dependent on a value from a CSV linked to a layer map of Europe. I ...
1
vote
0answers
41 views

Geoserver SLD: How to get CENTROID of result of INTERSECTION?

In my GeoServer SLD I need to place a symbol (particularly a piechart) exactly on Centroid of the result of Intersection of 2 geometry: geom field from my PostGIS table AND environment variable ...
1
vote
0answers
24 views

How is the Point on surface tool calculated in QGIS [duplicate]

I am interested to know how the Point on surface tool works in QGIS 3. I am choosing to use this rather than the Centroids tool which works of the "center of mass" methodology because this creates a ...
0
votes
0answers
25 views

Computing center and zoom level for a set of points

I need to duplicate google's static map image API api on an internal server with no internet access using OpenStreetMaps. I did find the OSM Wiki Page covering this topic. I initially looked at OSM ...
7
votes
3answers
483 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 ...
0
votes
0answers
30 views

Centroids: Based on travel distance/time and not straight line distances

I am working on a Sales Person Deployment project and quite often come across requests for calculating centroid of a territory where work is distributed across 1000s of ZIP codes. Increasingly we get ...
3
votes
1answer
79 views

Calculate weighted centroid of a raster layer using GRASS?

I'm trying to calculate the weighted centroid of some raster layers I have, which are basically patches of positive values in a sea of null values. I know I could convert thoses patches to binary ...
0
votes
0answers
28 views

NHGIS census files get lat/lon from polygon

I've never worked with shapefiles before and I'm having a lot of trouble with something that I think should be pretty simple. So I have the census tract files from NHGIS for 1980 and the structure ...
1
vote
0answers
32 views

How to compare centrality of points in different shaped and sized polygons

Suppose I have several polygons of varying shape and size, each containing a single point. I want to compare the centrality of each point, and determine which point is more central to its polygon. I'm ...
1
vote
1answer
49 views

Calculating centroid for polygon layer with several features?

I need only 1 centroid point for the whole layer (more than one polygon) instead of 1 centroid point per feature that you get with the menu -> Vector -> Geometry tools -> polygon centroid tool. Its ...
0
votes
1answer
125 views

Centroid value extraction of Landsat image collection in Google Earth Engine

I have an NDVI collection wich I have created from the combination of different collections Landsat5 and 7. How can I exctract the NDVI values of the centroids of each pixel, of each image from my ...
0
votes
1answer
66 views

Using centroid point to generate polygon using ArcPy? [closed]

Is this possible to generate polygons from points (which are centroids of future polygon)? I got shapefile with ~250 points + they have got two attributes: length and width. I don't need complete ...
1
vote
2answers
52 views

QGIS Rasterize PolygonZM

I have a triangulated DEM PolygonZM shape and would like to Rasterize it in QGIS (3.2). I couldn´t find an option to use the geometry´s z value so i tried to create a field and calculate the centroid´...
0
votes
0answers
48 views

Generate Markers from WFS via turf.centroid() with Popups

I have successfully made a map that computes points from a WFS consisting of polygons and generates them as markers. The calculation is carried out by turf.js. However, I do not get all the properties ...
2
votes
1answer
78 views

How do I center a polygon on specific co-ordinates?

I need to place a set of polygons onto a set of points, so that each polygon is centered on its corresponding point - any ideas? In MapInfo I can just manually edit the co-ordinates of the center, but ...
0
votes
1answer
137 views

Is there a way to create pixel centroids inside polygons with PostGIS ?

I am trying to find a solution to do the function of the QGIS-tool 'Generate points(pixel centroids) inside polygons' in PostGIS. In the picture below you can see the output. Is there a way to do it ...
1
vote
0answers
82 views

Raster centroid and relationships with geoTIFF

I have a list (s) containing information on the probable locations of many animals in South America. For example, this is the type of stored information and what it looks like when plotted for the ...
3
votes
1answer
278 views

Spatial Join In PostGIS where centroid of a polygon is inside another polygon

I have two overlapping polygon layers as shown in figure below. One with small grid polygons and another with a large irregular polygon. I want to join them such that attributes of the large polygon ...
2
votes
0answers
140 views

Finding center of circle given three points?

I have been trying to solve this problem for quite some time, but can't find a good solution. Given three sets of geographic coordinates how can I calculate the center point. By "center point" I mean ...
1
vote
1answer
76 views

PostGIS Centroid coordinates (E, N)

I would like to add two new columns in the table (E, N), fill in the coordinates of a polygon centroid using PostGIS SQL code and have the column upadated as soon as I save the edit of a drawing in ...
1
vote
0answers
148 views

Polygon Centroids working for only some Polygons in PyQGIS?

I have a building Layer(Full of Polygons).I want to get centroids of polygons and save them as point layer.I am using python console within Qgis 3.0. I have tried below code.I got my Centroid Layer(...
0
votes
1answer
85 views

R sf extrapolate grid from centroids

I've got a grid/raster in R that is represented as centroids of the grid instead of polygons. I am trying to merge that with points. library(sf) nc <- st_read(system.file("shape/nc.shp", package="...
3
votes
1answer
471 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
2answers
237 views

Calculate centroids using PyQGIS

I am trying to calculate the centroids of polygons using PyQGIS. When I calculate the centroids with the interface (Vector --> Geometry Tools --> Polygon Centroids) everything works out. However, I ...
2
votes
1answer
520 views

Using Polygon centroids tool - points aren't always inside polygon, can I fix that?

When I use Polygon centroid tool, points aren't always inside polygon, because some polygons have weird shape with holes inside them. I have big amount of polygons and I need to use this tool and I ...
0
votes
0answers
33 views

K means clustering where centroid is a node

How would you approach a k mean clustering where the calculated centroids have to be on the same position as one of the nodes? as you can see we have 2 centroids which are arguably the center of each ...
8
votes
1answer
151 views

Getting dual graph from QGIS?

I have a .shp file, and I need to get the dual graph from this file (that is to say, each polygon centroid should become a vertex, and two vertices are linked if their associated polygons are adjacent)...
1
vote
2answers
612 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 ...
2
votes
2answers
168 views

How to select centroids within buffer range?

I want to select the red circled centroids. These centroids must be within the blue buffer.
1
vote
0answers
261 views

should ST_Centroid and ST_Transform be applied in a particular order?

I am a complete newbie using GIS, and particularly using postgresql-postgis. I have a table with administrative boundaries where limits are multipolygons defined in utm (EPSG:23030). I want to ...
1
vote
1answer
452 views

How to obtain geometric centroid for DataFrame where each row is a unique vertex?

I have looked at several related questions, but have not found a working solution beginning with a DataFrame of vertices for multiple polygons. There are existing solutions that address shapefiles ...
0
votes
1answer
113 views

Generating polygons from centroids with rotation and dimensions [closed]

I found this from @crmackey at Creating rectangles on centroid points in ArcPy? It is exactly what I was looking for and works great, however I need to add rotation to the polygons. How could I add ...
5
votes
1answer
108 views

Distance to Multiple Neighboring Sectors

I have two shapefiles - one of neighborhood polygons and another of centroids within those neighborhoods: For each centroid I would like to calculate: Distance to the next closest neighborhood (and ...
1
vote
1answer
1k views

Centroids of each grid cell

I have a grid created by mean the following script: # My grid [using package 'sf'] worldGrid <- st_make_grid(x = worldMap, what = "polygons", cellsize = 10) worldGrid <- st_sf(idcell = 1:length(...
1
vote
0answers
102 views

Directions based on polygon centroid and average/median point of adjacent polygon's touching border

I have a layer containing multiple polygons, and I am trying to find a way to identify the directions of the adjacent polygons of a certain polygon. The directions would be based on the main polygon ...
1
vote
1answer
66 views

Calculate nearest town for 2900 lot centroids

I have 16 town point shapefiles. I have a layer of 2900 centroids for lots. I need to determine the nearest town for each of the centroids. The option I came up with is to Split by Attribute by ...
2
votes
1answer
284 views

How to use ST_Contains() with ST_ClusterWithin()

I need to write a spatial query which will return centroids of clusters which are within a bounding box or polygon. The query I have now is: SELECT ST_NumGeometries(unnest(ST_ClusterWithin(...
3
votes
3answers
417 views

QGIS weighted centroid of polygons with weights from raster layer

I am a total novice with GIS and using QGIS as that is what is available to me. I have a vector layer of polygons (about 3500) and a raster layer of light intensity. What I'm working with looks like ...
6
votes
2answers
981 views

Сalculate polygon centroids with 'point on surface' function

I want to calculate centroid coordinates X_center and Y_center for every polygon in layer so that in case polygon has not simple shape (e.g. with holes or like in the picture below) centroid will be ...
3
votes
1answer
127 views

mean coordinates and measurement of distances

I am trying to find a location that minimises the total distance to a series of points, and compare it with the distance to an existing location. I used the QGIS tool mean coordinate(s) to calculate ...
1
vote
1answer
291 views

Aggregate by date-time and compute a centroid as an output?

(I would prefer using R if possible) I have a table with coordinates (in latitude, longitude), time information (YYYY-mm-dd HH:MM:SS) and ID information (example provided). I sometimes have multiple ...
0
votes
1answer
1k views

Compute centroids and buffers for multiple polygons in Google Earth Engine

I have a dataset with many polygons that come from a fusion table ('xxxxx'): var polygons = ee.FeatureCollection('xxxxx'); I want to compute the centroid and a buffer of Z meters for each of these ...
2
votes
1answer
98 views

Controling polygons centroids alignment in QGIS?

I am using Polygons Centroids feature in QGIS and it does an amazing job. My goal though is to set the points on the left side of the polygon and not in the center. Is there a way to control the ...
3
votes
1answer
1k views

Bind polygon centroid to polygon attribute data

I am trying to bind a dataframe containing polygon centroids to the polygon attributes. Here's what I've done so far to create the centroids: library(rgdal) library(PBSmapping) library(maptools) ...
1
vote
0answers
127 views

Creating new polygons from multiple points with centroid coordinates of polygons using ArcGIS Desktop?

How to Create from an Excel file or shapefile with multiple points with the coordinates of the centroids polygons, now I would like to create an amount x of polygons with the information of the points,...