[Gdal-dev] Re: C# Geometry Classes?

Tamas Szekeres szekerest at gmail.com
Thu Mar 22 06:46:33 EDT 2007


Hi Folks,

It would be a significant effort to discover which functionality
cannot be treated this way. For example it doesn't make too much sense
to support IsPointOnSurface on a Geometry class.
Sooner or later we should harmonize the C++ and the SWIG API or
support a separate documentation for the SWIG interface. Otherwise the
user will always search for specific methods described at the C++
documentation but missing from the SWIG interface.


Best regards,

Tamas




2007/3/22, Simon Perkins <sy at perkins.net>:
> Hi Mateusz,
>
> Thanks for the example - that helps a lot. I wasn't sure whether a
> Polygon could be treated as a geometry collection like this...
>
> Cheers,
>
> Sy
>
>
> Mateusz Loskot wrote:
> >
> > I hope following example will help you:
> >
> >
> > ///////////////////////////////////////////////////////////////
> > #include <iostream>
> > #include <ogr_api.h>
> > #include <cpl_port.h>
> >
> > int main()
> > {
> >     using std::cout;
> >     using std::endl;
> >
> >     // Polygon with 2 rings
> >     char* wkt = "POLYGON ((0 0 0,4 0 0,4 4 0,0 4 0,0 0 0), (1 1 0, 2 1
> > 0, 2 2 0, 1 1 0))";
> >
> >     OGRGeometryH g = NULL;
> >     OGRErr err = OGR_G_CreateFromWkt(&wkt, NULL, &g);
> >     cout << "Rings count: " << OGR_G_GetGeometryCount(g) << endl;
> >
> >     // Ring 1
> >     OGRGeometryH ring1 = NULL;
> >     ring1 = OGR_G_GetGeometryRef(g, 0);
> >     cout << "Ring 1: " << OGR_G_GetPointCount(ring1) << endl;
> >
> >     // Ring 2
> >     OGRGeometryH ring2 = NULL;
> >     ring2 = OGR_G_GetGeometryRef(g, 1);
> >     cout << "Ring 2: " << OGR_G_GetPointCount(ring2) << endl;
> >
> >     OGR_G_DestroyGeometry(g);
> >     return 0;
> > }
> > ///////////////////////////////////////////////////////////////
> >
> > Cheers
> >
>
> _______________________________________________
> Gdal-dev mailing list
> Gdal-dev at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/gdal-dev
>



More information about the Gdal-dev mailing list