[gdal-dev] Building a resizable polygon

Cassanova, Bill BCassanova at weather.com
Mon Apr 4 17:05:44 EDT 2011


Hi All,

I am looking for some direction on if GDAL has the capability has the ability to build a super-polygon from a series of small polygons...I have played a bit with the OGR Geometry classes but I can't
seem to quite get what I need.

Let's start with a simply example.

Polygon A has vertices in (X,Y) format of <0, 0>, < 0,1>, <1,0>, <1,1>
Polygon B has vertices in (x,y) format of < 1,0 >, <1,1>, <2,0>, <2,1>

Since Polygon A and B share a common side with vertices < <1,0> and <1,1> I want to build super polygon that contains the coordinates of the outer perimeter of the points.
When complete the new polygon C will thus have points <0,0>,<0,1>,<2,0>, <2,1>

I had first looked at OGRPolygon.AddRing wherein A and B above would be OGRLinearRings and then by making a call to C.getExteriorRing() but this seem to report the first ring added.

Am I heading in the correct direction or is this something that I will essentially have to do manually by first creating a OGRLinearRing from the vertices of polygon A, then creating a OGRPolygon to which I execute addRing.
Then interrogating that ring to see which line segments are common between A and B and removing the ones that are common and adding the line segments that aren't common.

Thanks,
Bill
++++

William Cassanova | Senior GFS Developer | The Weather Channel | 770.226.2368 | bcassanova at weather.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20110404/f9c53859/attachment.html


More information about the gdal-dev mailing list