The example text file uses | as delimter. Any character can be used to
- delimit the fields.
-
The first row is the header row. It contains the fields name, latdec, longdec, and cell
-
No quotes (") are used to delimit text fields
-
The x coordinates are contained in the longdec field
-
The y coordinates are contained in the latdec field
-
-
-
Using the Plugin
- To use the plugin you must have QGIS running and use the Plugin Manager to load the plugin:
-
-
Start QGIS
-
Open the Plugin Manager by choosing the Tools|Plugin Manager menu. The
- Plugin Manager displays a list of available plugins. Plugins that are already loaded have
- a checkmark to the left of their name. Click on the checkbox to the left of the Add Delimited Text
- Layer plugin and click Ok to load it.
-
-
-
A new toolbar icon is now present:
-
-
Click on the icon to open the Delimited Text dialog:
-
-
-
-
-
First select the file to import by clicking on the ellipsis button:
-
Select the desired text file from the file dialog
-
Once the file is selected, the plugin attempts to parse the file using the last used delimiter, in this case |
-
-
In this case the delimiter | is not correct for the file. The file is actually tab delimited. Note that the X and Y field drop down boxes do not contain valid field names.
-
To properly parse the file, change the delimiter to tab using \t (this is a regular expression for the tab character). After changing the delimiter, click Parse
-
The drop down boxes now contain the fields properly parsed:
-
-
Choose the X and Y fields from the drop down boxes and enter a Layer name
-
-
Click Add Layer
-
The layer is added to the map:
-
-
-
-
diff --git a/doc/plugins/delimited_text/layer_added.png b/doc/plugins/delimited_text/layer_added.png
deleted file mode 100644
index f91bdf8df4d1..000000000000
Binary files a/doc/plugins/delimited_text/layer_added.png and /dev/null differ
diff --git a/doc/plugins/delimited_text/plugin_manager.png b/doc/plugins/delimited_text/plugin_manager.png
deleted file mode 100644
index 4c9eb4fb1b4e..000000000000
Binary files a/doc/plugins/delimited_text/plugin_manager.png and /dev/null differ
diff --git a/doc/plugins/delimited_text/toolbar_icon.png b/doc/plugins/delimited_text/toolbar_icon.png
deleted file mode 100644
index 75a6b36431a8..000000000000
Binary files a/doc/plugins/delimited_text/toolbar_icon.png and /dev/null differ
diff --git a/images/images.qrc b/images/images.qrc
index c7f06ce5e8ff..d755cafa34b9 100644
--- a/images/images.qrc
+++ b/images/images.qrc
@@ -140,6 +140,7 @@
themes/default/mActionAddWcsLayer.pngthemes/default/mActionAddWfsLayer.pngthemes/default/mActionAddWmsLayer.png
+ themes/default/mActionAddDelimitedTextLayer.pngthemes/default/mActionAlignBottom.pngthemes/default/mActionAlignHCenter.pngthemes/default/mActionAlignLeft.png
@@ -360,7 +361,6 @@
themes/default/plugin.pngthemes/default/plugins/coordinate_capture/coordinate_capture.pngthemes/default/plugins/copyright_label.png
- themes/default/plugins/delimited_text.pngthemes/default/plugins/dxf2shp_converter.pngthemes/default/plugins/gps_importer.pngthemes/default/plugins/gps_importer/create_gpx.png
diff --git a/images/themes/default/plugins/delimited_text.png b/images/themes/default/mActionAddDelimitedTextLayer.png
similarity index 100%
rename from images/themes/default/plugins/delimited_text.png
rename to images/themes/default/mActionAddDelimitedTextLayer.png
diff --git a/resources/context_help/QgsDelimitedTextSourceSelect-en_US b/resources/context_help/QgsDelimitedTextSourceSelect-en_US
index 48e65cbd98f4..045d05b333e6 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:
+
+
Use spatial index. Create a spatial index to improve the performance of displaying and selecting spatial objects.
+This option may be useful for files larger than a few megabytes in size.
+
Use subset index. Create an index if a subset of records is being used (either by explicitly setting a subset string
+from the layer properties dialog, or an implicit subset of features for which the geometry is valid in files
+for which all not geometries are valid). The index will only be created when a subset is defined.
+
Watch file. If this options is selected QGIS will watch the file for changes by other applications, and
+reload the file when it is changed. The map will not be updated until refreshed by the user, but indexes and
+extents will be reloaded. This option should be selected if indexes are used and it is likely that another
+application will change the file.
Records are split into fields using three character sets:
@@ -146,10 +159,10 @@ is invalid if it does not have capture groups. As an example this can be used a
unintuitive) means of loading data with fixed width fields. For example the
expression
will extract four fields of widths 5, 10, 20, and 20 characters from each line.
-Lines less than 45 characters long will be discarded.
+Lines less than 55 characters long will be discarded.
-from PyQt4.QtCore import QUrl, QString
-from qgis.core import QgsVectorLayer, QgsMapLayerRegistry
-
-# Define the data source
-filename="test.csv"
-uri=QUrl.fromLocalFile(filename)
-uri.addQueryItem("type","csv")
-uri.addQueryItem("delimiter","|")
-uri.addQueryItem("wktField","wkt")
-# ... other delimited text parameters
-layer=QgsVectorLayer(QString(uri.toEncoded()),"Test CSV layer","delimitedtext")
-# Add the layer to the map
-if layer.isValid():
- QgsMapLayerRegistry.instance().addMapLayer( layer )
+from PyQt4.QtCore import QUrl, QString
+from qgis.core import QgsVectorLayer, QgsMapLayerRegistry
+
+# Define the data source
+filename="test.csv"
+uri=QUrl.fromLocalFile(filename)
+uri.addQueryItem("type","csv")
+uri.addQueryItem("delimiter","|")
+uri.addQueryItem("wktField","wkt")
+# ... other delimited text parameters
+layer=QgsVectorLayer(QString(uri.toEncoded()),"Test CSV layer","delimitedtext")
+# Add the layer to the map
+if layer.isValid():
+ QgsMapLayerRegistry.instance().addMapLayer( layer )
This could be used to load the second example file above.
The configuration of the delimited text layer is defined by adding query items to the uri.
@@ -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/app/qgisapp.cpp b/src/app/qgisapp.cpp
index 1138d4b06190..a02eafc314e0 100644
--- a/src/app/qgisapp.cpp
+++ b/src/app/qgisapp.cpp
@@ -981,6 +981,7 @@ void QgisApp::createActions()
connect( mActionAddWmsLayer, SIGNAL( triggered() ), this, SLOT( addWmsLayer() ) );
connect( mActionAddWcsLayer, SIGNAL( triggered() ), this, SLOT( addWcsLayer() ) );
connect( mActionAddWfsLayer, SIGNAL( triggered() ), this, SLOT( addWfsLayer() ) );
+ connect( mActionAddDelimitedText, SIGNAL( triggered()), this, SLOT(addDelimitedTextLayer()));
connect( mActionOpenTable, SIGNAL( triggered() ), this, SLOT( attributeTable() ) );
connect( mActionOpenFieldCalc, SIGNAL( triggered() ), this, SLOT( fieldCalculator() ) );
connect( mActionToggleEditing, SIGNAL( triggered() ), this, SLOT( toggleEditing() ) );
@@ -2973,6 +2974,31 @@ void QgisApp::addSpatiaLiteLayer()
delete dbs;
} // QgisApp::addSpatiaLiteLayer()
+void QgisApp::addDelimitedTextLayer()
+{
+ if ( mMapCanvas && mMapCanvas->isDrawing() )
+ {
+ return;
+ }
+
+ // show the Delimited text dialog
+ QDialog *dts = dynamic_cast( QgsProviderRegistry::instance()->selectWidget( "delimitedtext", this ) );
+ if ( !dts )
+ {
+ QMessageBox::warning( this, tr( "DelimitedText" ), tr( "Cannot get Delimited Text select dialog from provider." ) );
+ return;
+ }
+ connect( dts, SIGNAL( addVectorLayer( QString, QString, QString ) ),
+ this, SLOT( addSelectedVectorLayer( QString, QString, QString ) ) );
+ dts->exec();
+ delete dts;
+} // QgisApp::addDelimitedTextLayer()
+
+void QgisApp::addSelectedVectorLayer( QString uri, QString layerName, QString provider )
+{
+ addVectorLayer( uri, layerName, provider );
+} // QgisApp:addSelectedVectorLayer
+
void QgisApp::addMssqlLayer()
{
#ifdef HAVE_MSSQL
diff --git a/src/app/qgisapp.h b/src/app/qgisapp.h
index bd315659b138..2478342e01d2 100644
--- a/src/app/qgisapp.h
+++ b/src/app/qgisapp.h
@@ -115,7 +115,7 @@ class QgisApp : public QMainWindow, private Ui::MainWindow
*/
QgsVectorLayer* addVectorLayer( QString vectorLayerPath, QString baseName, QString providerKey );
- /** \brief overloaded vesion of the privat addLayer method that takes a list of
+ /** \brief overloaded version of the private addLayer method that takes a list of
* file names instead of prompting user with a dialog.
@param enc encoding type for the layer
@param dataSourceType type of ogr datasource
@@ -626,6 +626,10 @@ class QgisApp : public QMainWindow, private Ui::MainWindow
void addDatabaseLayers( QStringList const & layerPathList, QString const & providerKey );
//! Add a SpatiaLite layer to the map
void addSpatiaLiteLayer();
+ //! Add a Delimited Text layer to the map
+ void addDelimitedTextLayer();
+ //! Add a vector layer defined by uri, layer name, data source uri
+ void addSelectedVectorLayer(QString uri, QString layerName, QString provider );
//#ifdef HAVE_MSSQL
//! Add a MSSQL layer to the map
void addMssqlLayer();
diff --git a/src/core/qgsvectorlayer.h b/src/core/qgsvectorlayer.h
index d9048a30b94d..3ffc5d03922f 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/plugins/CMakeLists.txt b/src/plugins/CMakeLists.txt
index 171cb172a56a..6eddd3b127e2 100644
--- a/src/plugins/CMakeLists.txt
+++ b/src/plugins/CMakeLists.txt
@@ -2,7 +2,6 @@
SET (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${QGIS_OUTPUT_DIRECTORY}/${QGIS_PLUGIN_SUBDIR})
SET (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${QGIS_OUTPUT_DIRECTORY}/${QGIS_PLUGIN_SUBDIR})
-ADD_SUBDIRECTORY(delimited_text)
ADD_SUBDIRECTORY(diagram_overlay)
ADD_SUBDIRECTORY(interpolation)
ADD_SUBDIRECTORY(oracle_raster)
diff --git a/src/plugins/delimited_text/CMakeLists.txt b/src/plugins/delimited_text/CMakeLists.txt
deleted file mode 100644
index c15dfc731872..000000000000
--- a/src/plugins/delimited_text/CMakeLists.txt
+++ /dev/null
@@ -1,39 +0,0 @@
-
-########################################################
-# Files
-
-SET (DLTEXT_SRCS qgsdelimitedtextplugin.cpp)
-
-SET (DLTEXT_MOC_HDRS qgsdelimitedtextplugin.h)
-
-SET (DLTEXT_RCCS delimited_text.qrc)
-
-########################################################
-# Build
-
-QT4_WRAP_CPP (DLTEXT_MOC_SRCS ${DLTEXT_MOC_HDRS})
-
-QT4_ADD_RESOURCES(DLTEXT_RCC_SRCS ${DLTEXT_RCCS})
-
-ADD_LIBRARY (delimitedtextplugin MODULE ${DLTEXT_SRCS} ${DLTEXT_MOC_SRCS} ${DLTEXT_RCC_SRCS})
-
-INCLUDE_DIRECTORIES(
- ${CMAKE_CURRENT_BINARY_DIR}
- ../../core ../../core/raster
- ../../gui
- ..
- ../../providers/delimitedtext/delimitedtext
-)
-
-TARGET_LINK_LIBRARIES(delimitedtextplugin
- qgis_core
- qgis_gui
-)
-
-
-########################################################
-# Install
-
-INSTALL(TARGETS delimitedtextplugin
- RUNTIME DESTINATION ${QGIS_PLUGIN_DIR}
- LIBRARY DESTINATION ${QGIS_PLUGIN_DIR})
diff --git a/src/plugins/delimited_text/delimitedText.svg b/src/plugins/delimited_text/delimitedText.svg
deleted file mode 100644
index 2522c45a2fd2..000000000000
--- a/src/plugins/delimited_text/delimitedText.svg
+++ /dev/null
@@ -1,125 +0,0 @@
-
-
-
diff --git a/src/plugins/delimited_text/delimited_text.png b/src/plugins/delimited_text/delimited_text.png
deleted file mode 100644
index ef4e03385e8f..000000000000
Binary files a/src/plugins/delimited_text/delimited_text.png and /dev/null differ
diff --git a/src/plugins/delimited_text/delimited_text.qrc b/src/plugins/delimited_text/delimited_text.qrc
deleted file mode 100644
index 702e738e4ae7..000000000000
--- a/src/plugins/delimited_text/delimited_text.qrc
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
- delimited_text.png
-
-
diff --git a/src/plugins/delimited_text/qgsdelimitedtextplugin.cpp b/src/plugins/delimited_text/qgsdelimitedtextplugin.cpp
deleted file mode 100644
index 33469c8968b0..000000000000
--- a/src/plugins/delimited_text/qgsdelimitedtextplugin.cpp
+++ /dev/null
@@ -1,229 +0,0 @@
-/***************************************************************************
- qgsdelimitedtextplugin.cpp
- Import tool for various worldmap analysis output files
-Functions:
-
--------------------
- begin : Feb 21, 2004
- copyright : (C) 2004 by Gary Sherman
- email : sherman at mrcc.com
-
- ***************************************************************************/
-
-/***************************************************************************
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- ***************************************************************************/
-
-// includes
-
-#include "qgisinterface.h"
-#include "qgisgui.h"
-#include "qgsapplication.h"
-#include "qgsmaplayer.h"
-#include "qgsproviderregistry.h"
-#include "qgsdelimitedtextplugin.h"
-
-#include
-#include
-#include
-#include
-#include
-
-static const QString pluginVersion = QObject::tr( "Version 0.2" );
-static const QString description_ = QObject::tr( "Loads and displays delimited text files containing x,y coordinates" );
-static const QString category_ = QObject::tr( "Layers" );
-static const QString icon_ = ":/delimited_text.png";
-
-/**
- * Constructor for the plugin. The plugin is passed a pointer to the main app
- * and an interface object that provides access to exposed functions in QGIS.
- * @param qgis Pointer to the QGIS main window
- * @param _qI Pointer to the QGIS interface object
- */
-QgsDelimitedTextPlugin::QgsDelimitedTextPlugin( QgisInterface * theQgisInterFace )
- : qGisInterface( theQgisInterFace )
-{
- /** Initialize the plugin and set the required attributes */
- pluginNameQString = tr( "DelimitedTextLayer" );
- pluginVersionQString = pluginVersion;
- pluginDescriptionQString = description_;
- pluginCategoryQString = category_;
-}
-
-QgsDelimitedTextPlugin::~QgsDelimitedTextPlugin()
-{
-
-}
-
-/* Following functions return name, description, version, and type for the plugin */
-QString QgsDelimitedTextPlugin::name()
-{
- return pluginNameQString;
-}
-
-QString QgsDelimitedTextPlugin::version()
-{
- return pluginVersionQString;
-
-}
-
-QString QgsDelimitedTextPlugin::description()
-{
- return pluginDescriptionQString;
-
-}
-
-QString QgsDelimitedTextPlugin::category()
-{
- return pluginCategoryQString;
-
-}
-
-int QgsDelimitedTextPlugin::type()
-{
- return QgisPlugin::UI;
-}
-//method defined in interface
-void QgsDelimitedTextPlugin::help()
-{
- //implement me!
-}
-
-/*
- * Initialize the GUI interface for the plugin
- */
-void QgsDelimitedTextPlugin::initGui()
-{
- // Create the action for tool
- myQActionPointer = new QAction( QIcon(), tr( "&Add Delimited Text Layer" ), this );
- setCurrentTheme( "" );
- myQActionPointer->setWhatsThis( tr( "Add a delimited text file as a map layer. "
- "The file must have a header row containing the field names. "
- "The file must either contain X and Y fields with coordinates in decimal units or a WKT field." ) );
- // Connect the action to the run
- connect( myQActionPointer, SIGNAL( triggered() ), this, SLOT( run() ) );
- // Add the icon to the toolbar
- qGisInterface->layerToolBar()->addAction( myQActionPointer );
- qGisInterface->insertAddLayerAction( myQActionPointer );
- // this is called when the icon theme is changed
- connect( qGisInterface, SIGNAL( currentThemeChanged( QString ) ), this, SLOT( setCurrentTheme( QString ) ) );
-}
-
-// Slot called when the buffer menu item is activated
-void QgsDelimitedTextPlugin::run()
-{
- // show the DelimitedText dialog
- QDialog *dlg = dynamic_cast( QgsProviderRegistry::instance()->selectWidget( QString( "delimitedtext" ), qGisInterface->mainWindow() ) );
- if ( !dlg )
- {
- QMessageBox::warning( qGisInterface->mainWindow(), tr( "Delimited Text" ), tr( "Cannot get Delimited Text select dialog from provider." ) );
- return;
- }
- //listen for when the layer has been made so we can draw it
- connect( dlg, SIGNAL( addVectorLayer( QString, QString, QString ) ),
- this, SLOT( addVectorLayer( QString, QString, QString ) ) );
-
- dlg->exec();
- delete dlg;
-}
-
-//!add a vector layer - intended to respond to signal
-//sent by dialog when it as finished
-void QgsDelimitedTextPlugin::addVectorLayer( QString thePathNameQString,
- QString theBaseNameQString, QString theProviderQString )
-{
- qGisInterface->addVectorLayer( thePathNameQString,
- theBaseNameQString, theProviderQString );
-}
-
-// Unload the plugin by cleaning up the GUI
-void QgsDelimitedTextPlugin::unload()
-{
- // remove the GUI
- qGisInterface->layerToolBar()->removeAction( myQActionPointer );
- qGisInterface->removeAddLayerAction( myQActionPointer );
- delete myQActionPointer;
-}
-
-//! Set icons to the current theme
-void QgsDelimitedTextPlugin::setCurrentTheme( QString theThemeName )
-{
- Q_UNUSED( theThemeName );
- QString myCurThemePath = QgsApplication::activeThemePath() + "/plugins/delimited_text.png";
- QString myDefThemePath = QgsApplication::defaultThemePath() + "/plugins/delimited_text.png";
- QString myQrcPath = ":/delimited_text.png";
- if ( QFile::exists( myCurThemePath ) )
- {
- myQActionPointer->setIcon( QIcon( myCurThemePath ) );
- }
- else if ( QFile::exists( myDefThemePath ) )
- {
- myQActionPointer->setIcon( QIcon( myDefThemePath ) );
- }
- else if ( QFile::exists( myQrcPath ) )
- {
- myQActionPointer->setIcon( QIcon( myQrcPath ) );
- }
- else
- {
- myQActionPointer->setIcon( QIcon() );
- }
-}
-
-/**
- * Required extern functions needed for every plugin
- * These functions can be called prior to creating an instance
- * of the plugin class
- */
-// Class factory to return a new instance of the plugin class
-QGISEXTERN QgisPlugin * classFactory( QgisInterface * theQgisInterfacePointer )
-{
- return new QgsDelimitedTextPlugin( theQgisInterfacePointer );
-}
-
-// Return the name of the plugin - note that we do not user class members as
-// the class may not yet be insantiated when this method is called.
-QGISEXTERN QString name()
-{
- return QString( QObject::tr( "Add Delimited Text Layer" ) );
-}
-
-// Return the description
-QGISEXTERN QString description()
-{
- return description_;
-}
-
-// Return the category
-QGISEXTERN QString category()
-{
- return category_;
-}
-
-// Return the type (either UI or MapLayer plugin)
-QGISEXTERN int type()
-{
- return QgisPlugin::UI;
-}
-
-// Return the version number for the plugin
-QGISEXTERN QString version()
-{
- return pluginVersion;
-}
-
-QGISEXTERN QString icon()
-{
- return icon_;
-}
-
-// Delete ourself
-QGISEXTERN void unload( QgisPlugin * theQgsDelimitedTextPluginPointer )
-{
- delete theQgsDelimitedTextPluginPointer;
-}
diff --git a/src/plugins/delimited_text/qgsdelimitedtextplugin.h b/src/plugins/delimited_text/qgsdelimitedtextplugin.h
deleted file mode 100644
index a473db7bc7d2..000000000000
--- a/src/plugins/delimited_text/qgsdelimitedtextplugin.h
+++ /dev/null
@@ -1,97 +0,0 @@
-/***************************************************************************
- qgsdelimitedtextplugin.h
- Functions:
- -------------------
- begin : Jan 21, 2004
- copyright : (C) 2004 by Tim Sutton
- email : tim@linfiniti.com
-
- ***************************************************************************/
-
-/***************************************************************************
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- ***************************************************************************/
-#ifndef PLUGIN
-#define PLUGIN
-#include
-
-#include "../qgisplugin.h"
-
-class QgisInterface;
-class QAction;
-
-/**
-* \class QgsDelimitedTextPlugin
-* \brief Delimited text plugin for QGIS
-*
-*/
-class QgsDelimitedTextPlugin: public QObject, public QgisPlugin
-{
- Q_OBJECT public:
- /**
- * Constructor for a plugin. The QgisInterface pointer is passed by
- * QGIS when it attempts to instantiate the plugin.
- * @param qI Pointer to the QgisInterface object
- */
- QgsDelimitedTextPlugin( QgisInterface * );
- /**
- * Virtual function to return the name of the plugin. The name will be used when presenting a list
- * of installable plugins to the user
- */
- virtual QString name();
- /**
- * Virtual function to return the version of the plugin.
- */
- virtual QString version();
- /**
- * Virtual function to return a description of the plugins functions
- */
- virtual QString description();
- /**
- * Virtual function to return a plugin category
- */
- virtual QString category();
- /**
- * Return the plugin type
- */
- virtual int type();
- //! Destructor
- virtual ~ QgsDelimitedTextPlugin();
- public slots:
- //! init the gui
- virtual void initGui();
- //! Show the dialog box
- void run();
- //! Add a vector layer given vectorLayerPath, baseName, providerKey (i.e. delimitedtext)
- void addVectorLayer( QString, QString, QString );
- //! unload the plugin
- void unload();
- //! show the help document
- void help();
- //! update the plugins theme when the app tells us its theme is changed
- void setCurrentTheme( QString theThemeName );
- private:
-
-
- //! Name of the plugin
- QString pluginNameQString;
- //! Version
- QString pluginVersionQString;
- //! Descrption of the plugin
- QString pluginDescriptionQString;
- //! Category of the plugin
- QString pluginCategoryQString;
- //! Plugin type as defined in Plugin::PLUGINTYPE
- int pluginType;
- //! Pointer to the QGIS interface object
- QgisInterface *qGisInterface;
- //! Pointer to the QAction object used in the menu and toolbar
- QAction *myQActionPointer;
-};
-
-#endif
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..f38d20d246cc 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 );
@@ -529,10 +553,10 @@ void QgsDelimitedTextSourceSelect::updateFieldLists()
( cmbXField->currentIndex() >= 0 && cmbYField->currentIndex() >= 0 ) );
geomTypeXY->setChecked( isXY );
geomTypeWKT->setChecked( ! isXY );
+ swGeomType->setCurrentIndex( bgGeomType->checkedId() );
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/qgisapp.ui b/src/ui/qgisapp.ui
index 7bd0711f66bf..d57a0620efcd 100644
--- a/src/ui/qgisapp.ui
+++ b/src/ui/qgisapp.ui
@@ -160,6 +160,7 @@
+
@@ -287,6 +288,7 @@
+
@@ -2087,6 +2089,18 @@ Acts on currently active editable layer
Open Field Calculator
+
+
+
+ :/images/themes/default/mActionAddDelimitedTextLayer.png:/images/themes/default/mActionAddDelimitedTextLayer.png
+
+
+ Add Delimited Text Layer...
+
+
+ Add Delimited Text Layer
+
+
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 @@
00
- 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 coordinatestrue
@@ -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 @@
cmbEncodingdelimiterCSVdelimiterChars
+ delimiterRegexpcbxDelimCommacbxDelimTabcbxDelimSpace
@@ -1032,7 +1119,6 @@
txtDelimiterOthertxtQuoteCharstxtEscapeChars
- delimiterRegexptxtDelimiterRegexprowCountercbxUseHeader
@@ -1040,175 +1126,34 @@
cbxSkipEmptyFieldscbxPointIsCommageomTypeXY
+ geomTypeWKT
+ geomTypeNonecmbXFieldcmbYFieldcbxXyDms
- geomTypeWKTcmbWktFieldcmbGeometryType
- geomTypeNone
+ cbxSpatialIndex
+ cbxSubsetIndex
+ cbxWatchFiletblSamplebuttonBox
- 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
+ geomTypeNonetoggled(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',