Giter Site home page Giter Site logo

camptocamp / qgis-spreadsheetlayers Goto Github PK

View Code? Open in Web Editor NEW
20.0 21.0 7.0 282 KB

QGIS plugin to load layers from spreadsheet files (*.ods, *.xls, *.xlsx)

License: GNU General Public License v3.0

Makefile 16.06% Python 73.58% Batchfile 8.64% Dockerfile 1.56% Shell 0.16%

qgis-spreadsheetlayers's Introduction

QGIS-SpreadSheetLayers

QGIS plugin to load layers from spreadsheet files (*.ods, *.xls, *.xlsx)

Description

This plugin adds a Add spreadsheet layer entry in Layer / Add new Layer menu and a corresponding button in Layers toolbar. These two links open the same dialog to load a layer from a spreadsheet file with some options:

  • select file
  • layer name
  • sheet selection
  • header at first line
  • ignore some rows
  • load geometry from x and y fields

When dialog is accepted, it creates a new GDAL VRT file in same folder as the source data file and layer name, expanded with a .vrt suffix, which is loaded into QGIS.

When reusing the same file twice, the dialog loads its values from the existing .vrt file.

Limitations

Due to a GDAL/OGR lacks of functionalities:

  • use of header line on a per file basis ;
  • ignore lines at the beginning of file ;
  • correct end of .xls files detection.

The plugin use an SQLITE select statement with offset and limit parameters to extract corresponding data from the source file. When one of this functionalities is in use, this could have some side effects.

With GDAL <= 1.11.1, the plugin can't load geometry. With graceful degradation, geometry checkbox is then locked. To get the GDAL version in use, run this commands in QGIS python console:

import osgeo.gdal
print(osgeo.gdal.__version__)

When opening a spreadsheet file, GDAL/OGR will try to detect the data type of columns (Date, Integer, Real, String, ...). This automatic detection occurs outside of plugin header and ignore lines functionalities, so when using this, GDAL/OGR should be unable to correctly detect data types.

Configuration

GDAL do not allow to define the presence of header line on a per layer basis, this choice is made through environment variables for each driver OGR_ODS_HEADERS, OGR_XLS_HEADERS and OGR_XLSX_HEADERS, with tree possible values FORCE, DISABLE and AUTO. For more details, consult the corresponding drivers documentation ie: http://www.gdal.org/drv_ods.html, http://www.gdal.org/drv_xls.html and http://www.gdal.org/drv_xlsx.html.

You can change this values in QGIS settings:

  • open Settings / Options dialog;
  • select System tab, and go to Environment section;
  • check Use custom variables.
  • add a new line. Example:

    Overwrite | OGR_ODS_HEADERS | FORCE

  • restart QGIS to take this into consideration.

Development install (linux)

git clone [email protected]:camptocamp/QGIS-SpreadSheetLayers.git SpreadsheetLayers
cd SpreadsheetLayers
ln -s ${PWD}/SpreadsheetLayers ~/.local/share/QGIS/QGIS3/profiles/default/python/plugins
make
  • run QGIS and activate SpreadsheetLayers plugin.

Release a new version

First update l10n files:

make tx-pull

Then create a commit if relevant:

git add -p .
git commit -m 'Update l10n'

Now update SpreadsheetLayers/metadata.txt file with the version number.

For an experimental release:

version=X.Y.Z-alpha+build
experimental=False

Or for a final release:

version=X.Y.Z
experimental=True

And create a new commit, tag, and push on GitHub:

git add -p .
git commit -m 'Release version ...'
git push origin master

Then create the package and test it with you local QGIS:

make package deploy
qgis

Then, if everything looks fine, you can create a tag:

git tag X.Y.Z
git push origin X.Y.Z

Then log in to QGIS plugins repository: https://plugins.qgis.org/accounts/login/

And upload the file dist/SpreadsheetLayers.zip here: https://plugins.qgis.org/plugins/SpreadsheetLayers/

qgis-spreadsheetlayers's People

Contributors

arnaud-morvan avatar effjot avatar matt-needle avatar mwtoews avatar pavlova-marina avatar ronitjadhav avatar yamamoto-ryuzo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

qgis-spreadsheetlayers's Issues

Query of spreadsheet layer not working consistently

