### Friday, February 03, 2006

## RE: st: RE: tmap label coordinates

Quite so.

Nick n.j.cox@durham.ac.uk

Austin Nichols > Well, centroid of a polygon on a plane, anyway. A polygon on a > Mercator projection would not be quite so easy to calculate a centroid > for if you wanted the centroid of the spherical analog (google > vincenty or haversine for more details). But I guess if all you want > it for is for specifying a label location, you don't care about a > little inaccuracy that varies with latitude, right? > > On 2/2/06, n j cox <n.j.cox@durham.ac.uk> wrote:

> > This is one definition of the centroid, not an approximation. > > > > For some shapes, the centroid might lie outside the area, > > as is true of many a banana state. This can also be true > > economically. > > > > Nick > > n.j.cox@durham.ac.uk > > > Hoetker, Glenn > > > > I encountered this a while ago and can't swear that I'm remembering > > correctly. However, I believe I found that the > (approximate, at least) > > centroid for a region corresponded to the average value of > the x_coord > > for that region and the average value of the y_coord for that state. > > > > > Friedrich Huebler > > > > > With the -tmap- package from SSC it is possible to create maps in > > > Stata. The help file and user's guide show how labels > can be added to > > > a map, with the example of a map of the United States. > To add labels > > > it is necessary to specify the x and y coordinates where > the labels > > > should be placed. The example database us-database.dta > contains the > > > variables x_coord and y_coord that identify the center > of each state. > > > Assume that these variables are not present in a > database. How could > > > I identify the center of each region where I want the > labels to be > > > placed?

* * For searches and help try: * http://www.stata.com/support/faqs/res/findit.html * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/

Tag: statalist