M
M
masterworks2014-05-21 15:24:17
Geolocation
masterworks, 2014-05-21 15:24:17

How to determine the center of a polygon on a map?

Good day. There is a polygon on a geographic map (a set of coordinates). You need to determine the center of this polygon.
The task is synthetic, but nevertheless. Found one description of the algorithm and a similar question . Are there any implemented algorithms for determining the center or open source libraries with this capability? The language is not important.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
M
masterworks, 2014-06-15
@masterworks

used code from here
www.codeproject.com/Questions/403154/Finding-Middl...
my JS implementation
code.google.com/p/geoinfo/source/browse/public_htm...

S
Sergey, 2014-05-21
@begemot_sun

The center is different though.
Maybe you need a center of mass? or geometric center? And just take the arithmetic mean of coordinates?

A
Anton Belichkov, 2014-05-26
@za90

Look at https://github.com/mapnik/mapnik for some reason because they render labels inside polygons.
And, maybe. as a fantasy, look towards PostGIS.

A
Anton Korzunov, 2014-08-28
@kashey

The center of the chtuka polygon is complex. There is a geometric center, there is a center of mass and there is a "place where the inscription should be written."

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question