I have created a layer based on this small test file:
test_file.xlsx

Everything works fine but when I apply this query to the layer:
"EEZ" = 'SE' AND "Station" NOT IN ('FLADEN','CL7') AND "Depth" > 30
everthing seems to work fine and the Test button in the Query builder returns 28 records as expected. BUT on the map the stations with depths less than 30 are still visible and much more than 28 records are shown.

If I copy the info in the excel file to a text file and create a layer based on this text file instead the query works as expected and only 28 stations are shown on the map.

Any suggestion on why the spreadsheet layer behaves in this way? Workaround?

I run QGIS 3.18.3 on windows 7.

Error on install

Failed to load the 'SpreadsheetLayers' plug-in due to an error calling your method classFactory()

TypeError: 'QVariant' object is not subscriptable
Traceback (most recent call last):
File "/Applications/QGIS3.app/Contents/MacOS/../Resources/python/qgis/utils.py", line 336, in startPlugin
plugins[packageName] = package.classFactory(iface)
File "/Volumes/xxxxxx/Users/xxxxxx/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/SpreadsheetLayers/init.py", line 35, in classFactory
return SpreadsheetLayersPlugin(iface)
File "/Volumes/xxxxxx/Users/xxxxxx/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/SpreadsheetLayers/SpreadsheetLayersPlugin.py", line 50, in init
locale = QtCore.QSettings().value('locale/userLocale')[0:2]
TypeError: 'QVariant' object is not subscriptable

Versión de Python: 3.6.5 (v3.6.5:f59c0932b4, Mar 28 2018, 05:52:31) [GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)]
Versión de QGIS: 3.0.3-Girona Girona, exported

Ruta de Python:
/Applications/QGIS3.app/Contents/MacOS/../Resources/python
/Volumes/xxxxxx/Users/xxxxxx/Library/Application Support/QGIS/QGIS3/profiles/default/python
/Volumes/xxxxxx/Users/xxxxxx/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins
/Applications/QGIS3.app/Contents/MacOS/../Resources/python/plugins
/Library/Frameworks/Python.framework/Versions/3.6/lib/python36.zip
/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6
/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/lib-dynload
/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages
/Volumes/xxxxxx/Users/xxxxxx/Library/Application Support/QGIS/QGIS3/profiles/default/python
/Volumes/xxxxxx/Users/xxxxxx/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins
/Volumes/xxxxxx/Users/xxxxxx/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins

Migration to QGIS 3.0

Hello,
first of all, thanks for this plugin it is very useful in my work.
Do you plan migration to QGIS 3.0? It is one of two plugins that force me to stay with 2.18 :-).
Best Regards
Piotr Mędrzycki

After opening, no points/geometry is shown

Hi,
I attach a (minimal) xlsx-File with two columns:
long (°)
lat (°)
holding the geometry (in EPSG 21256)
and two other columns.
("StrCode" and "s (m)").
After importing with "Geometry" ticked on, unfortunately, I see the layer in the layer list, but no points.
When having opened e.g. Openstreetmap layer beforehand, the "Zoom to layer" zooms to the right location, however no points are shown.
The .vrt-File is created and contains the column information (below).

A second thing is the "Header at first line" checkbox.
Unchecked, the column headers are shown in the import window above the data type dropdowns. If I check, the content of the second line is shown in the window (screenshot attached). I thought it should be the other way round (?).

Tested QGIS Versions: 3.16 and 3.10 on Windws 10.

A22R0___190802_1013_arsis01_test.xlsx

screenshot_header

<?xml version="1.0" encoding="UTF-8"?> <OGRVRTDataSource> <OGRVRTLayer name="A22R0___190802_1013_arsis01_test-Tabelle1"> <SrcDataSource relativeToVRT="1">A22R0___190802_1013_arsis01_test.xlsx</SrcDataSource> <!--Header=False--> <SrcLayer>Tabelle1</SrcLayer> <Field name="StrCode" src="StrCode" type="String"/> <Field name="s (m)" src="s (m)" type="Integer"/> <GeometryType>wkbPoint</GeometryType> <LayerSRS>EPSG:31256</LayerSRS> <GeometryField encoding="PointFromColumns" x="long (°)" y="lat (°)"/> </OGRVRTLayer> </OGRVRTDataSource>

Can't reopen a file

When i close a spreadsheet, edit something in excel and reopen the file in qgis, i can't open it again, and this message appears (under a yellowish colour):
Could not open C:/Users/my.user/Documents/GIS DataBase/file.xlsx
I'm using qgis 2.10.1 in win7 x64. Deleting the vrt file doesn't change this situation.

Accessing "createpointslayerfromtable" with Python

Hi,
I'm running QGIS 3.4 with Python 3 and would like to automate the creation of vector layers from spreadsheets.
The following Code

from qgis.core import *
import processing
processing.run("qgis:createpointslayerfromtable",
{'INPUT':r'C:\Users\Desktop\PlayItAll\Test.xlsx',
'XFIELD':'X_Pos',
'YFIELD':'Y_Pos',
'ZFIELD':None,
'MFIELD':None,
'TARGET_CRS':QgsCoordinateReferenceSystem('EPSG:4326'),
'OUTPUT':r'memory'})

...produces this error:

File "C:/PROGRA1/QGIS31.4/apps/qgis/./python/plugins\processing\core\Processing.py", line 183, in runAlgorithm
raise QgsProcessingException(msg)

Can you please help me with this ?

Spreadsheet Layers windows closes when importing excel files

Hi,
I tried many times to import excel files but Spreadsheet closes as soon as I import it.
I tried with a file that I have already used in the past with no problem, but now it is impossible to import a file.
I also tried with no success using a simple file with only 3 columns (Name, Long, Lat) and one row (data).

I have the last version of QGIS and SpreadSheet. I tried 3 times to uninstall/reinstall QGIS (using an old version of QGIS) and the plug-in but I have the same problem.
Is there any solution?

Thank you in advance

Add menu to datasource manager

Hello,

_ _
Version de QGIS 3.24.0-Tisler
Révision du code 6b44a42058
Version de Qt 5.15.2
Version de Python 3.9.7
Version de GDAL/OGR 3.2.2
Version de Proj 7.2.1
Version de la base de données du registre EPSG v10.008 (2020-12-16)
Version de GEOS 3.9.0-CAPI-1.16.2
Version de SQLite 3.35.5
Version de PDAL 2.2.0
Version du client PostgreSQL 13.5 (Ubuntu 13.5-0ubuntu0.21.10.1)
Version de SpatiaLite 5.0.1
Version de QWT 6.1.4
Version de QScintilla2 2.11.6
Version de l'OS Pop!_OS 21.10

Not visible anymore on left panel from the datasource manager :

image

Still available from top text menu > layers > add a layer

No Layers are shown after importing a spreadsheet-file

Hi, First of all, I think the idea is quite great.
I am running 2.18 and when importing a *.xlsx file I cannot get any other layers to show. (So Step-wis it looks like 1) import sreadsheet 2) import vector layer --> I cannot get a vector layer to show!)

Second:
When I import after importing say vector layers I can only show the second entry of my *.xlsx-file.

update spreadsheet layers

Bonjour,
est-il possible de modifier le fichier ods ou xls et de mettre à jour la jointure dans Qgis 3 sans fermer le projet ? et sans recréer le vrt ??
Merci d'avance pour votre réponse

Coordinate GPS in DMS

Hello.
Is it possible to add the choice of the format gps degrees minutes seconds to the import?
Exactly as the import by delimited text does.
Thank you
2019-01-30_08h54_35

GDAL test fails with GDAL 2.1.3

Using QGIS 2.18.7 with GDAL 2.1.3. GDAL test testGdal in /util/gdal_util.py throws an error:

lyr = ds.GetLayer(0) AttributeError: 'NoneType' object has no attribute 'GetLayer'

Multiple worksheets

Great plugin! The only downside so far: The created vrt is named after the filename. This way only one sheet is usable.
Using the filename / worksheetname combination would make them unique, making it possible working with multiple sheets.
Workaround now is renaming the vrt before adding the next worksheet.

IndexError: list index out of range

Importing this file utilisation_terre_agricole_2010.xls triggers this error for each coloumn:

Une erreur est apparue lors de l'exécution du code Python : 

IndexError: list index out of range 
Traceback (most recent call last):
  File "/home/yjacolin/.formation/master/config/python/plugins/SpreadsheetLayers/widgets/SpreadsheetLayersDialog.py", line 177, in setEditorData
    type = index.model().fields[index.column()]['type']
IndexError: list index out of range


Version de Python : 2.7.6 (default, Jun 22 2015, 18:01:27) [GCC 4.8.2] 
Version de QGIS : 2.13.0-Master Master, eeeacfe 

Chemin Python :
/home/yjacolin/Documents/Developpement/qgis_install/share/qgis/python/plugins/sextante
/home/yjacolin/.formation/master/config/python/plugins/processing
/home/yjacolin/Documents/Developpement/qgis_install/share/qgis/python
/home/yjacolin/.formation/master/config/python
/home/yjacolin/.formation/master/config/python/plugins
/home/yjacolin/Documents/Developpement/qgis_install/share/qgis/python/plugins
/usr/local/lib/python2.7/dist-packages/Sphinx-1.3.1-py2.7.egg
/usr/local/lib/python2.7/dist-packages/sphinx_rtd_theme-0.1.8-py2.7.egg
/usr/local/lib/python2.7/dist-packages/alabaster-0.7.4-py2.7.egg
/usr/local/lib/python2.7/dist-packages/Babel-1.3-py2.7.egg
/home/yjacolin/.formation/master/config/python/plugins/geoserverexplorer/ext-libs/httplib2-0.8-py2.7.egg
/home/yjacolin/.formation/master/config/python/plugins/geoserverexplorer/ext-libs/python_dateutil-2.2-py2.7.egg
/home/yjacolin/.formation/master/config/python/plugins/geoserverexplorer/ext-libs/six-1.5.2-py2.7.egg
/home/yjacolin/.formation/master/config/python/plugins/geoserverexplorer/ext-libs/gsconfig-0.6.14-py2.7.egg
/home/yjacolin/.formation/master/config/python/plugins/geoserverexplorer/ext-libs/gisdata-0.5.4-py2.7.egg
/home/yjacolin/.formation/master/config/python/plugins/geoserverexplorer/ext-libs/gsimporter-0.2-py2.7.egg
/home/yjacolin/.formation/master/config/python/plugins/geoserverexplorer/ext-libs/nose-1.3.0-py2.7.egg
/home/yjacolin/.formation/master/config/python/plugins/geoserverexplorer/ext-libs/nose_html-1.1-py2.7.egg
/home/yjacolin/.formation/master/config/python/plugins/geoserverexplorer/ext-libs/coverage-3.7-py2.7-linux-x86_64.egg
/usr/local/lib/python2.7/dist-packages/snowballstemmer-1.2.0-py2.7.egg
/usr/local/lib/python2.7/dist-packages/docutils-0.12-py2.7.egg
/usr/local/lib/python2.7/dist-packages/Pygments-2.0.2-py2.7.egg
/usr/local/lib/python2.7/dist-packages/Jinja2-2.7.3-py2.7.egg
/usr/local/lib/python2.7/dist-packages/MarkupSafe-0.23-py2.7-linux-x86_64.egg
/usr/lib/python2.7
/usr/lib/python2.7/plat-x86_64-linux-gnu
/usr/lib/python2.7/lib-tk
/usr/lib/python2.7/lib-old
/usr/lib/python2.7/lib-dynload
/usr/local/lib/python2.7/dist-packages
/usr/lib/python2.7/dist-packages
/usr/lib/python2.7/dist-packages/PILcompat
/usr/lib/python2.7/dist-packages/gtk-2.0
/usr/lib/pymodules/python2.7
/usr/lib/python2.7/dist-packages/ubuntu-sso-client
/usr/lib/python2.7/dist-packages/wx-2.8-gtk2-unicode
/home/yjacolin/.formation/master/config/python
/home/yjacolin/.formation/master/config/python/plugins/geoserverexplorer/ext-libs
/home/yjacolin/Documents/Developpement/qgis_install/share/qgis/python/plugins/fTools/tools
/home/yjacolin/.formation/master/config/python/plugins/DPFE/.build/venv/lib/python2.7/site-packages
/home/yjacolin/Documents/Projets/rd/PCRS

