/********************************************************************** * $Id: * * GEOS - Geometry Engine Open Source * http://geos.refractions.net * * Copyright (C) 2001-2002 Vivid Solutions Inc. * * This is free software; you can redistribute and/or modify it under * the terms of the GNU Lesser General Public Licence as published * by the Free Software Foundation. * See the COPYING file for more information. * **********************************************************************/ #include #include #include #include #include #include #include #include #include #include #include #include #include namespace geos { namespace geom { // geos.geom namespace prep { // geos.geom.prep const PreparedGeometry * PreparedGeometryFactory::create( const geom::Geometry * g) const { using geos::geom::GeometryTypeId; PreparedGeometry* pg = 0; switch ( g->getGeometryTypeId() ) { case GEOS_MULTIPOINT: case GEOS_POINT: pg = new PreparedPoint( g); break; case GEOS_LINEARRING: case GEOS_LINESTRING: case GEOS_MULTILINESTRING: pg = new PreparedLineString( g); break; case GEOS_POLYGON: case GEOS_MULTIPOLYGON: pg = new PreparedPolygon( g); break; default: pg = new BasicPreparedGeometry( g); } return pg; } } // namespace geos.geom.prep } // namespace geos.geom } // namespace geos /********************************************************************** * $Log$ * **********************************************************************/