Skip to content
Permalink
Browse files

Use SpatiaLite right spelling when needed

  • Loading branch information
DelazJ committed Jul 6, 2017
1 parent 0c96792 commit 6fab688298e96397dd833da257aee7ec0d932e34
Showing with 112 additions and 112 deletions.
  1. +1 −1 INSTALL
  2. +1 −1 README.md
  3. +1 −1 cmake/FindSpatiaLite.cmake
  4. +1 −1 python/analysis/openstreetmap/qgsosmdatabase.sip
  5. +16 −16 python/core/qgsvectorlayer.sip
  6. +2 −2 python/plugins/db_manager/db_plugins/spatialite/connector.py
  7. +1 −1 python/plugins/db_manager/db_plugins/spatialite/plugin.py
  8. +1 −1 python/plugins/db_manager/dlg_sql_layer_window.py
  9. +1 −1 python/plugins/db_manager/dlg_sql_window.py
  10. +2 −2 python/plugins/processing/algs/help/qgis.yaml
  11. +1 −1 python/plugins/processing/algs/qgis/SpatialiteExecuteSQL.py
  12. +2 −2 python/plugins/processing/gui/DestinationSelectionPanel.py
  13. +2 −2 python/plugins/processing/tools/spatialite.py
  14. +4 −4 python/utils.py
  15. +1 −1 resources/context_help/QgsVectorLayerSaveAsDialog
  16. +2 −2 src/analysis/openstreetmap/qgsosmdatabase.h
  17. +1 −1 src/app/qgisapp.h
  18. +3 −3 src/app/qgsnewspatialitelayerdialog.cpp
  19. +1 −1 src/core/qgsconnectionpool.h
  20. +9 −9 src/core/qgsofflineediting.cpp
  21. +1 −1 src/core/qgsslconnect.cpp
  22. +1 −1 src/core/qgsslconnect.h
  23. +1 −1 src/core/qgssqliteexpressioncompiler.h
  24. +1 −1 src/core/qgsvectorfilewriter.cpp
  25. +16 −16 src/core/qgsvectorlayer.h
  26. +2 −2 src/plugins/spatialquery/qgsspatialquerydialog.cpp
  27. +1 −1 src/providers/grass/qgsgrass.cpp
  28. +1 −1 src/providers/ogr/qgsogrprovider.cpp
  29. +1 −1 src/providers/spatialite/qgsspatialiteconnpool.h
  30. +1 −1 src/providers/spatialite/qspatialite/README
  31. +5 −5 src/providers/virtual/qgsvirtuallayerblob.cpp
  32. +5 −5 src/providers/virtual/qgsvirtuallayerblob.h
  33. +1 −1 src/providers/virtual/qgsvirtuallayersourceselectbase.ui
  34. +3 −3 src/providers/virtual/qgsvirtuallayersqlitemodule.cpp
  35. +1 −1 src/providers/wfs/qgswfsprovider.h
  36. +5 −5 src/providers/wfs/qgswfsshareddata.cpp
  37. +2 −2 src/providers/wfs/qgswfsshareddata.h
  38. +2 −2 src/ui/qgsnewspatialitelayerdialogbase.ui
  39. +1 −1 src/ui/qgsspatialitesridsdialogbase.ui
  40. +1 −1 tests/src/python/test_layer_dependencies.py
  41. +2 −2 tests/src/python/test_provider_spatialite.py
  42. +2 −2 tests/src/python/test_provider_wfs.py
  43. +2 −2 tests/src/python/test_qgsdistancearea.py
  44. +1 −1 tests/src/python/test_qgspallabeling_base.py
@@ -1245,7 +1245,7 @@ osgEarth), try bypassing ccache.
=========================================================

Download William Kyngesburye's excellent GDAL Complete package that includes
PROJ, GEOS, GDAL, SQLite3, Spatialite, and image libraries, as frameworks.
PROJ, GEOS, GDAL, SQLite3, SpatiaLite, and image libraries, as frameworks.
There are also GSL and FreeType frameworks.

