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

learn more… | top users | synonyms

29
votes
1answer
9k views

How to find the center of geometry of an object?

Well it might be a simple question. Given a set of 2D or 3D points, the question is: How to find the center of geometry of an object? According to the following figure, the center of geometry ...
16
votes
10answers
19k views

Where can I obtain an up-to-date list of US ZIP Codes with Latitude and Longitude Geocodes?

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 ...
10
votes
3answers
5k 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 ...
9
votes
1answer
3k views

How does ArcGIS calculate the “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: Using Calculate Geometry on fields within the attribute table of the ...
8
votes
4answers
724 views

assign and move centroids to their polygons

I m using QGIS 1.8 Lisboa. After calculating the centroids from a polygon shapefile, if some of them lie outside the polygon outlines, I'd like to move them on the polygon they came from. The ...
7
votes
1answer
13k 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 ...
7
votes
2answers
2k 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 ...
6
votes
1answer
366 views

What is Centroid of all lands of Earth?

May be my question is somehow ridiculous but I want to find the center point of all lands of the earth. What I have tried up to now is downloading shape file of all countries and polar parts of the ...
6
votes
1answer
161 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 ...
6
votes
3answers
837 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 ...
6
votes
1answer
741 views

How to force QGIS Centroid Fill inside the Polygon?

I would like to use a centroid fill to enable me to place a letter inside a polygon. The advantage of using a centroid fill is that it also shows up in a legend, whereas labelling the layer would mean ...
6
votes
1answer
3k views

ArcGIS 10 — Polygon Centroid Options and Appropriateness (FeatureToPoint, Labels, etc)

I've found a couple of other Stack Exchange questions related to this, but just like the ArcGIS online help, they were not satisfying. For instance, How does ArcGIS calculate the "inside" ...
5
votes
3answers
13k views

How to get the coordinates in Lat/long from a point layer?

Sorry for asking this basic question, but I couldn't get the solution from the previous answers. I need to extract the Lat/long coordinates of the centroids of districts. My QGIS project SCR and the ...
5
votes
2answers
2k 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 ...
5
votes
1answer
626 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 ...
4
votes
1answer
2k views

How to take polygon centroid in Postgis

I have table with column name,Latitude and Longitude.I want to update this with polygon name and its centroid latitude longitude.I know there is a function in postgis st_centroid(geometry). But I want ...
4
votes
1answer
4k views

How to calculate polygon centroids in R (for non-contiguous shapes)

I've spent a little while figuring out the answer to this question. It's not immediately obvious from a Google search, so thought it may useful to post the answer on here. There is also an additional ...
4
votes
2answers
478 views

Misalignment when generating centroids with Qgis

I was wondering if anyone could shed a light on why this behavior is happening in QGIS ? I'm pretty confident that the issue here is not due to "centroids within polygon" Edit Added a detailed ...
4
votes
3answers
7k views

How can I calculate the center point inside a polygon in ArcGIS 9.3?

I'm using the JavaScript API 1.6 on ArcGIS 9.3. I have a polygon geometry in an ArcGIS map, and I'm trying to find a way to get the point that lies in the exact center of the geometry. What is the ...
4
votes
0answers
811 views

Finding the “center of gravity” of multiple points where points have unequal weights [closed]

I'm trying to reduce a set of lat/lons (each with it's own weight) into one lat/lon that is the center of mass of all of the points. however when I map the results the average point falls no where ...
3
votes
2answers
2k views

List of central coordinates for all countries?

I need a list of the central points for all countries: China: lat/long (coordinates of the most central point in China) France: lat/long (coordinates of the most central point in France) etc...
3
votes
1answer
170 views

Computing radius of gyration in PostGIS

The radius of gyration is a measure of the standard deviation of distances between points (and their center of mass), i.e., how frequently and how far points are moving. A formal definition is: I ...
3
votes
1answer
234 views

Is there a method in SQL Server (2008 or 2012) that will return the equivalent of the Esri LabelPoint for geometry?

I'm looking for a method that is equivalent to the Esri LabelPoint for SQL Server Geometry (or fairly close). Does it exist by a different name? Or is there an after-market implementation? I found ...
3
votes
1answer
630 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?
3
votes
2answers
43 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?
3
votes
1answer
102 views

How to get projected centroids in QGIS?

I am trying to get a centroid for several polygons on a global scale, in a way that it would correctly represent the common centre of all the polygons, taking Earth's curvature into account. The ...
3
votes
1answer
143 views

Shortest distance from polygon centroids to a line in QGIS

To get the distance of each polygon centroid from a line, I have tried the Distance to nearest hub algorithm from the Processing Toolbox. The distances I got from the algorithm did not seem correct, ...
3
votes
1answer
58 views

Qgis creating point within complex shapes (with holes) [duplicate]

I'm looking for a tool to create a point in every polygon, that will be placed in the polygon. these are complex shapes with holes. the point must not put in those holes! the "plugin RealCentroid" ...
3
votes
1answer
78 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 ...
3
votes
0answers
881 views

How to create point labels from midpoints of road polylines in QGIS?

Heres what i want to achieve: i have a roading 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 ...
2
votes
2answers
2k 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
3answers
355 views

Combining different geometry types into same feature class?

I've searched the question in this blog. Maybe I don't use the right words but anyway my problem is not present in any post so I'll try to explain my question by opening a new one. I have a polygon ...
2
votes
1answer
437 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 = ...
2
votes
3answers
3k views

Find polygon centroid with Python

I'm using ArcGIS 9.3 to find centroid of some polygon features. I'd like to do this in Python, but so far I can only find solutions with VBA. Can anyone provide some leads here?
2
votes
2answers
1k views

Formula to get polygon centroid

I need to compute the centroid position of an irregular polygon with lat and lon coordinates in Java. Which formula should I use to correctly compute a centroid?
2
votes
2answers
51 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 ...
2
votes
1answer
116 views

Zip + 4 Centroids

I have a data set with ZIP +4 codes, and ideally, I'd like to map them (their centroids) as points. I'm not interested in their boundaries (since they're not really geographies anyway). Does anyone ...
2
votes
1answer
380 views

How do I convert longitude & latitude to a 3d (geocentric x,y,z) coordinate?

I'm interested in finding the centroid of a point cloud. I understand that to do this I need to convert latitude and longitude values to 3d coordinates, average them and then convert the resulting ...
2
votes
1answer
3k views

How to find polygons centroids? [duplicate]

Possible Duplicate: Get list of coordinates for points in a layer? Sorry for another basic question - my map is almost done but now my boss wants me to enter new outbreaks (that we don't ...
2
votes
0answers
176 views

Centroid of the equator and a point

Suppose I already have a way to compute the centroids of different geometry types: Points (arithmetic mean of Cartesian coordinates). Linestrings (polylines) (weighted mean of segment mid-points in ...
1
vote
1answer
47 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 ...
1
vote
1answer
98 views

Find the vertices of an ROI in XROI using IDL

I need to find the vertices of an ROI shape created in IDL's XROI, so that I can redraw the ROI on multiple images. I know you can find the centroid, area and perimeter with the GEOMETRY command, but ...
1
vote
0answers
11 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 ...
1
vote
0answers
32 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 ...
1
vote
2answers
67 views

How to get a set of all buildings of an OpenStreetMap section in form of single points / Multiple polygons as one point

The objective is to get a set of all buildings of an Open Street Map section in form of single points in a shapfile. I downloaded the section from osm. Imported the section into QGIS (and later ...
1
vote
1answer
1k views

How to calculate centroid of a polygon defined by a list of longitude/latitude points? [duplicate]

I've imported some polygons (ways) from OpenStreetMap and now want to calculate the centroids of them. For this purpose I wrote following code: final List<Point2D.Double> points = ...
1
vote
0answers
229 views

Locating the centroid (center of mass) of spherical polygons

I'm trying to work out how best to locate the centroid of an arbitrary shape draped over a unit sphere, with the input being ordered (clockwise or anti-cw) vertices for the shape boundary. The density ...
1
vote
2answers
328 views

How to use centroid option in Field Calculator in QGis

I want to use Centroid option in field calculator in QGis .How to access it?
1
vote
1answer
90 views

Finding point in polygon

I want to calculate a point in a polygon, if the centriod falls inside the polygon it is what I want, but if it doesn't I would like it to be a visual center point. Essentially I want to do the ...
0
votes
6answers
2k views

Is it possible to query a MySQL database using the results from map.getBounds() with Google Maps API v3?

I have a MySQL database that contains a large number of polygons, one for each district on a map. They are all quite complicated and it's unrealistic to simply load them all at once. I've looked into ...