File: qgsgmlschema.sip

package info (click to toggle)
qgis 2.4.0-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 374,696 kB
  • ctags: 66,263
  • sloc: cpp: 396,139; ansic: 241,070; python: 130,609; xml: 14,884; perl: 1,290; sh: 1,287; sql: 500; yacc: 268; lex: 242; makefile: 168
file content (54 lines) | stat: -rw-r--r-- 1,386 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
//typedef QMap<int, QgsField> QgsFieldMap;

/* Description of feature class in GML */
class QgsGmlFeatureClass
{
  public:
    QgsGmlFeatureClass( );
    QgsGmlFeatureClass( QString name, QString path );

    ~QgsGmlFeatureClass();

    QList<QgsField> & fields();

    int fieldIndex( const QString & name );

    QString path() const;

    QStringList & geometryAttributes();
};

class QgsGmlSchema : QObject
{

%TypeHeaderCode
#include <qgsgmlschema.h>
%End

  public:
    QgsGmlSchema();

    ~QgsGmlSchema();

    /** Get fields info from XSD */
    bool parseXSD( const QByteArray &xml );

    /** Guess GML schema from data if XSD does not exist.
      * Currently only recognizes UMN Mapserver GetFeatureInfo GML response.
      * Supports only UTF-8, UTF-16, ISO-8859-1, US-ASCII XML encodings.
      * @param data GML data
      * @return true in case of success */
    bool guessSchema( const QByteArray &data );

    /** Get list of dot separated paths to feature classes parsed from GML or XSD */
    QStringList typeNames() const;

    /** Get fields for type/class name parsed from GML or XSD */
    QList<QgsField> fields( const QString & typeName );

    /** Get list of geometry attributes for type/class name */
    QStringList geometryAttributes( const QString & typeName );

    /** Get error if parseXSD() or guessSchema() failed */
    QgsError error() const;
};