Issue: Possible incompatibility with latest GDAL 3.1.4 release

My OSGeo4w just updated GDAL to 3.1.4, which seemingly has broken compatibility with SpreadSheet Layers.

image

2020-10-21T12:38:56     CRITICAL    Traceback (most recent call last):
              File "D:/QGIS/apps/qgis/./python\qgis\utils.py", line 334, in _startPlugin
              plugins[packageName] = package.classFactory(iface)
              File "C:/Users/USERNAME/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\SpreadsheetLayers\__init__.py", line 34, in classFactory
              from .SpreadsheetLayersPlugin import SpreadsheetLayersPlugin
              File "D:/QGIS/apps/qgis/./python\qgis\utils.py", line 792, in _import
              mod = _builtin_import(name, globals, locals, fromlist, level)
              File "C:/Users/USERNAME/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\SpreadsheetLayers\SpreadsheetLayersPlugin.py", line 30, in 
              from .widgets.SpreadsheetLayersDialog import SpreadsheetLayersDialog
              File "D:/QGIS/apps/qgis/./python\qgis\utils.py", line 792, in _import
              mod = _builtin_import(name, globals, locals, fromlist, level)
              File "C:/Users/USERNAME/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\SpreadsheetLayers\widgets\SpreadsheetLayersDialog.py", line 35, in 
              from SpreadsheetLayers.util.gdal_util import GDAL_COMPAT
              File "D:/QGIS/apps/qgis/./python\qgis\utils.py", line 792, in _import
              mod = _builtin_import(name, globals, locals, fromlist, level)
              File "C:/Users/USERNAME/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\SpreadsheetLayers\util\gdal_util.py", line 45, in 
              GDAL_COMPAT = testGdal()
              File "C:/Users/USERNAME/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\SpreadsheetLayers\util\gdal_util.py", line 29, in testGdal
              lyr = ds.GetLayer(0)
             AttributeError: 'NoneType' object has no attribute 'GetLayer'

Edits on filtered dataset deletes records permanently

Steps

  1. make excel spreadsheet with x and y column
  2. install plugin in QGIS
  3. import spreadsheet
  4. filter layer from spreadsheet
  5. go into edit mode and edit features, save
    a. the edited records get updated in the source file
    b. the records that are filtered out in QGIS get deleted in the excel source file
    c. the filtered out records are also not visible in QGIS, of course

Can you check whether this happens on your system, too? If not, I will try to go into more detail about what I did to provoke this behavior.

Opening Browser freezes QGIs

Since a few versions(at least 3.26 ) opening the browser freezes qgis comletely
This only happens with this plugin, opening other browser windows works fine.

Tried with 2.0.1 and the experimental, not network drives connected

importing ods-file leads to phyton runtime error

Opening an ods-file in Qgis 3.34 forced a phyton runtime error:

RuntimeError: Invalid value for number-rows-repeated = 1048565 May be caused by: Invalid value for number-rows-repeated = 1048560
Traceback (most recent call last):
File "C:\Users/thomas.struller/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\SpreadsheetLayers\widgets\SpreadsheetLayersDialog.py", line 324, in on_filePathButton_clicked
self.afterOpenFile()
File "C:\Users/thomas.struller/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\SpreadsheetLayers\widgets\SpreadsheetLayersDialog.py", line 329, in afterOpenFile
self.openDataSource()
File "C:\Users/thomas.struller/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\SpreadsheetLayers\widgets\SpreadsheetLayersDialog.py", line 362, in openDataSource
if self.dataSource and self.dataSource.GetDriver().GetName() in ["XLS"]:
File "C:\OSGeo4W\apps\Python39\lib\site-packages\osgeo\ogr.py", line 1287, in len
return self.GetLayerCount()
File "C:\OSGeo4W\apps\Python39\lib\site-packages\osgeo\ogr.py", line 838, in GetLayerCount
return _ogr.DataSource_GetLayerCount(self, *args)
RuntimeError: Invalid value for number-rows-repeated = 1048565
May be caused by: Invalid value for number-rows-repeated = 1048560

Python-Version: 3.9.18 (heads/master:5eba59e, Feb 1 2024, 20:02:10) [MSC v.1929 64 bit (AMD64)]
QGIS-Version: 3.34.4-Prizren Prizren, decd43dc

