[prev in list] [next in list] [prev in thread] [next in thread] 

List:       fdo-users
Subject:    [fdo-users] how to create single polygon using FdoIpolygon
From:       prem <pkbalakrishnan () tatapowersed ! com>
Date:       2013-04-16 6:11:26
Message-ID: 1366092686514-5047149.post () n6 ! nabble ! com
[Download RAW message or body]

hi,
Example code given in FDODevGuide.pdf creates a geometry polygon (bluelake)
using FdoIPolygon.
But actually if you visuallly see them using QGIS it is multipolygon(i.e., i
m able to see two polygons).
below is the code using which i have tested.
How to create a single polygon?????

// Blue Lake
			FdoPtr<FdoILinearRing> exteriorRingBlueLake;
			FdoInt32 numBlueLakeShorelineOrdinates = 10;
			double blueLakeExteriorRingOrdinates[] = {52.0, 18.0, 66.0, 23.0,73.0,
9.0, 48.0, 6.0, 2.0, 18.0};
			exteriorRingBlueLake =
sampleGeometryFactory->CreateLinearRing(FdoDimensionality_XY,
numBlueLakeShorelineOrdinates,blueLakeExteriorRingOrdinates);
			// define the shoreline of Goose Island which is on Blue Lake
			// this is the sole member of the list of interior rings
			FdoPtr<FdoILinearRing> linearRingGooseIsland;
			FdoInt32 numGooseIslandShorelineOrdinates = 10;
			double gooseIslandLinearRingOrdinates[] = {59.0, 18.0, 67.0, 18.0,67.0,
13.0, 59.0, 13.0, 59.0, 18.0};
			linearRingGooseIsland =
sampleGeometryFactory->CreateLinearRing(FdoDimensionality_XY,
numGooseIslandShorelineOrdinates, gooseIslandLinearRingOrdinates);
			
			// add the Goose Island linear ring to the list of interior rings
			FdoPtr<FdoLinearRingCollection> interiorRingsBlueLake;
			interiorRingsBlueLake = FdoLinearRingCollection::Create();
			interiorRingsBlueLake->Add(linearRingGooseIsland);
			// create the Blue Lake polygon
			FdoPtr<FdoIPolygon> blueLake;
			blueLake
sampleGeometryFactory->CreatePolygon(exteriorRingBlueLake,interiorRingsBlueLake);
			FdoByteArray * geometryByteArray
=sampleGeometryFactory->GetFgf(blueLake);// 
   			sampleGeometryValue->SetGeometry(geometryByteArray);

exteriorRingBlueLake is a polygon and InteriorRingBlueLake is another
polygon.
How can i create a single polygon?

"POLYGON((52 18,66 23,73 9,48 6,52 18),(59 18,67 18,67 13,59 13,59 18))"
This is data viewed as Text. 


Regards,
Prem



--
View this message in context: \
http://osgeo-org.1560.x6.nabble.com/how-to-create-single-polygon-using-FdoIpolygon-tp5047149.html
 Sent from the FDO Users mailing list archive at Nabble.com.
_______________________________________________
fdo-users mailing list
fdo-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/fdo-users


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic