[gdal-dev] multipolygon to polygon

Chaitanya kumar CH chaitanya.ch at gmail.com
Thu Feb 24 09:01:24 EST 2011


Rashad,

If the Polygons in a MultiPolygon can be combined into a single connected
polygon, you can use the OGRGeometry::UnionCascaded() function to do this.

On Thu, Feb 24, 2011 at 7:13 PM, Mohammed Rashad <mohammedrashadkm at gmail.com
> wrote:

> How to convert mutipolygon to polygon
>
> my code
> string geometry = "MULTIPOLYGON (((76.742484035494002
> 9.949536084104899,76.783465713734998 9.8207365239198,76.818592866512006
> 9.8773302700617,76.842010968363994 9.931972507716001,76.742484035494002
> 9.949536084104899)))";
>
>     char *geom = (char *) geometry.c_str();
>
>  OGRGeometry *OLGeometry = NULL;
>
>
>  OGRGeometryFactory::createFromWkt( &geom, NULL, &OLGeometry );
>
> the OLGeometry is multipolygon I need it as polygon as given below.
>
> Note: both are not equal
>
> POLYGON ((76.334618761574006 10.378867951388999,76.338521778548994
> 10.419849629630001,76.404873067129998 10.349595324074,76.371697422840001
> 10.271534984568,76.334618761574006 10.378867951388999))
>
>
>
>
> --
> Thanks && Regards
> Rashad
>
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>



-- 
Best regards,
Chaitanya kumar CH.
/tʃaɪθənjə/ /kʊmɑr/
+91-9494447584
17.2416N 80.1426E
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20110224/ffbb2758/attachment.html


More information about the gdal-dev mailing list