Python-Pfad:
C:\Users/thomas.struller/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\ThToolBox
C:\Users/thomas.struller/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\ProcessX
C:\Users/thomas.struller/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\postgis_toolbox
C:\Users/thomas.struller/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\pdaltools
C:\Users/thomas.struller/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\munsellrgb
C:\Users/thomas.struller/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\contour
C:/OSGeo4W/apps/qgis-ltr/./python
C:/Users/thomas.struller/AppData/Roaming/QGIS/QGIS3\profiles\default/python
C:/Users/thomas.struller/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins
C:/OSGeo4W/apps/qgis-ltr/./python/plugins
C:\OSGeo4W\apps\grass\grass83\etc\python
C:\Users\thomas.struller\Documents
C:\OSGeo4W\bin\python39.zip
C:\OSGeo4W\apps\Python39\DLLs
C:\OSGeo4W\apps\Python39\lib
C:\OSGeo4W\bin
C:\OSGeo4W\apps\Python39
C:\OSGeo4W\apps\Python39\lib\site-packages
C:\OSGeo4W\apps\Python39\lib\site-packages\win32
C:\OSGeo4W\apps\Python39\lib\site-packages\win32\lib
C:\OSGeo4W\apps\Python39\lib\site-packages\Pythonwin
C:/Users/thomas.struller/AppData/Roaming/QGIS/QGIS3\profiles\default/python
C:\Users\thomas.struller\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\DigitizingTools\tools
C:\Users\thomas.struller\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\DigitizingTools
C:\Users/thomas.struller/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qgis_resource_sharing
C:\Users\thomas.struller\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\qgis_resource_sharing
C:\Users\thomas.struller\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\qgis_resource_sharing\ext_libs
C:\Users\thomas.struller\AppData\Roaming\QGIS\QGIS3\profiles\default\python\site-packages
W:/Guggenmuehle

Some German translations are missing

The labels for “Encoding” and “Field” are not translated to German. I have added the translations to Transifex a while ago; maybe they just have to be pulled from there.

Could you internationalise the combobox entries “PointFromColumns“ and the geometry types? For the geometry types, localisations might even already be provided by QGIS. A translation of “PointFromColumns” would be nice, though.

Problem with datas excel

Hi
Problem with an Excel files. In two last columns same value at string.
The recognized type is not the same (REAL at start) and if I change it to STRING in the "parcelle cadastre" column, nothing changes. This column is found by calculation and the one on the right entered manually for testing.

File is an axcel ffile of XLS 2016 with macros.

Thanks

Marc G.
parcellenum

EXCEL file - all formatting and formulas are gone!

In the “Add spreadsheet layer” plugin for integrating EXCEL tables, when accessing the Excel file recursively, there is the problem that all formatting and formulas are saved in all ! Tabs are deleted. The tab then only contains the blank numbers/values.
So if you change and save the Excel file from QGIS (there is direct access via the generated VRT file), all formatting and formulas are gone!
Previously the problem only occurred when accessing the respective tab.

Uncaught UnicodeEncodeError: 'ascii' codec can't encode character u'\xf6' in position 39: ordinal not in range(128)

Steps to reproduce

  1. First
  2. Second
  3. Third
Traceback (most recent call last):
  File "C:/Users/user/.qgis2/python/plugins\SpreadsheetLayers\widgets\SpreadsheetLayersDialog.py", line 807, in accept
    if not self.writeVrt():
  File "C:/Users/user/.qgis2/python/plugins\SpreadsheetLayers\widgets\SpreadsheetLayersDialog.py", line 769, in writeVrt
    msgBox.setText("The file {} already exist.".format(vrtPath))
UnicodeEncodeError: 'ascii' codec can't encode character u'\xf6' in position 39: ordinal not in range(128)

SpreadsheetLayers 1.0, QGIS 2.14.8-Essen on Windows 8

Error launching SpreadsheetLayers

The error occurs when launching the widget.

AttributeError: type object 'QgsWkbTypes' has no attribute 'translatedDisplayString'
Traceback (most recent call last):
File "/Users/gbt/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/SpreadsheetLayers/widgets/SpreadsheetLayersDialog.py", line 100, in data
return QgsWkbTypes.translatedDisplayString(geometry_type[0])
AttributeError: type object 'QgsWkbTypes' has no attribute 'translatedDisplayString'

