ogr/ogrgeometryfactory.cpp
OGRGeometry *
OGRGeometryFactory::createGeometry( OGRwkbGeometryType eGeometryType )

{
    switch( wkbFlatten(eGeometryType) )
    {
      case wkbPoint:
          return new OGRPoint();

      case wkbLineString:
          return new OGRLineString();

      case wkbPolygon:
          return new OGRPolygon();

      case wkbGeometryCollection:
          return new OGRGeometryCollection();

      case wkbMultiPolygon:
          return new OGRMultiPolygon();

      case wkbMultiPoint:
          return new OGRMultiPoint();

      case wkbMultiLineString:
          return new OGRMultiLineString();

      case wkbLinearRing:
          return new OGRLinearRing();

      default:
          return NULL;
    }

    return NULL;
}
/** 
 * Create an empty geometry of desired type.
 *
 * This is equivelent to allocating the desired geometry with new, but
 * the allocation is guaranteed to take place in the context of the 
 * GDAL/OGR heap. 
 *
 * This method is the same as the C function OGR_G_CreateGeometry().
 *
 * @param eGeometryType the type code of the geometry class to be instantiated.
 *
 * @return the newly create geometry or NULL on failure.
 */
Create an empty geometry of desired type.
This is equivelent to allocating the desired geometry with new, but
the allocation is guaranteed to take place in the context of the
GDAL/OGR heap.

This method is the same as the C function OGR_G_CreateGeometry().

@param eGeometryType the type code of the geometry class to be instantiated.

@return the newly create geometry or NULL on failure.
Create an empty geometry of desired type . This is equivelent to allocating the desired geometry with new but the allocation is guaranteed to take place in the context of the GDAL / OGR heap . This method is the same as the C function OGR_G_CreateGeometry () . @param eGeometryType the type code of the geometry class to be instantiated . @return the newly create geometry or NULL on failure .
OGRGeometry *
OGRGeometryFactory::createGeometry( OGRwkbGeometryType eGeometryType )
{
    switch( wkbFlatten(eGeometryType) )
    {
      case wkbPoint:
          return new OGRPoint();
      case wkbLineString:
          return new OGRLineString();
      case wkbPolygon:
          return new OGRPolygon();
      case wkbGeometryCollection:
          return new OGRGeometryCollection();
      case wkbMultiPolygon:
          return new OGRMultiPolygon();
      case wkbMultiPoint:
          return new OGRMultiPoint();
      case wkbMultiLineString:
          return new OGRMultiLineString();
      case wkbLinearRing:
          return new OGRLinearRing();
      default:
          return NULL;
    }
    return NULL;
}
OGRGeometry * OGRGeometryFactory :: createGeometry ( OGRwkbGeometryType eGeometryType ) { switch ( wkbFlatten ( eGeometryType ) ) { case wkbPoint : return new OGRPoint ( ) ; case wkbLineString : return new OGRLineString ( ) ; case wkbPolygon : return new OGRPolygon ( ) ; case wkbGeometryCollection : return new OGRGeometryCollection ( ) ; case wkbMultiPolygon : return new OGRMultiPolygon ( ) ; case wkbMultiPoint : return new OGRMultiPoint ( ) ; case wkbMultiLineString : return new OGRMultiLineString ( ) ; case wkbLinearRing : return new OGRLinearRing ( ) ; default : return NULL ; } return NULL ; }
Create an empty geometry of desired type.
Create an empty geometry of desired type .