http://www.kyngchaos.com/software/frameworks
@@ -42,7 +42,7 @@ modified.
* PostgreSQL/PostGIS
* GRASS
* GeoPackage
* Spatialite
* SpatiaLite
* [Other OGR supported formats](http://www.gdal.org/ogr_formats.html)
* MSSQL
* Oracle
@@ -31,7 +31,7 @@ IF (APPLE)
SET (CMAKE_FIND_FRAMEWORK_save ${CMAKE_FIND_FRAMEWORK} CACHE STRING "" FORCE)
SET (CMAKE_FIND_FRAMEWORK "ONLY" CACHE STRING "" FORCE)
FIND_PATH(SPATIALITE_INCLUDE_DIR SQLite3/spatialite.h)
# if no spatialite header, we don't want sqlite find below to succeed
# if no SpatiaLite header, we don't want SQLite find below to succeed
IF (SPATIALITE_INCLUDE_DIR)
FIND_LIBRARY(SPATIALITE_LIBRARY SQLite3)
# FIND_PATH doesn't add "Headers" for a framework
@@ -41,7 +41,7 @@ class QgsOSMDatabase

void setFileName( const QString &dbFileName );
%Docstring
Setter for the spatialite database.
Setter for the SpatiaLite database.
%End
QString filename() const;
%Docstring
@@ -25,10 +25,10 @@ class QgsVectorLayer : QgsMapLayer, QgsExpressionContextGenerator, QgsFeatureSin
The QgsVectorLayer is instantiated by specifying the name of a data provider,
such as postgres or wfs, and url defining the specific data set to connect to.
The vector layer constructor in turn instantiates a QgsVectorDataProvider subclass
corresponding to the provider type, and passes it the url. The data provider
corresponding to the provider type, and passes it the url. The data provider
connects to the data source.

The QgsVectorLayer provides a common interface to the different data types. It also
The QgsVectorLayer provides a common interface to the different data types. It also
manages editing transactions.

Sample usage of the QgsVectorLayer class:
@@ -45,8 +45,8 @@ class QgsVectorLayer : QgsMapLayer, QgsExpressionContextGenerator, QgsFeatureSin
\subsection memory Memory data providerType (memory)

The memory data provider is used to construct in memory data, for example scratch
data or data generated from spatial operations such as contouring. There is no
inherent persistent storage of the data. The data source uri is constructed. The
data or data generated from spatial operations such as contouring. There is no
inherent persistent storage of the data. The data source uri is constructed. The
url specifies the geometry type ("point", "linestring", "polygon",
"multipoint","multilinestring","multipolygon"), optionally followed by url parameters
as follows:
@@ -59,35 +59,35 @@ class QgsVectorLayer : QgsMapLayer, QgsExpressionContextGenerator, QgsFeatureSin
Specifies that the layer will be constructed with a spatial index

- field=name:type(length,precision)
Defines an attribute of the layer. Multiple field parameters can be added
to the data provider definition. type is one of "integer", "double", "string".
Defines an attribute of the layer. Multiple field parameters can be added
to the data provider definition. type is one of "integer", "double", "string".

An example url is "Point?crs=epsg:4326&field=id:integer&field=name:string(20)&index=yes"

\subsection ogr OGR data provider (ogr)

Accesses data using the OGR drivers (http://www.gdal.org/ogr/ogr_formats.html). The url
is the OGR connection string. A wide variety of data formats can be accessed using this
is the OGR connection string. A wide variety of data formats can be accessed using this
driver, including file based formats used by many GIS systems, database formats, and
web services. Some of these formats are also supported by custom data providers listed
web services. Some of these formats are also supported by custom data providers listed
below.

\subsection spatialite Spatialite data provider (spatialite)
\subsection spatialite SpatiaLite data provider (spatialite)

Access data in a spatialite database. The url defines the connection parameters, table,
geometry column, and other attributes. The url can be constructed using the
Access data in a SpatiaLite database. The url defines the connection parameters, table,
geometry column, and other attributes. The url can be constructed using the
QgsDataSourceUri class.

\subsection postgres Postgresql data provider (postgres)
\subsection postgres PostgreSQL data provider (postgres)

Connects to a postgresql database. The url defines the connection parameters, table,
geometry column, and other attributes. The url can be constructed using the
Connects to a postgresql database. The url defines the connection parameters, table,
geometry column, and other attributes. The url can be constructed using the
QgsDataSourceUri class.

\subsection mssql Microsoft SQL server data provider (mssql)

Connects to a Microsoft SQL server database. The url defines the connection parameters, table,
geometry column, and other attributes. The url can be constructed using the
Connects to a Microsoft SQL server database. The url defines the connection parameters, table,
geometry column, and other attributes. The url can be constructed using the
QgsDataSourceUri class.

\subsection wfs WFS (web feature service) data provider (wfs)
@@ -82,7 +82,7 @@ def isValidDatabase(self, path):
return isValid

def _checkSpatial(self):
""" check if it's a valid spatialite db """
""" check if it's a valid SpatiaLite db """
self.has_spatial = self._checkGeometryColumnsTable()
return self.has_spatial

@@ -118,7 +118,7 @@ def getInfo(self):
return c.fetchone()

def getSpatialInfo(self):
""" returns tuple about spatialite support:
""" returns tuple about SpatiaLite support:
- lib version
- geos version
- proj version
@@ -90,7 +90,7 @@ def addConnection(self, conn_name, uri):
def addConnectionActionSlot(self, item, action, parent, index):
QApplication.restoreOverrideCursor()
try:
filename, selected_filter = QFileDialog.getOpenFileName(parent, "Choose Sqlite/Spatialite file")
filename, selected_filter = QFileDialog.getOpenFileName(parent, "Choose SQLite/SpatiaLite file")
if not filename:
return
finally:
@@ -80,7 +80,7 @@ def __init__(self, iface, layer, parent=None):
self.dbplugin = dbplugin
self.db = db
self.filter = ""
self.allowMultiColumnPk = isinstance(db, PGDatabase) # at the moment only PostgreSQL allows a primary key to span multiple columns, spatialite doesn't
self.allowMultiColumnPk = isinstance(db, PGDatabase) # at the moment only PostgreSQL allows a primary key to span multiple columns, SpatiaLite doesn't
self.aliasSubQuery = isinstance(db, PGDatabase) # only PostgreSQL requires subqueries to be aliases
self.setupUi(self)
self.setWindowTitle(
@@ -58,7 +58,7 @@ def __init__(self, iface, db, parent=None):
self.iface = iface
self.db = db
self.filter = ""
self.allowMultiColumnPk = isinstance(db, PGDatabase) # at the moment only PostgreSQL allows a primary key to span multiple columns, spatialite doesn't
self.allowMultiColumnPk = isinstance(db, PGDatabase) # at the moment only PostgreSQL allows a primary key to span multiple columns, SpatiaLite doesn't
self.aliasSubQuery = isinstance(db, PGDatabase) # only PostgreSQL requires subqueries to be aliases
self.setupUi(self)
self.setWindowTitle(
@@ -253,7 +253,7 @@ qgis:hypsometriccurves: >
This algorithm computes hypsometric curves for an input Digital Elevation Model. Curves are produced as table files in an output folder specified by the user.

qgis:importintospatialite: >
This algorithm imports a vector layer into a Spatialite database, creating a new table.
This algorithm imports a vector layer into a SpatiaLite database, creating a new table.

qgis:importintopostgis: >
This algorithm imports a vector layer into a PostGIS database, creating a new table.
@@ -405,7 +405,7 @@ qgis:polygonstolines: >
This algorithm takes a polygon layer and creates a line layer, with lines representing the rings of the polygons in the input layer.

qgis:spatialiteexecutesql: >
This algorithm performs a SQL database query on a Spatialite database.
This algorithm performs a SQL database query on a SpatiaLite database.

qgis:postgisexecutesql: >
This algorithm performs a SQL database query on a PostGIS database connected to QGIS.
@@ -53,7 +53,7 @@ def name(self):
return 'spatialiteexecutesql'

def displayName(self):
return self.tr('Spatialite execute SQL')
return self.tr('SpatiaLite execute SQL')

def processAlgorithm(self, parameters, context, feedback):
database = self.parameterAsVectorLayer(parameters, self.DATABASE, context)
@@ -129,7 +129,7 @@ def selectOutput(self):
if isinstance(self.parameter, QgsProcessingParameterFeatureSink) \
and self.alg.provider().supportsNonFileBasedOutput():
actionSaveToSpatialite = QAction(
self.tr('Save to Spatialite table...'), self.btnSelect)
self.tr('Save to SpatiaLite table...'), self.btnSelect)
actionSaveToSpatialite.triggered.connect(self.saveToSpatialite)
popupMenu.addAction(actionSaveToSpatialite)
actionSaveToPostGIS = QAction(
@@ -194,7 +194,7 @@ def saveToSpatialite(self):
path = ProcessingConfig.getSetting(ProcessingConfig.OUTPUT_FOLDER)

fileDialog = QgsEncodingFileDialog(
self, self.tr('Save Spatialite'), path, fileFilter, self.encoding)
self, self.tr('Save SpatiaLite'), path, fileFilter, self.encoding)
fileDialog.setFileMode(QFileDialog.AnyFile)
fileDialog.setAcceptMode(QFileDialog.AcceptSave)
fileDialog.setOption(QFileDialog.DontConfirmOverwrite, True)
@@ -63,14 +63,14 @@ def con_info(self):
return str(self.dbname)

def init_spatialite(self):
# Get spatialite version
# Get SpatiaLite version
c = self.con.cursor()
try:
self._exec_sql(c, u'SELECT spatialite_version()')
rep = c.fetchall()
v = [int(x) if x.isdigit() else x for x in re.findall("\d+|[a-zA-Z]+", rep[0][0])]

# Add spatialite support
# Add SpatiaLite support
if v >= [4, 1, 0]:
# 4.1 and above
sql = "SELECT initspatialmetadata(1)"
@@ -590,7 +590,7 @@ def startServerPlugin(packageName):


def spatialite_connect(*args, **kwargs):
"""returns a dbapi2.Connection to a spatialite db
"""returns a dbapi2.Connection to a SpatiaLite db
either using pyspatialite if it is present
or using the "mod_spatialite" extension (python3)"""
try:
@@ -601,11 +601,11 @@ def spatialite_connect(*args, **kwargs):
con.enable_load_extension(True)
cur = con.cursor()
libs = [
# Spatialite >= 4.2 and Sqlite >= 3.7.17, should work on all platforms
# SpatiaLite >= 4.2 and Sqlite >= 3.7.17, should work on all platforms
("mod_spatialite", "sqlite3_modspatialite_init"),
# Spatialite >= 4.2 and Sqlite < 3.7.17 (Travis)
# SpatiaLite >= 4.2 and Sqlite < 3.7.17 (Travis)
("mod_spatialite.so", "sqlite3_modspatialite_init"),
# Spatialite < 4.2 (linux)
# SpatiaLite < 4.2 (linux)
("libspatialite.so", "sqlite3_extension_init")
]
found = False
@@ -7,7 +7,7 @@
<li>At <label>Save as</label> you can enter a destination files name or select one using the <label>Browse</label> button.
<li>In the <label>Encoding</label> list you can define in which encoding the data should be saved.
<li>Using the <label>CRS</label> you can select a CRS into which the data about to be saved should be reprojected.
<li>OGR also has various options for the different formats it supports. Use the <label>datasource</label> creation field to set the datasource options and the <label>layer</label> creation options. Enter one options per line (e.g. <code>SPATIALITE=yes</code> in the <label>datasource</label> to create a spatialite database using the SQLite driver).
<li>OGR also has various options for the different formats it supports. Use the <label>datasource</label> creation field to set the datasource options and the <label>layer</label> creation options. Enter one options per line (e.g. <code>SpatiaLite=yes</code> in the <label>datasource</label> to create a SpatiaLite database using the SQLite driver).
</ul>

See <a href="http://gdal.org/ogr_formats.html">OGR Vector formats</a> for a list of supported formats and the available options.
@@ -56,7 +56,7 @@ class ANALYSIS_EXPORT QgsOSMDatabase
//! QgsOSMDatabase cannot be copied.
QgsOSMDatabase &operator=( const QgsOSMDatabase &rh ) = delete;

//! Setter for the spatialite database.
//! Setter for the SpatiaLite database.
void setFileName( const QString &dbFileName ) { mDbFileName = dbFileName; }
QString filename() const { return mDbFileName; }
bool isOpen() const;
@@ -89,7 +89,7 @@ class ANALYSIS_EXPORT QgsOSMDatabase

QgsPolyline wayPoints( QgsOSMId id ) const;

// export to spatialite
// export to SpatiaLite

enum ExportType { Point, Polyline, Polygon };
bool exportSpatiaLite( ExportType type, const QString &tableName,
@@ -1136,7 +1136,7 @@ class APP_EXPORT QgisApp : public QMainWindow, private Ui::MainWindow
void newVectorLayer();
//! Create a new memory layer
void newMemoryLayer();
//! Create a new empty spatialite layer
//! Create a new empty SpatiaLite layer
void newSpatialiteLayer();
//! Create a new empty GeoPackage layer
void newGeoPackageLayer();
@@ -1,6 +1,6 @@
/***************************************************************************
qgsnewspatialitelayerdialog.cpp
Creates a new Spatialite layer. This dialog borrows heavily from
Creates a new SpatiaLite layer. This dialog borrows heavily from
qgsnewvectorlayerdialog.cpp
-------------------
begin : 2010-03-18
@@ -189,7 +189,7 @@ void QgsNewSpatialiteLayerDialog::on_mRemoveAttributeButton_clicked()

void QgsNewSpatialiteLayerDialog::on_pbnFindSRID_clicked()
{
// first get list of supported SRID from the selected Spatialite database
// first get list of supported SRID from the selected SpatiaLite database
// to build filter for projection selector
sqlite3 *db = nullptr;
bool status = true;
@@ -278,7 +278,7 @@ bool QgsNewSpatialiteLayerDialog::createDb()
bool loaded = myLib->load();
if ( loaded )
{
QgsDebugMsg( "spatialite provider loaded" );
QgsDebugMsg( "SpatiaLite provider loaded" );

typedef bool ( *createDbProc )( const QString &, QString & );
createDbProc createDbPtr = ( createDbProc ) cast_to_fptr( myLib->resolve( "createDb" ) );
@@ -49,7 +49,7 @@
* - having handleConnectionExpired() slot that calls onConnectionExpired()
* - having startExpirationTimer(), stopExpirationTimer() slots to start/stop the expiration timer
*
* For an example on how to use the template class, have a look at the implementation in postgres/spatialite providers.
* For an example on how to use the template class, have a look at the implementation in Postgres/SpatiaLite providers.
* \note not available in Python bindings
*/
template <typename T>
@@ -68,10 +68,10 @@ QgsOfflineEditing::QgsOfflineEditing()
* returns offline project file path
*
* Workflow:
* - copy layers to spatialite
* - create spatialite db at offlineDataPath
* - copy layers to SpatiaLite
* - create SpatiaLite db at offlineDataPath
* - create table for each layer
* - add new spatialite layer
* - add new SpatiaLite layer
* - copy features
* - save as offline project
* - mark offline layers
@@ -91,7 +91,7 @@ bool QgsOfflineEditing::convertToOfflineProject( const QString &offlineDataPath,
int rc = QgsSLConnect::sqlite3_open( dbPath.toUtf8().constData(), &db );
if ( rc != SQLITE_OK )
{
showWarning( tr( "Could not open the spatialite database" ) );
showWarning( tr( "Could not open the SpatiaLite database" ) );
}
else
{
@@ -152,7 +152,7 @@ bool QgsOfflineEditing::convertToOfflineProject( const QString &offlineDataPath,
}
}

// restore join info on new spatialite layer
// restore join info on new SpatiaLite layer
QMap<QString, QgsVectorJoinList >::ConstIterator it;
for ( it = joinInfoBuffer.constBegin(); it != joinInfoBuffer.constEnd(); ++it )
{
@@ -650,7 +650,7 @@ QgsVectorLayer *QgsOfflineEditing::copyVectorLayer( QgsVectorLayer *layer, sqlit
{
remoteFeatureIds << f.id();

// NOTE: Spatialite provider ignores position of geometry column
// NOTE: SpatiaLite provider ignores position of geometry column
// fill gap in QgsAttributeMap if geometry column is not last (WORKAROUND)
int column = 0;
QgsAttributes attrs = f.attributes();
@@ -774,7 +774,7 @@ void QgsOfflineEditing::applyFeaturesAdded( QgsVectorLayer *offlineLayer, QgsVec
int newAttrsCount = remoteLayer->fields().count();
for ( QgsFeatureList::iterator it = features.begin(); it != features.end(); ++it )
{
// NOTE: Spatialite provider ignores position of geometry column
// NOTE: SpatiaLite provider ignores position of geometry column
// restore gap in QgsAttributeMap if geometry column is not last (WORKAROUND)
QMap<int, int> attrLookup = attributeLookup( offlineLayer, remoteLayer );
QgsAttributes newAttrs( newAttrsCount );
@@ -1010,8 +1010,8 @@ sqlite3 *QgsOfflineEditing::openLoggingDb()
int rc = sqlite3_open( absoluteDbPath.toUtf8().constData(), &db );
if ( rc != SQLITE_OK )
{
QgsDebugMsg( "Could not open the spatialite logging database" );
showWarning( tr( "Could not open the spatialite logging database" ) );
QgsDebugMsg( "Could not open the SpatiaLite logging database" );
showWarning( tr( "Could not open the SpatiaLite logging database" ) );
sqlite3_close( db );
db = nullptr;
}
@@ -1,5 +1,5 @@
/***************************************************************************
qgsslconnect.cpp - thin wrapper class to connect to spatialite databases
qgsslconnect.cpp - thin wrapper class to connect to SpatiaLite databases
----------------------
begin : May 2015
copyright : (C) 2015 by Jürgen fischer
@@ -1,5 +1,5 @@
/***************************************************************************
qgsslconnect.h - thin wrapper class to connect to spatialite databases
qgsslconnect.h - thin wrapper class to connect to SpatiaLite databases
----------------------
begin : May 2015
copyright : (C) 2015 by Jürgen fischer
@@ -27,7 +27,7 @@
* \class QgsSQLiteExpressionCompiler
* \brief Expression compiler for translation to SQlite SQL WHERE clauses.
*
* This class is designed to be used by spatialite and OGR providers.
* This class is designed to be used by SpatiaLite and OGR providers.
* \since QGIS 2.16
* \note Not part of stable API, may change in future versions of QGIS
* \note Not available in Python bindings

0 comments on commit 6fab688

Please sign in to comment.
You can’t perform that action at this time.