diff --git a/resources/context_help/QgsDelimitedTextSourceSelect-en_US b/resources/context_help/QgsDelimitedTextSourceSelect-en_US index 48e65cbd98f4..08d7759fb681 100644 --- a/resources/context_help/QgsDelimitedTextSourceSelect-en_US +++ b/resources/context_help/QgsDelimitedTextSourceSelect-en_US @@ -103,6 +103,19 @@ It is safer to use an explicit coding if the QGIS project needs to be portable. "Point" includes POINT and MULTIPOINT WKT types, "Line" includes LINESTRING and MULTLINESTRING WKT types, and "Polygon" includes POLYGON and MULTIPOLYGON WKT types. +
Layer settings
+

Layer settings control the way the layer is managed in QGIS. The options available are:

+

How the delimiter, quote, and escape characters work

Records are split into fields using three character sets: @@ -275,9 +288,9 @@ The following options can be added

  • crs=... specifies the coordinate system to use for the vector layer, in a format accepted by QgsCoordinateReferenceSystem.createFromString (for example "EPSG:4167"). If this is not specified then a dialog box may request this information from the user when the layer is loaded (depending on QGIS CRS settings).
  • -
  • subsetIndex=(yes|no) specifies whether the provider should build an index to define subset during the initial file scan. The index will apply both for explicitly defined subsets, and for the implicit subset of features for which the geometry definition is valid. By default the subset index is built if it is applicable. This option is not available from the GUI.
  • +
  • subsetIndex=(yes|no) specifies whether the provider should build an index to define subset during the initial file scan. The index will apply both for explicitly defined subsets, and for the implicit subset of features for which the geometry definition is valid. By default the subset index is built if it is applicable.
  • spatialIndex=(yes|no) specifies whether the provider should build a spatial index during the initial file scan. By default the spatial index is not built.
  • -
  • useWatcher=(yes|no) specifies whether the provider should use a file system watcher to monitor for changes to the file. This option is not available from the GUI
  • +
  • watchFile=(yes|no) specifies whether the provider should use a file system watcher to monitor for changes to the file.
  • quiet=(yes|no) specifies whether errors encountered loading the layer are presented in a dialog box (they will be written to the QGIS log in any case). The default is no. This option is not available from the GUI
  • diff --git a/src/core/qgsvectorlayer.h b/src/core/qgsvectorlayer.h index e29991d84195..967cc807f249 100644 --- a/src/core/qgsvectorlayer.h +++ b/src/core/qgsvectorlayer.h @@ -384,7 +384,7 @@ struct CORE_EXPORT QgsVectorJoinInfo * * Determines whether the provider generates a spatial index. The default is no. * - * -useWatcher=(yes|no) + * -watchFile=(yes|no) * * Defines whether the file will be monitored for changes. The default is * to monitor for changes. diff --git a/src/providers/delimitedtext/qgsdelimitedtextfile.cpp b/src/providers/delimitedtext/qgsdelimitedtextfile.cpp index 1083d12110e0..7f38f9f80fd1 100644 --- a/src/providers/delimitedtext/qgsdelimitedtextfile.cpp +++ b/src/providers/delimitedtext/qgsdelimitedtextfile.cpp @@ -38,7 +38,7 @@ QgsDelimitedTextFile::QgsDelimitedTextFile( QString url ) : mEncoding( "UTF-8" ), mFile( 0 ), mStream( 0 ), - mUseWatcher( true ), + mUseWatcher( false ), mWatcher( 0 ), mDefinitionValid( false ), mUseHeader( true ), @@ -153,9 +153,9 @@ bool QgsDelimitedTextFile::setFromUrl( QUrl &url ) } // - if ( url.hasQueryItem( "useWatcher" ) ) + if ( url.hasQueryItem( "watchFile" ) ) { - mUseWatcher = ! url.queryItemValue( "useWatcher" ).toUpper().startsWith( 'N' );; + mUseWatcher = ! url.queryItemValue( "watchFile" ).toUpper().startsWith( 'N' );; } // The default type is csv, to be consistent with the @@ -264,7 +264,7 @@ QUrl QgsDelimitedTextFile::url() url.addQueryItem( "encoding", mEncoding ); } - if( ! mUseWatcher ) url.addQueryItem( "useWatcher", "no"); + if( mUseWatcher ) url.addQueryItem( "watchFile", "yes"); url.addQueryItem( "type", type() ); if ( mType == DelimTypeRegexp ) diff --git a/src/providers/delimitedtext/qgsdelimitedtextsourceselect.cpp b/src/providers/delimitedtext/qgsdelimitedtextsourceselect.cpp index e0e572f15b4f..0207e58bde59 100644 --- a/src/providers/delimitedtext/qgsdelimitedtextsourceselect.cpp +++ b/src/providers/delimitedtext/qgsdelimitedtextsourceselect.cpp @@ -20,6 +20,7 @@ #include "qgsdelimitedtextprovider.h" #include "qgsdelimitedtextfile.h" +#include #include #include #include @@ -52,11 +53,24 @@ QgsDelimitedTextSourceSelect::QgsDelimitedTextSourceSelect( QWidget * parent, Qt buttonBox->button( QDialogButtonBox::Ok )->hide(); } + bgFileFormat=new QButtonGroup(this); + bgFileFormat->addButton(delimiterCSV,swFileFormat->indexOf( swpCSVOptions)); + bgFileFormat->addButton(delimiterChars,swFileFormat->indexOf( swpDelimOptions)); + bgFileFormat->addButton(delimiterRegexp,swFileFormat->indexOf( swpRegexpOptions)); + + bgGeomType=new QButtonGroup(this); + bgGeomType->addButton(geomTypeXY,swGeomType->indexOf( swpGeomXY)); + bgGeomType->addButton(geomTypeWKT,swGeomType->indexOf( swpGeomWKT)); + bgGeomType->addButton(geomTypeNone,swGeomType->indexOf( swpGeomNone)); + + connect( bgFileFormat, SIGNAL(buttonClicked(int)), swFileFormat, SLOT(setCurrentIndex(int))); + connect( bgGeomType, SIGNAL(buttonClicked(int)),swGeomType,SLOT(setCurrentIndex(int))); + cmbEncoding->clear(); cmbEncoding->addItems( QgsVectorDataProvider::availableEncodings() ); cmbEncoding->setCurrentIndex( cmbEncoding->findText( "UTF-8" ) ); - loadSettings(); + loadSettings(); updateFieldsAndEnable(); connect( txtFilePath, SIGNAL( textChanged( QString ) ), this, SLOT( updateFileName() ) ); @@ -173,6 +187,10 @@ void QgsDelimitedTextSourceSelect::on_buttonBox_accepted() url.addQueryItem( "geomType", "none" ); } + if( ! geomTypeNone->isChecked()) url.addQueryItem( "spatialIndex", cbxSpatialIndex->isChecked() ? "yes" : "no" ); + url.addQueryItem( "subsetIndex", cbxSubsetIndex->isChecked() ? "yes" : "no" ); + url.addQueryItem( "watchFile", cbxWatchFile->isChecked() ? "yes" : "no" ); + // store the settings saveSettings(); saveSettingsForFile( txtFilePath->text() ); @@ -242,6 +260,7 @@ void QgsDelimitedTextSourceSelect::loadSettings( QString subkey, bool loadGeomSe { delimiterCSV->setChecked( true ); } + swFileFormat->setCurrentIndex( bgFileFormat->checkedId() ); QString encoding = settings.value( key + "/encoding", "" ).toString(); if ( ! encoding.isEmpty() ) cmbEncoding->setCurrentIndex( cmbEncoding->findText( encoding ) ); @@ -259,6 +278,9 @@ void QgsDelimitedTextSourceSelect::loadSettings( QString subkey, bool loadGeomSe cbxTrimFields->setChecked( settings.value( key + "/trimFields", "false" ) == "true" ); cbxSkipEmptyFields->setChecked( settings.value( key + "/skipEmptyFields", "false" ) == "true" ); cbxPointIsComma->setChecked( settings.value( key + "/decimalPoint", "." ).toString().contains( "," ) ); + cbxSubsetIndex->setChecked( settings.value( key + "/subsetIndex", "false" ) == "true" ); + cbxSpatialIndex->setChecked( settings.value( key + "/spatialIndex", "false" ) == "true" ); + cbxWatchFile->setChecked( settings.value( key + "/watchFile", "false" ) == "true" ); if ( loadGeomSettings ) { @@ -267,6 +289,7 @@ void QgsDelimitedTextSourceSelect::loadSettings( QString subkey, bool loadGeomSe else if ( geomColumnType == "wkt" ) geomTypeWKT->setChecked( true ); else geomTypeNone->setChecked( true ); cbxXyDms->setChecked( settings.value( key + "/xyDms", "false" ) == "true" ); + swGeomType->setCurrentIndex( bgGeomType->checkedId() ); } } @@ -294,6 +317,9 @@ void QgsDelimitedTextSourceSelect::saveSettings( QString subkey, bool saveGeomSe settings.setValue( key + "/trimFields", cbxTrimFields->isChecked() ? "true" : "false" ); settings.setValue( key + "/skipEmptyFields", cbxSkipEmptyFields->isChecked() ? "true" : "false" ); settings.setValue( key + "/decimalPoint", cbxPointIsComma->isChecked() ? "," : "." ); + settings.setValue( key + "/subsetIndex", cbxSubsetIndex->isChecked() ? "true" : "false"); + settings.setValue( key + "/spatialIndex", cbxSpatialIndex->isChecked() ? "true" : "false"); + settings.setValue( key + "/watchFile", cbxWatchFile->isChecked() ? "true" : "false"); if ( saveGeomSettings ) { QString geomColumnType = "none"; @@ -368,8 +394,6 @@ void QgsDelimitedTextSourceSelect::updateFieldLists() cmbYField->clear(); cmbWktField->clear(); - frmGeometry->setEnabled( false ); - // clear the sample text box tblSample->clear(); tblSample->setColumnCount( 0 ); @@ -532,7 +556,6 @@ void QgsDelimitedTextSourceSelect::updateFieldLists() if ( haveFields ) { - frmGeometry->setEnabled( true ); connect( cmbXField, SIGNAL( currentIndexChanged( int ) ), this, SLOT( enableAccept() ) ); connect( cmbYField, SIGNAL( currentIndexChanged( int ) ), this, SLOT( enableAccept() ) ); connect( cmbWktField, SIGNAL( currentIndexChanged( int ) ), this, SLOT( enableAccept() ) ); diff --git a/src/providers/delimitedtext/qgsdelimitedtextsourceselect.h b/src/providers/delimitedtext/qgsdelimitedtextsourceselect.h index e4f184aeaa6c..efe5fcee7074 100644 --- a/src/providers/delimitedtext/qgsdelimitedtextsourceselect.h +++ b/src/providers/delimitedtext/qgsdelimitedtextsourceselect.h @@ -19,6 +19,7 @@ #include "qgscontexthelp.h" #include "qgisgui.h" +class QButtonGroup; class QgisInterface; class QgsDelimitedTextFile; @@ -53,6 +54,8 @@ class QgsDelimitedTextSourceSelect : public QDialog, private Ui::QgsDelimitedTex int mBadRowCount; QString mPluginKey; QString mLastFileType; + QButtonGroup *bgFileFormat; + QButtonGroup *bgGeomType; private slots: void on_buttonBox_accepted(); diff --git a/src/ui/qgsdelimitedtextsourceselectbase.ui b/src/ui/qgsdelimitedtextsourceselectbase.ui index 735e354eea8f..02bd1d1f0287 100644 --- a/src/ui/qgsdelimitedtextsourceselectbase.ui +++ b/src/ui/qgsdelimitedtextsourceselectbase.ui @@ -6,8 +6,8 @@ 0 0 - 629 - 551 + 666 + 478 @@ -27,201 +27,284 @@ - - - - + + + + true - - QFrame::Box - - - QFrame::Sunken - - + - 3 + 0 - - - - - 0 - 0 - - - - Each line in the file is split using a regular expression to define the end of each field - - - Each line in the file is split using a regular expression to define the end of each field - - - Each line in the file is split using a regular expression to define the end of each field - - - Regular expression - - - - - - - Fields are defined by the specified delimiter, quote, and escape characters - - - Fields are defined by the specified delimiter, quote, and escape characters - - - Fields are defined by the specified delimiter, quote, and escape characters - - - Selected delimiters - - - true + + + + 0 - + + + + + 0 + 0 + + + + File Name + + + 0 + + + + + + + Full path to the delimited text file + + + Full path to the delimited text file. In order to properly parse the fields in the file, the delimiter must be defined prior to entering the file name. Use the Browse button to the right of this field to choose the input file. + + + false + + + + + + + true + + + + 16777215 + 16777215 + + + + Browse to find the delimited text file to be processed + + + Use this button to browse to the location of the delimited text file. This button will not be enabled until a delimiter has been entered in the <i>Delimiter</i> box. Once a file is chosen, the X and Y field drop-down boxes will be populated with the fields from the delimited text file. + + + Browse... + + + false + + + + - - - - The file a comma separated value file, fields delimited by commas and quoted by " - - - The file a comma separated value file, fields delimited by commas and quoted by " - - - The file a comma separated value file, fields delimited by commas and quoted by " - - - CSV (comma separated values) format + + + + 0 - + + + + + 0 + 0 + + + + Layer name + + + + + + + Name to display in the map legend + + + Name displayed in the map legend + + + + + + + Encoding + + + + + + + Select the file encoding + + + Select the file encoding + + + Select the file encoding + + + QComboBox::InsertAtTop + + + + - - - - QFrame::Box - - - QFrame::Sunken - - - - 0 - + + + + + + + 0 + + + + + 0 + + + - 2 + 0 - - - 0 - + - - - Comma character is one of the delimiters - - - Comma character is one of the delimiters - - - Comma character is one of the delimiters + + + true - Comma + <p align="right">X field</p> - + + + true + + + + 0 + 0 + + + + + 120 + 0 + + - Tab character is one of the delimiters + Name of the field containing x values - Tab character is one of the delimiters + Name of the field containing x values - Tab character is one of the delimiters + Name of the field containing x values - - Tab + + false - + + + + + true + + <p align="right">Y field</p> + - + + + true + + + + 0 + 0 + + + + + 120 + 0 + + - Space character is one of the delimiters + Name of the field containing y values - Space character is one of the delimiters + Name of the field containing y values - Space character is one of the delimiters - - - Space + Name of the field containing y values - + false - + - Colon character is one of the delimiters + X and Y coordinates are expressed in degrees/minutes/seconds - Colon character is one of the delimiters + X and Y coordinates are expressed in degrees/minutes/seconds - Colon character is one of the delimiters + X and Y coordinates are expressed in degrees/minutes/seconds - Colon + DMS coordinates - - - Semicolon character is one of the delimiters - - - Semicolon character is one of the delimiters - - - Semicolon character is one of the delimiters + + + Qt::Horizontal - - Semicolon + + + 0 + 0 + - + + + + + + + 0 + - + 0 - + - Other delimiters + Geometry field - + true @@ -231,87 +314,75 @@ 0 - + - 32767 - 32767 + 120 + 0 - Delimiters to use when splitting fields in the text file. The delimiter can be more than one character. These characters are used in addition to the comma, tab, space, colon, and semicolon options. + Name of the field containing well known text value - Delimiters to use when splitting fields in the text file. The delimiter can be more than one character. These characters are used in addition to the comma, tab, space, colon, and semicolon options. + Name of the field containing well known text value - Delimiters to use when splitting fields in the text file. The delimiter can be more than one character. These characters are used in addition to the comma, tab, space, colon, and semicolon options. - - - 10 + Name of the field containing well known text value - - - - - - Quote + + false - - - The quote character(s) enclose fields which may include delimiters and new lines - - - The quote character(s) enclose fields which may include delimiters and new lines - - - The quote character(s) enclose fields which may include delimiters and new lines - - - " - - - 10 + + + true - - - - - Escape + Geometry type - - - The escape character(s) force the next character to be treated as a normal character (that is not a delimiter, quote, or new line character). If the escape character is the same as a quote character, it only escapes itself and only within quotes. - - - The escape character(s) force the next character to be treated as a normal character (that is not a delimiter, quote, or new line character). If the escape character is the same as a quote character, it only escapes itself and only within quotes. - - - The escape character(s) force the next character to be treated as a normal character (that is not a delimiter, quote, or new line character). If the escape character is the same as a quote character, it only escapes itself and only within quotes. - - - " + + + true - - 10 + + 0 + + + Detect + + + + + Point + + + + + Line + + + + + Polygon + + - + Qt::Horizontal - 40 - 20 + 0 + 0 @@ -320,538 +391,31 @@ - - - - - - - false - - - - 0 - 0 - - - - - 32767 - 32767 - - - - Regular expression used to split each line into fields - - - Regular expression used to split each line into fields - - - Regular expression used to split each line into fields - - - - - - - color: rgb(255, 0, 0); - - - - - - - - - - - - File format - - - - - - - - - - true - - - QFrame::Box - - - QFrame::Sunken - - - - 4 - - - 3 - - - - - Geometry definition - - - - - - - - - true - - - Geometry is a point defined by X and Y coordinate fields - - - Geometry is a point defined by X and Y coordinate fields - - - Geometry is a point defined by X and Y coordinate fields - - - Point coordinates - - - true - - - - - - - true - - - <p align="right">X field</p> - - - - - - - true - - - - 0 - 0 - - - - - 120 - 0 - - - - Name of the field containing x values - - - Name of the field containing x values - - - Name of the field containing x values - - - false - - - - - - - true - - - <p align="right">Y field</p> - - - - - - - true - - - - 0 - 0 - - - - - 120 - 0 - - - - Name of the field containing y values - - - Name of the field containing y values - - - Name of the field containing y values - - - false - - - - - - - X and Y coordinates are expressed in degrees/minutes/seconds - - - X and Y coordinates are expressed in degrees/minutes/seconds - - - X and Y coordinates are expressed in degrees/minutes/seconds - - - DMS coordinates - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - 0 - - - - - true - - - Geometry is read as a well known text string from the selected fields - - - Geometry is read as a well known text string from the selected fields - - - Geometry is read as a well known text string from the selected fields - - - Well known text (WKT) - - - - - - - Geometry field - - - - - - - false - - - - 0 - 0 - - - - - 120 - 0 - - - - Name of the field containing well known text value - - - Name of the field containing well known text value - - - Name of the field containing well known text value - - - false - - - - - - - false - - - Geometry type - - - - - - - false - - - 0 - - - - Detect - - - - - Point - - - - - Line - - - - - Polygon - - - - - - - - Qt::Horizontal - - - - 177 - 20 - - - - - - - - - - 0 - - - - - The file contains only attribute information - it will not be displayed on the map - - - The file contains only attribute information - it will not be displayed on the map - - - The file contains only attribute information - it will not be displayed on the map - - - No geometry (attribute only table) - - - - - - - - - - - - true - - - - 0 - - - - - 0 - - - - - - 0 - 0 - - - - File Name - - - 0 - - - - - - - Full path to the delimited text file - - - Full path to the delimited text file. In order to properly parse the fields in the file, the delimiter must be defined prior to entering the file name. Use the Browse button to the right of this field to choose the input file. - - - false - - - - - - - true - - - - 16777215 - 16777215 - - - - Browse to find the delimited text file to be processed - - - Use this button to browse to the location of the delimited text file. This button will not be enabled until a delimiter has been entered in the <i>Delimiter</i> box. Once a file is chosen, the X and Y field drop-down boxes will be populated with the fields from the delimited text file. - - - Browse... - - - false - - - - - - - - - 0 - - - - - - 0 - 0 - - - - Layer name - - - - - - - Name to display in the map legend - - - Name displayed in the map legend - - - - - - - Encoding - - - - - - - Select the file encoding - - - Select the file encoding - - - Select the file encoding - - - QComboBox::InsertAtTop - - - - - - - - - - - - - 3 - - - 0 - - - - - - - - - - - Qt::Horizontal - - - QDialogButtonBox::Cancel|QDialogButtonBox::Help|QDialogButtonBox::Ok - - - - - - - Sample data - - - - - - - 3 - - - 0 - - + + + + Record options - + + + + Field options + + + + + + + File format + + + + 9 @@ -865,57 +429,231 @@ - Number of header lines to discard + Number of header lines to discard + + + + + + + + 0 + 0 + + + + + 16777215 + 16777215 + + + + The number of lines to discard from the beginning of the file + + + The number of lines to discard from the beginning of the file + + + The number of lines to discard from the beginning of the file + + + false + + + 9999 + + + 0 + + + + + + + Field names are read from the first record. If not selected then fields are numbered + + + Field names are read from the first record. If not selected then fields are numbered + + + Field names are read from the first record. If not selected then fields are numbered + + + First record has field names + + + true + + + + + + + Qt::Horizontal + + + + 0 + 0 + + + + + + + + + + 0 + + + 0 + + + + + The file a comma separated value file, fields delimited by commas and quoted by " + + + The file a comma separated value file, fields delimited by commas and quoted by " + + + The file a comma separated value file, fields delimited by commas and quoted by " + + + CSV (comma separated values) + + + true + + + + + + + Fields are defined by the specified delimiter, quote, and escape characters + + + Fields are defined by the specified delimiter, quote, and escape characters + + + Fields are defined by the specified delimiter, quote, and escape characters + + + Custom delimiters + + + false + + + + + + + + 0 + 0 + + + + Each line in the file is split using a regular expression to define the end of each field + + + Each line in the file is split using a regular expression to define the end of each field + + + Each line in the file is split using a regular expression to define the end of each field + + + Regular expression delimiter + + + + + + + + + 0 + + + + + Use a spatial index to improve performance of displaying and spatially selecting features + + + Use a spatial index to improve performance of displaying and spatially selecting features + + + Use a spatial index to improve performance of displaying and spatially selecting features + + + Use spatial index + + + + + + + Use an index to improve performance of subset queries (set in layer properties) + + + Use an index to improve performance of subset queries (set in layer properties) + + + Use an index to improve performance of subset queries (set in layer properties) + + + Use subset index - - - - 0 - 0 - - - - - 16777215 - 16777215 - - + - The number of lines to discard from the beginning of the file + Watch for changes to the file by other applications while QGIS is running - The number of lines to discard from the beginning of the file + Watch for changes to the file by other applications while QGIS is running - The number of lines to discard from the beginning of the file - - - false - - - 9999 + Watch for changes to the file by other applications while QGIS is running - - 0 + + Watch file + + + + + + Geometry definition + + + + + + + 0 + - + + + true + - Field names are read from the first record. If not selected then fields are numbered + Geometry is a point defined by X and Y coordinate fields - Field names are read from the first record. If not selected then fields are numbered + Geometry is a point defined by X and Y coordinate fields - Field names are read from the first record. If not selected then fields are numbered + Geometry is a point defined by X and Y coordinate fields - First record has field names + Point coordinates true @@ -923,28 +661,43 @@ - - - Qt::Horizontal + + + true - - - 40 - 20 - + + Geometry is read as a well known text string from the selected fields - + + Geometry is read as a well known text string from the selected fields + + + Geometry is read as a well known text string from the selected fields + + + Well known text (WKT) + + + + + + + The file contains only attribute information - it will not be displayed on the map + + + The file contains only attribute information - it will not be displayed on the map + + + The file contains only attribute information - it will not be displayed on the map + + + No geometry (attribute only table) + + - - - - Field options - - - - + @@ -1004,16 +757,349 @@ - 40 - 20 + 0 + 0 + + + + 2 + + + + + + + + 0 + + + + + QFrame::Box + + + QFrame::Sunken + + + + 0 + + + 2 + + + + + 0 + + + + + Comma character is one of the delimiters + + + Comma character is one of the delimiters + + + Comma character is one of the delimiters + + + Comma + + + + + + + Tab character is one of the delimiters + + + Tab character is one of the delimiters + + + Tab character is one of the delimiters + + + Tab + + + true + + + + + + + Space character is one of the delimiters + + + Space character is one of the delimiters + + + Space character is one of the delimiters + + + Space + + + false + + + + + + + Colon character is one of the delimiters + + + Colon character is one of the delimiters + + + Colon character is one of the delimiters + + + Colon + + + + + + + Semicolon character is one of the delimiters + + + Semicolon character is one of the delimiters + + + Semicolon character is one of the delimiters + + + Semicolon + + + + + + + + + 0 + + + + + Other delimiters + + + + + + + true + + + + 0 + 0 + + + + + 32767 + 32767 + + + + Delimiters to use when splitting fields in the text file. The delimiter can be more than one character. These characters are used in addition to the comma, tab, space, colon, and semicolon options. + + + Delimiters to use when splitting fields in the text file. The delimiter can be more than one character. These characters are used in addition to the comma, tab, space, colon, and semicolon options. + + + Delimiters to use when splitting fields in the text file. The delimiter can be more than one character. These characters are used in addition to the comma, tab, space, colon, and semicolon options. + + + 10 + + + + + + + Quote + + + + + + + The quote character(s) enclose fields which may include delimiters and new lines + + + The quote character(s) enclose fields which may include delimiters and new lines + + + The quote character(s) enclose fields which may include delimiters and new lines + + + " + + + 10 + + + + + + + Escape + + + + + + + The escape character(s) force the next character to be treated as a normal character (that is not a delimiter, quote, or new line character). If the escape character is the same as a quote character, it only escapes itself and only within quotes. + + + The escape character(s) force the next character to be treated as a normal character (that is not a delimiter, quote, or new line character). If the escape character is the same as a quote character, it only escapes itself and only within quotes. + + + The escape character(s) force the next character to be treated as a normal character (that is not a delimiter, quote, or new line character). If the escape character is the same as a quote character, it only escapes itself and only within quotes. + + + " + + + 10 + + + + + + + Qt::Horizontal + + + + 0 + 0 + + + + + + + + + + + + + + + 0 + + + + + + + Expression + + + + + + + true + + + + 0 + 0 + + + + + 32767 + 32767 + + + + Regular expression used to split each line into fields + + + Regular expression used to split each line into fields + + + Regular expression used to split each line into fields + + + + + + + + + color: rgb(255, 0, 0); + + + + + + + + + + + + + + Layer settings + + + + + + + + 3 + + + 0 + + + + + + + + + + + Sample data + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Help|QDialogButtonBox::Ok + + + @@ -1024,6 +1110,7 @@ cmbEncoding delimiterCSV delimiterChars + delimiterRegexp cbxDelimComma cbxDelimTab cbxDelimSpace @@ -1032,7 +1119,6 @@ txtDelimiterOther txtQuoteChars txtEscapeChars - delimiterRegexp txtDelimiterRegexp rowCounter cbxUseHeader @@ -1040,175 +1126,34 @@ cbxSkipEmptyFields cbxPointIsComma geomTypeXY + geomTypeWKT + geomTypeNone cmbXField cmbYField cbxXyDms - geomTypeWKT cmbWktField cmbGeometryType - geomTypeNone + cbxSpatialIndex + cbxSubsetIndex + cbxWatchFile tblSample buttonBox - delimiterRegexp - toggled(bool) - txtDelimiterRegexp - setEnabled(bool) - - - 141 - 217 - - - 382 - 216 - - - - - geomTypeXY - toggled(bool) - cmbXField - setEnabled(bool) - - - 107 - 338 - - - 310 - 340 - - - - - geomTypeXY - toggled(bool) - cmbYField - setEnabled(bool) - - - 107 - 338 - - - 478 - 340 - - - - - geomTypeWKT - toggled(bool) - cmbWktField - setEnabled(bool) - - - 109 - 369 - - - 353 - 371 - - - - - delimiterChars - toggled(bool) - frameDelimiterCharacters - setEnabled(bool) - - - 89 - 155 - - - 181 - 146 - - - - - geomTypeWKT - toggled(bool) - cmbGeometryType - setEnabled(bool) - - - 73 - 369 - - - 521 - 371 - - - - - geomTypeXY - toggled(bool) - textLabelx - setEnabled(bool) - - - 66 - 338 - - - 184 - 340 - - - - - geomTypeXY - toggled(bool) - textLabely - setEnabled(bool) - - - 83 - 338 - - - 352 - 340 - - - - - geomTypeWKT - toggled(bool) - label - setEnabled(bool) - - - 72 - 369 - - - 442 - 371 - - - - - geomTypeXY + geomTypeNone toggled(bool) - cbxXyDms - setEnabled(bool) + cbxSpatialIndex + setDisabled(bool) - 54 - 338 + 496 + 253 - 608 - 338 + 255 + 317 diff --git a/tests/src/python/test_qgsdelimitedtextprovider.py b/tests/src/python/test_qgsdelimitedtextprovider.py index 8a737f32e79d..e041e49e1c84 100644 --- a/tests/src/python/test_qgsdelimitedtextprovider.py +++ b/tests/src/python/test_qgsdelimitedtextprovider.py @@ -512,7 +512,7 @@ def test_027_filter_attributes(self): def test_028_substring_test(self): # CSV file parsing filename='test.csv' - params={'geomType': 'none', 'subset': 'id % 2 = 1', 'type': 'csv'} + params={'geomType': 'none', 'subset': 'id % 2 = 1', 'type': 'csv' } requests=None runTest(filename,requests,**params) @@ -532,7 +532,7 @@ def updatefile2( layer ): QCoreApplication.instance().processEvents() def deletefile( layer ): os.remove(filename) - params={'geomType': 'none', 'type': 'csv' } + params={'geomType': 'none', 'type': 'csv', 'watchFile' : 'yes' } requests=[ {'fid': 3}, {}, diff --git a/tests/src/python/test_qgsdelimitedtextprovider_wanted.py b/tests/src/python/test_qgsdelimitedtextprovider_wanted.py index db939e3b742d..329d663c3184 100644 --- a/tests/src/python/test_qgsdelimitedtextprovider_wanted.py +++ b/tests/src/python/test_qgsdelimitedtextprovider_wanted.py @@ -1232,7 +1232,7 @@ def test_028_substring_test(): def test_029_file_watcher(): wanted={} - wanted['uri']=u'file://file?geomType=none&type=csv' + wanted['uri']=u'file://file?geomType=none&type=csv&watchFile=yes' wanted['data']={ 3L: { 'id': u'2',