# Tagged Questions

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 ...

27 views

### Rasterize in QGIS using point as centroid (not vertex)

I'm attempting to make the full switch from ArcGIS to QGIS, but there are a few snags I'm hitting along the way, one of which is in the GDAL "Rasterize" function. My process goes like this: I have a ...
10 views

### Trying to use Feature to Point in order to center means for individual municipalities, but output is a duplicate grid

I created a fishnet grid over a country (the Netherlands) with all the municipalities highlighted. Using the Feature to Point tool I want, instead of a grid, to have a single point centered on each of ...
59 views

### Transforming polygons centroids in order to make hexbin map in QGIS? [closed]

I want to make a hexbin map of a particular kind. Hexbins can be used to embrace several points in the same area, like in this example : With this method, a large city can be covered by one hexagon,...
36 views

### Finding the overall weighted centroid from other centroids [closed]

I'm new to python, and I'm trying to find the overall weighted population centroid of a state, using the unweighted centroid from counties. These unweighted centroids already have a popualtion field ("...
50 views

### ST_Distance between ST_Centroid and ST_Y

I'm trying to make a ST_Distance between a ST_Centroid and a ST_Y... But ST_Centroid is a geometry and ST_Y is a float. How can I make this? My query: SELECT ST_Distance(ST_Centroid(ST_Collect(...
64 views

### How to implement a shoelace formula into Python 2.7.8 [closed]

Here's the image of the equation I'm using, it is a shoelace formula. I need help to point out what each variable represents and how to apply this in python script, math is not my strong-suit! From ...
47 views

### Find centroids of rows with Multipoint Geometry

I wish to find the centroid of a set of given points. The points will be rows of my SpatiaLite database and have Multipoint geometry. I checked the SpatiaLite manual but the ST_Centroid function I ...
69 views

### PostGIS - Get a point inside a line or polygon

I need to get the center point of a line or polygon to make marker for my app. So that when you click a marker the geometry appears (line or polygon). I used ST_Centroid to make it work. The result ...
56 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 ...
53 views

### QGIS : How to calculate centroid on polygons with holes

I try to compute the centroid of polygons with holes on qgis. I did not manage to do it directly, I had to make a conversion to convex hulls before extraction. I crashed my pgsql server trying to ...
33 views

### Averaging multiple values to a single value by common field ID

I want to see how accurate/representative a centroid's datapoint value is compared to averaged multiple datapoints values for the same polygon. There are MANY polygons in the same shapefile. I have a ...
67 views

### How to get, then export as .csv the lat lon centroids from shapefile layer

I have a shape file with a whole lot of regions on it. I need to find the centroids for each of these regions in the shapefile (as latlons) and export this as a .csv I have done extensive research, ...
56 views

### Calculating centroids without adding field to table using ArcPy?

I haven't been able to find any bit of code that does this successfully. I need to delete some fields in a table that I'm modifying using a script I'm writing. I don't want the fields to be left on ...
62 views

### Correct Projection for calculating centroids of a group of points?

I have a long list of points covering all of North America for which I would like to calculate the centroid (by grouping points based on the "Name" column). My approach is to take the WGS84 co-...
85 views

### How to assign polygon attributes to grid cells using centroids in QGIS?

I am relatively new using QGIS. Unfortunately I can´t figure out the following yet. I have two polygon shapefiles, one is a grid I have created using QGIS 2.12.3-Lyon (Creat graticule) and the ...
80 views

### How to compute the distance from the current polygon centroid to another in QGIS field calculator?

There is layer with polygons. I want to save in new field distance of every polygon's centroid to centroid of one particular polygon. To do this I should write some expression like this: distance(...
64 views

### Positioning labels in center of clipped polygons?

I am using ArcMap 10.1 and would like to label a polygon layer that i have clipped. It appears that the label is set for the geometric center of the polygon that falls outside of the clipping.
51 views

### Polygon Torque Map- problem changing polygons to points

I'm trying to alter my data on cartodb map to get maritime emissions over about 20 years- by country. Hence trying get a torque map for polygons, and by changing polygons to points based on a ...
198 views

### How to find multiple centers of gravity?

Say I have a number of customers in a geographical area, marked "c": Each customer has a Lat/Long. I would like to find x number of points, in the same space, that best serve the customers, ie. ...
195 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 ...
184 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. ...
129 views

### How to select centroid of multiple nearby points with same attribute

This question is very similar to #131823, that is not solved yet. I want to merge several points like bus stops into one single point in the centroid of all selected points. The bus stops have a ...
178 views

### How to automate calculation of distance between a zip code (centroid) and an address within one line of data?

I have a large data set of federal contracts which includes two pieces of spatial data per entry (or line): the zip code in which the project took place and the address of the contractor. I am ...
647 views

### How exactly is the centroid of polygons calculated?

I would like to know how exactly QGIS Geometry tools -> polygon centroid is calculating the point coordinates. For example does it divide the boarder of the polygon into small points, take two pairs ...
389 views

### What is the difference between data access's “SHAPE@XY” and “SHAPE@TRUECENTROID” tokens?

Data Access Search Cursor. What, if anything, is the difference between the tokens "SHAPE@XY" and "SHAPE@TRUECENTROID"? They returned the same coordnates on a test polygon: >>> cursor = ...
46 views

### Referencing a raster by center coordinate

I'm concerned with producing mosaics from UAV thermal IR video frames. I exported several several frames containing the temperature values in a matrix (.csv). From camera specifications and flight ...
43 views

### Identify polygons greater than n-th percentile and perform further analyses using arcpy

My goal is to identify tracts that are above the 99 percentile of a variable (xvar), to dissolve contiguous tracts by summing a variable (yvar), and to get the coordinates of the centroids (...
335 views

### Coordinates of cities and villages in The Gambia/Senegal

I am looking for sources of geo-referenced data on villages and cities (or all other things there are) in The Gambia (and Senegal if available). One issue with geocoding in rural West Afrika is the ...
49 views

### Calculating population statistics for postcode centroids

Perhaps this isn't really specifically a GIS question, but I've been using ArcMap to measure distances from the access points of green spaces in Bristol to postcode centroids and would like to use ...
170 views

### How do I find the centroid of each patch in a raster?

I am trying to get the centroid of a several areas in a large raster data set. The output needs to be raster format, with one pixel representing the center of each patch, in the same resolution as ...
37 views

### how to assign the same centroid to polygons grouped by ID , R

I have a SpatialPolygonDataFrame object from a shapefile of different zip codes in New York state, many zip codes are represented by several polygons( for different reasons) so I want to assign the ...
82 views

### Finding centroids for icosahedral gnomonic projection?

I've been trying to create an icosahedral gnomonic projection, like this example by Jason Davies or this one (the Fisher projection). The method that I initially used was using the centroid of each ...
26 views

### Error adding feature to centroids in QGIS [closed]

I want to map forest stands. I have the compartments as centroids and I am trying to add a feature by snapping to them and creating polygons. Each time I click, however, it displays a box titled "...
915 views

### How to move a point shapefile to the centroid of a polygon?

I have this point shapefiles on top of a bounded polygon. I would like to move each point to the centroid of each bounded polygon. Is there an automatic way in ArcGis 10.1 of solving this? Like in the ...
189 views

### Why does qgis give multiple centroids per polygon?

I have a shapefile for the boundaries of European NUTS regions, and I would like to compute the centroid for each of those regions. When I do this in QGIS (2.6.1 on OSX, using polygon centroids from ...
803 views

### Arc - how do I find the coordinates of the centroid of a raster?

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 ...
79 views

### Routes through centroids and array functions

I have a table stopcentroids4 like in figure with the following fields: gid, routes, geom and i want to draw a line for each route that runs through centroids. In my code there is a mistake. ...
470 views

### Distance to nearest hub output not correct

In QGIS 2.6, I'm working with two point layers: center of the population per census tract and stores that accept food stamps. I'm using "distance to nearest hub" to calculate nearest food stamp outlet ...
78 views

### Drawing routes through centroids

According with this link http://workshops.boundlessgeo.com/postgis-intro/advanced_geometry_construction.html I'm creating lines that describe routes. I have a table stopcentroids4 like in figure with ...
134 views

### Finding census block with highest pop. value within the census tract

In QGIS, I'm trying to plot a centroid of only the census block with the highest population within each census tract. So there should only be one point per tract- that of the block with the greatest ...
49 views

### Postgis routes diagram point-to-point

I have a set of centroids to which are related a set of points characterized by linename. The table with the points contains these fields: id ¦ linename ¦ lat ¦ lon¦ I would like to make a diagram ...
219 views

### How to connect centroids of lines sharing the same intersection in QGIS?

I'm looking for a big help to accomplish the following task: I have this street network of the center of Turin (IT), composed by lines representing streets, and black points representing ...
151 views

### How can I find the center of the circle or ellipse I just created

I need to draw circles and ellipses with a certain length/width/ radius. I used the rectangles ovals digitizing plugin to create them, but only measured roughly the circles' radiuses. It would be ...
205 views

### How to compute weighted centroids in PostGIS?

I have a group of points and each point has an associated count value. How can I calculate the centroid of the group weighted by the values associated to each point?
112 views

### Looking for information on methods or algorithms used to calculate centroid from polygons across software

Looking for information on methods or algorithms used to calculate point centroids from polygons across software. ArcGIS uses a "gravity model" but can someone point me to the math or a paper on the ...
168 views

### Buffering points bounded within polygons

I've checked around and didn't see this one yet, hoping somebody can help me out (preferably without code, but I'm all ears). I'm using arcGIS 10.1 on an i5 win7 machine with 16g RAM. Not a xeon but ...
608 views

### OpenLayers: How to get *real* centroid of a Line Geometry/Feature?

I have declared a line geometry as: var lineString = new OpenLayers.Geometry.LineString([source,target]); then I am trying to get the centroid of this lineString as lineString.getCentroid(). But ...
1k views

### How to get the centroid of a set of points in POSTGIS?

I use PostgreSQL with POSTGIS extension. I have a set of points in the_geom column from a table myshema.myobjects I would want create a select statement to get the centroid of this cluster, so from a ...