[Gdal-dev] Center of polygon

Clay, Bruce bclay at ball.com
Tue Apr 6 11:02:54 EDT 2004


Daniel:
  Thanks for the tip.  All I had to do is include the mitab_geometry.h
file and the method did what I needed.

Frank:  Several of the methods in this file seem to be quite generic.
Could / should they be moved to the public ORG API.  So far I have only
used OGRPolygonLabelPoint on polygons but I will be trying it on
polylines this afternoon.

Bruce
bclay at ball.com

-----Original Message-----
From: gdal-dev-admin at remotesensing.org
[mailto:gdal-dev-admin at remotesensing.org] On Behalf Of Daniel Morissette
Sent: Monday, April 05, 2004 6:25 PM
To: gdal-dev at remotesensing.org
Subject: Re: [Gdal-dev] Center of polygon


Clay, Bruce wrote:
> Is there a method within OGR to find the center of a polygon (where it

> is not part of the data set) or polyline for the purposes of centering

> a label?  If not does anyone have a method they are willing to share 
> to walk through the data of a polygon / ring to determine the center?
> 
> 

The MITAB driver contains a function called OGRPolygonLabelPoint() in 
ogr/ogrsf_fmrts/mitab/mitab_geometry.cpp that will compute a label point

  on an OGRPolygon.

The function is only local to the MITAB driver and is not part of the 
public OGR API, but you can probably make a copy.

Daniel
-- 
------------------------------------------------------------
  Daniel Morissette               dmorissette at dmsolutions.ca
  DM Solutions Group              http://www.dmsolutions.ca/
------------------------------------------------------------

_______________________________________________
Gdal-dev mailing list
Gdal-dev at remotesensing.org
http://remotesensing.org/mailman/listinfo/gdal-dev



More information about the Gdal-dev mailing list