Beispiel #1
0
QgsWFSData::QgsWFSData(
  const QString& uri,
  QgsRectangle* extent,
  QMap<QgsFeatureId, QgsFeature*> &features,
  QMap<QgsFeatureId, QString > &idMap,
  const QString& geometryAttribute,
  const QMap<QString, QPair<int, QgsField> >& thematicAttributes,
  QGis::WkbType* wkbType )
    : QObject(),
    mUri( uri ),
    mExtent( extent ),
    mFeatures( features ),
    mIdMap( idMap ),
    mGeometryAttribute( geometryAttribute ),
    mThematicAttributes( thematicAttributes ),
    mWkbType( wkbType ),
    mFinished( false ),
    mFeatureCount( 0 )
{
  //find out mTypeName from uri
  QStringList arguments = uri.split( "&" );
  QStringList::const_iterator it;
  for ( it = arguments.constBegin(); it != arguments.constEnd(); ++it )
  {
    if ( it->startsWith( "TYPENAME", Qt::CaseInsensitive ) )
    {
      mTypeName = it->section( "=", 1, 1 );
      //and strip away namespace prefix
      QStringList splitList = mTypeName.split( ":" );
      if ( splitList.size() > 1 )
      {
        mTypeName = splitList.at( 1 );
      }
      QgsDebugMsg( QString( "mTypeName is: %1" ).arg( mTypeName ) );
    }
  }

  mEndian = QgsApplication::endian();
}
QgsWFSData::QgsWFSData(
  const QString& uri,
  QgsRectangle* extent,
  QgsCoordinateReferenceSystem* srs,
  QList<QgsFeature*> &features,
  const QString& geometryAttribute,
  const QSet<QString>& thematicAttributes,
  QGis::WkbType* wkbType )
    : QObject(),
    mUri( uri ),
    mExtent( extent ),
    mSrs( srs ),
    mFeatures( features ),
    mGeometryAttribute( geometryAttribute ),
    mThematicAttributes( thematicAttributes ),
    mWkbType( wkbType ),
    mFinished( false ),
    mFeatureCount( 0 )
{
  //qWarning("Name of the geometry attribute is:");
  //qWarning(mGeometryAttribute.toLocal8Bit().data());

  //find out mTypeName from uri
  QStringList arguments = uri.split( "&" );
  QStringList::const_iterator it;
  for ( it = arguments.constBegin(); it != arguments.constEnd(); ++it )
  {
    if ( it->startsWith( "TYPENAME", Qt::CaseInsensitive ) )
    {
      mTypeName = it->section( "=", 1, 1 );
      qWarning( "mTypeName is: %s", mTypeName.toLocal8Bit().constData() );
    }
  }

  mEndian = QgsApplication::endian();
  QObject::connect( &mHttp, SIGNAL( done( bool ) ), this, SLOT( setFinished( bool ) ) );
}