Version de Python : 3.6.8 (v3.6.8:3c6b436a57, Dec 24 2018, 02:04:31) [GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)]
Version de QGIS : 3.8.3-Zanzibar Zanzibar, exported

Chemin Python :
/Applications/QGIS3.8.app/Contents/MacOS/../Resources/python
/Users/gbt/Library/Application Support/QGIS/QGIS3/profiles/default/python
/Users/gbt/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins
/Applications/QGIS3.8.app/Contents/MacOS/../Resources/python/plugins
/Library/Frameworks/SQLite3.framework/Versions/E/Python/3.6
/Library/Frameworks/Python.framework/Versions/3.6/lib/python36.zip
/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6
/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/lib-dynload
/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages
/Users/gbt/Library/Application Support/QGIS/QGIS3/profiles/default/python
/Users/gbt/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/mmqgis/forms
/Users/gbt/Desktop/ALIR Prochain Volume/ALiR CARTO/Carto

Using QgsSettings() instead of QSettings() to consider global QGIS config

Hi there,
I would reccommend to use QgsSettings() from qgis.core (qgis/QGIS@e1ede70) instead of QSettings() from PyQt5.QtCore as this consider the use of global configuration via the qgis_global_settings.ini (https://docs.qgis.org/3.34/en/docs/user_manual/introduction/
qgis_configuration.html#deploying-qgis-within-an-organization) in:
https://github.com/camptocamp/QGIS-SpreadSheetLayers/blob/master/SpreadsheetLayers/SpreadsheetLayersPlugin.py#L51.

So this would take this into account:

from qgis.core import Qgis, QgsVectorLayer, QgsProject, QgsSettings
[...]
locale = QgsSettings().value("locale/userLocale")[0:2]

instead of

from qgis.core import Qgis, QgsVectorLayer, QgsProject
[...]
locale = QtCore.QSettings().value("locale/userLocale")[0:2]

QGIS on Mac quits when adding spreadsheet layer (LTR version ok)

I have been unable to use any of the latest releases 3.18 or now 3.20 and have the add spreadsheet layer plugin work.
This forced me back to the LTR. However, the new label options in 3.20 are something I very much want to use.

Issue with 3.20: :

  • install spreadsheet layer plugin, all seems ok
  • layers/add spreadsheet layer - pulls up dialogue window
  • as soon as I do anything (navigate to a spreadsheet or hit the help button in bottom left for example) QGIS crashes.

Not sure how much of the error code I need to copy...

I have created new user profile and that doesn't fix it.

Have searched the issues list.

Can anyone assist?

Process: QGIS [899]
Path: /Applications/QGIS.app/Contents/MacOS/QGIS
Identifier: org.qgis.qgis3
Version: 3.20.0 (3.20.0 [])
Code Type: X86-64 (Translated)
Parent Process: ??? [1]
Responsible: QGIS [549]
User ID: 501

Date/Time: 2021-07-31 14:51:48.210 +1000
OS Version: macOS 11.3.1 (20E241)
Report Version: 12
Anonymous UUID: 6BB4255F-DDCA-4D37-AB04-D7D4CF8A8894

Time Awake Since Boot: 150 seconds

System Integrity Protection: enabled

Crashed Thread: 0 Dispatch queue: com.apple.main-thread

Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000018
Exception Note: EXC_CORPSE_NOTIFY

Termination Signal: Segmentation fault: 11
Termination Reason: Namespace SIGNAL, Code 0xb
Terminating Process: exc handler [899]

VM Regions Near 0x18:

[feature for consideration] Read wkt_geom in xlsx such as multipolygon(((...

This might not be the issue but rather the feature I am looking for.

Problem statements:
wkt_geom saved in csv is limited by character length for each cell. I have a wkt_geom with very long string saved in xlsx.
However, I finding difficulty to find some plugins which can open the xlsx file as vector.

It seems that the spreadsheetlayer only work for point(x, y) and the coordinate have to specify in X and Y fields.
It will be good if ir can specify wkt_geom (single column) as feature geometry and support other types of geometries.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.