[Qgis-user] Turning off data providers in Browser panel?

2016-11-22 Thread Baker, Matthew
All,

As the list of data providers available to QGIS grows, I wonder if there could 
be an option in the settings to toggle the visibility of certain data providers 
if they will not be used.

I'm not sure the history of the ArcGIS feature and map server nodes in the 
browser tree, but I, for one, would like to turn them off.

Thanks!

-m


Matthew Baker
Denver Public Schools
Department of Planning and Analysis
matthew_ba...@dpsk12.org
720-423-3419 / x33419

___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user

[Qgis-user] Layers not showing when .QGS file opened via shared drive

2017-04-19 Thread Baker, Matthew
Hi all,

(Sending this again without an attachment)

I'm having an issue where a .QGS file created on a shared drive then opened 
from another computer doesn't display any of the layers, though the information 
seems to be still in the QGS file.

In the .QGS file linked below, when opened in notepad, I can see all the layer 
styling and connection information, but why doesn't it show the layers when 
opened in QGIS?

https://www.dropbox.com/s/udz8eb80u1i7lgp/Melissa_Compare_GeocodeV2%20-%20bug%20report.qgs?dl=0

The map was created and opened using the same version of QGIS on both client 
machines.

Can anyone see if there is something missing from the file that is preventing 
the layers from displaying?

Thanks!

-m


Matthew Baker
Denver Public Schools
Department of Planning and Analysis
matthew_ba...@dpsk12.org
720-423-3419 / x33419

___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

[Qgis-user] Layers not showing when .QGS file opened via shared drive

2017-04-19 Thread Baker, Matthew
Hi all,

I'm having an issue where a .QGS file created on a shared drive then opened 
from another computer doesn't display any of the layers, though the information 
seems to be still in the QGS file.

Attached (hopefully) is an example of this problem.

Can anyone see if there is something missing from the file that is preventing 
the layers from displaying?

Thanks!

-m


Matthew Baker
Denver Public Schools
Department of Planning and Analysis
matthew_ba...@dpsk12.org
720-423-3419 / x33419



Melissa_Compare_GeocodeV2.qgs
Description: Melissa_Compare_GeocodeV2.qgs
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

[Qgis-user] Performance of MSSQL Server with QGIS 3.4

2018-10-29 Thread Baker, Matthew
Hi all,

For some reason, our MSSQL Server experience has changed drastically with QGIS 
3.4.

The issue resides in the display / refreshing of tables in the database. For 
some reason, the refresh hangs for many minutes (5-10), and freezes up QGIS.

Previous to our upgrade, we have had great success using MSSQL Server, and no 
connection issues at all.

Are there any changes to 3.4 and MSSQL that automatically implements a 
geometry_columns table? We haven't used one in the past, with no negative 
effect. Is there a process new to QGIS 3.4 that gets kicks off in the database 
that might be spinning causing QGIS to hang?

Everything was working fine even with version 3.2, and additionally, I tested 
with version 2.18 (which used to work fine), and the same issue is happening.

This issue doesn't seem to lie in the server itself, as our DB GUI's (MSSQL 
Server Management Studio, DBeaver, DataGrip) all seem to be behaving normally - 
tables displaying with no issue, queries performing fine, etc.

Any thoughts appreciated!

Thank you!

-Matthew Baker
Denver Public Schools
Denver, CO, USA

___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

Re: [Qgis-user] Performance of MSSQL Server with QGIS 3.4

2018-10-31 Thread Baker, Matthew
Thanks again, Nyall.

Re. 'only look in geometry columns' - no, we're not using this setting, nor 
have we ever. Is that true that pre-3.4 was using that setting? I would have 
imagined this is the other way around? I will see if this fix addresses this 
issue when it gets implemented.

