QGIS API Documentation  2.18.21-Las Palmas (9fba24a)
qgsgeometryfactory.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsgeometryfactory.h
3  -----------------------
4  begin : September 2014
5  copyright : (C) 2014 by Marco Hugentobler
6  email : marco at sourcepole dot ch
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #ifndef QGSGEOMETRYFACTORY_H
19 #define QGSGEOMETRYFACTORY_H
20 
21 #include "qgsrectangle.h"
22 #include "qgswkbtypes.h"
23 #include "qgswkbptr.h"
24 
25 #include <QString>
26 
29 
30 //compatibility with old classes
31 #include "qgspoint.h"
37 
45 class CORE_EXPORT QgsGeometryFactory
46 {
47  public:
50  static QgsAbstractGeometryV2* geomFromWkb( QgsConstWkbPtr wkb );
51 
54  static QgsAbstractGeometryV2* geomFromWkt( const QString& text );
55 
57  static QgsAbstractGeometryV2* fromPoint( const QgsPoint& point );
59  static QgsAbstractGeometryV2* fromMultiPoint( const QgsMultiPoint& multipoint );
61  static QgsAbstractGeometryV2* fromPolyline( const QgsPolyline& polyline );
63  static QgsAbstractGeometryV2* fromMultiPolyline( const QgsMultiPolyline& multiline );
65  static QgsAbstractGeometryV2* fromPolygon( const QgsPolygon& polygon );
67  static QgsAbstractGeometryV2* fromMultiPolygon( const QgsMultiPolygon& multipoly );
69  static QgsAbstractGeometryV2* fromRect( const QgsRectangle& rect );
71  static QgsAbstractGeometryV2* geomFromWkbType( QgsWKBTypes::Type t );
72 
73  private:
74  static QgsLineStringV2* linestringFromPolyline( const QgsPolyline& polyline );
75 };
76 
77 #endif // QGSGEOMETRYFACTORY_H
A rectangle specified with double values.
Definition: qgsrectangle.h:35
QVector< QgsPoint > QgsPolyline
Abstract base class for all geometries.
Contains geometry creation routines.
QVector< QgsPoint > QgsMultiPoint
Line string geometry type, with support for z-dimension and m-values.
QVector< QgsPolygon > QgsMultiPolygon
QVector< QgsPolyline > QgsMultiPolyline
A class to represent a point.
Definition: qgspoint.h:117
QVector< QgsPolyline > QgsPolygon