Re. the schema display for dragging and dropping - still not a fan of this 
feature - would prefer the QGIS browser window not be a DBA-type of GUI 
(https://issues.qgis.org/issues/17719) but that's another issue altogether! 

Thanks again!

-m





-Original Message-
From: Nyall Dawson  
Sent: Tuesday, October 30, 2018 6:48 PM
To: Baker, Matthew 
Cc: Andreas Neumann ; qgis-user 
Subject: Re: [Qgis-user] Performance of MSSQL Server with QGIS 3.4

On Wed, 31 Oct 2018 at 01:28, Baker, Matthew  wrote:
>
> Thanks for the reply, Nyall.
>
> To clarify - this issue is just refreshing the database tree in the browser 
> window - once refreshed (eventually), all tables behave normally (see below 
> re. invalid geometries).
>
> 2.18 and 3.2 used to refresh the tables just fine. Upon installing 3.4, 
> things have slowed down for all versions.

Thanks for the clarification. Can you confirm whether you have the setting 
"only look in the geometry_columns metadata table" switched on or off for your 
connection?

If you're not using this setting, then it's possibly related to this fix 
https://github.com/qgis/QGIS/commit/e813fe880. Pre 3.4 QGIS was only looking in 
the geometry columns table for the browser, and not respecting this setting.

> Another thing to note - 2.18 and 3.2 show only a handful of schemas in the 
> database (not sure how it decides which one) - but now 3.4 is showing ALL 
> schemas, including those without any tables and that weren't shown in 
> 2.18/3.2 - that's weird!

That's intended -- for db connections we should be showing empty schemas in the 
browser, as this allows users to drag and drop tables into these schemas to 
initially populate them.

Nyall
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

Re: [Qgis-user] Performance of MSSQL Server with QGIS 3.4

2018-10-30 Thread Baker, Matthew
Thanks for the reply, Nyall.

To clarify - this issue is just refreshing the database tree in the browser 
window - once refreshed (eventually), all tables behave normally (see below re. 
invalid geometries). 

2.18 and 3.2 used to refresh the tables just fine. Upon installing 3.4, things 
have slowed down for all versions.

Another thing to note - 2.18 and 3.2 show only a handful of schemas in the 
database (not sure how it decides which one) - but now 3.4 is showing ALL 
schemas, including those without any tables and that weren't shown in 2.18/3.2 
- that's weird!

Re. skipping invalid geometries - this setting doesn't seem to have any effect 
on the behavior we're experiencing. (our data is in pretty good shape and we 
haven't had issues with invalid geometries prior to 3.4 when the option to 
'skip' was not available.) 

Thanks again!

-m



-Original Message-
From: Nyall Dawson  
Sent: Monday, October 29, 2018 5:04 PM
To: Baker, Matthew ; Andreas Neumann 

Cc: qgis-user 
Subject: Re: [Qgis-user] Performance of MSSQL Server with QGIS 3.4

On Tue, 30 Oct 2018 at 05:18, Baker, Matthew  wrote:

> Everything was working fine even with version 3.2, and additionally, I tested 
> with version 2.18 (which used to work fine), and the same issue is happening.

Just to clarify -- you mean that 2.18 shows the same performance issue?

My suspicion here is that you're running into SQL Server's (very
annoying) invalid geometry handling. We've been fighting with this for a couple 
of releases, and it breaks down to two choices:

1. Don't have any code in place on QGIS' side to overcome invalid geometries on 
SQL server databases. Benefit: fastest performance.
Downside: if ANY features in your table have invalid geometries, SQL Server 
silently aborts the request and returns a truncated table. You may be missing 
features and never even know about them.

2. Handle invalid geometries by repairing all invalid geometries when fetching 
from SQL server. Benefit: no issues with randomly truncated tables. Downside: 
much slower retrieval of features due to all the extra processing (done on the 
SQL server itself)

Since later 2.18 releases and QGIS 3.4 we play it safe and take approach 2 by 
default. Because it's better to have a slower provider instead of silent data 
loss. BUT if you're 100% confident that your database has no invalid 
geometries, and never will have them, then you can take off the safeties and 
run at full performance by changing a setting in your SQL Server connection. 
Look for the "Skip invalid geometry handling" checkbox under the connection 
properties and turn it on. But you've been warned, turning this setting on 
pushes all responsibility back TO YOU to ensure that your database is safe.
You'll get 0 warnings if it isn't, and you'll have randomly missing features 
from your layers.

I wish there was another approach here, but as of current SQL Server versions 
there isn't*. Frankly, it's just a very poor decision made by SQL Server's 
engineers which makes SQL Server an inferior choice for an enterprise spatial 
database.

Nyall

* if there is something we've missed -- please let us know!

>
>
>
> This issue doesn’t seem to lie in the server itself, as our DB GUI’s (MSSQL 
> Server Management Studio, DBeaver, DataGrip) all seem to be behaving normally 
> – tables displaying with no issue, queries performing fine, etc.
>
>
>
> Any thoughts appreciated!
>
>
>
> Thank you!
>
>
>
> -Matthew Baker
>
> Denver Public Schools
>
> Denver, CO, USA
>
>
>
> ___
> Qgis-user mailing list
> Qgis-user@lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

[Qgis-user] Connecting QGIS to MSSQL Server on Linux

2019-03-11 Thread Baker, Matthew
Hi all,

Has anyone successfully connected QGIS to MS SQL Server on Linux?

We've been struggling with this for years.

I was finally able to connect Python to MSSQL via pypyodbc using mssql-tools 
and unixodbc-dev.

Additionally, DB clients like DataGrip and DBeaver have made it very easy to 
connect to MSSQL with the additional download of the necessary drivers.

I'm wondering if there is an environment variable that should be set somewhere 
to point to the same drivers that pypyodbc is using?

There are several threads on GIS.SE, but so far no solution.

Thank you!

-Matt Baker / Denver Public Schools
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

[Qgis-user] PyQgis - PostGIS layers won't show in export to PDF (layout)

2021-08-17 Thread Baker, Matthew
Hi all,

When using PyQGIS with Python 3.8 I can't seem to get the PostGIS layers of a 
QGIS layout to export to PDF while the local / shapefile layers will.

The manual export to PDF from the QGIS Layout window will export the PostGIS 
layers just fine along with the SHP layers.

From the code below, can anyone spot what I might be missing?

(Running QGIS 3.18 on Linux Mint 20 with Python 3.8)

Thank you, and let me know if more info is needed!

(BEGIN CODE)

#!/usr/bin/env python3
import os
from qgis.core import (
#layout and general
  QgsProject, QgsLayoutExporter, QgsApplication
 )

QgsApplication.setPrefixPath("/usr", True)
gui_flag = False
app = QgsApplication([], gui_flag)
app.initQgis()

project_path = os.getcwd() + '/rec_centers.qgz'
project_instance = QgsProject.instance()
project_instance.setFileName(project_path)
project_instance.read()

#print layer names in layout (not used anywhere else):
names = [layer.name() for layer in QgsProject.instance().mapLayers().values()]
print ('Layers in project: ', names)

#layout stuff
manager = QgsProject.instance().layoutManager()
layout = manager.layoutByName("test_layout") # name of the layout

#export stuff
exporter = QgsLayoutExporter(layout)
exporter.exportToPdf(project_instance.absolutePath() + "/output/layout.pdf",
 QgsLayoutExporter.PdfExportSettings())

app.exitQgis()

(END CODE)

-m

--

MATTHEW BAKER
Spatial Information Manager
Denver Public Schools
Department of Enrollment and Campus Planning

1860 Lincoln St., Denver, CO 80203 | 11th Floor
720-423-3419 | matthew_ba...@dpsk12.org | planning.dpsk12.org

Students First . Integrity . Equity . Collaboration . Accountability . Fun .
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user