New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MSSQL: Layer loads but does not display (Attribute Table correct) #28234
Comments
Author Name: Giovanni Manghi (@gioman)
|
Author Name: Martin Dobias (@wonder-sk) If I understand correctly, the problem is that you can load the layer in QGIS, but nothing is displayed in canvas, however attribute table shows values fine. Unfortunately your INSERT command takes features from some other table so it is not possible to replicate your exact situation. I would suggest checking:
|
Author Name: CSW Broadband (@crpage) The INSERT is just to populate the GEOM, I will add a version which uses static data but this is the Ordnance Survey data which is not sharable. I've added a few screenshots as a document The Error shows that the table is loaded correctly CRS and extent shown below from the information tab; the entry in geometry_columns table is correct (it listed the table); STIsValid() is 1 for all rows (remember this displays perfectly in version 3.2: Name Encoding
|
Author Name: Giovanni Manghi (@gioman)
|
Author Name: CSW Broadband (@crpage) Static data insert still fails in the same way. Server version is MSSQL 2017 Insert INTO [dbo].[Temp] |
Author Name: Giovanni Manghi (@gioman) Please try with 3.4.5 or 3.6 |
Closing for the lack of feedback. Please reopen if necessary. |
Author Name: CSW Broadband (@crpage)
Original Redmine Issue: 20414
Affected QGIS version: 3.4.0
Redmine category:data_provider/mssql
Can't see anything special about this table (I've created a minimal copy which still has error, see below) but it does not display in v3.4 but does in v3.2.
Tried Exporting Features to a GeoPackage ( to troubleshoot the error) which shows that it adds another field called GEOM, seeing the actual geometry one as TEXT(255)
Export to vector file failed.
Error: Feature write errors:
Feature creation error (OGR error: sqlite3_exec(CREATE TABLE "Temp" ( "fid" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "geom" POLYGON, "ID" MEDIUMINT, "Postcode" TEXT(10), "Date Introduced" DATE, "Date Withdrawn" DATE, "CodePoint UPP" TEXT(255), "geom" TEXT(255))) failed: duplicate column name: geom)
In MSSQL, this is the temp file I created which has Ordnance Survey Polygon data in, all validated.
USE [BDUK 3.0]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Temp](
[ID] [int] IDENTITY(1,1) NOT NULL,
[Postcode] nvarchar NOT NULL,
[Date Introduced] [date] NULL,
[Date Withdrawn] [date] NULL,
[CodePoint UPP] nvarchar NULL,
[geom] [geometry] NULL,
PRIMARY KEY CLUSTERED
(
[Postcode] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
Insert INTO [dbo].[Temp]
( Postcode,[Date Introduced],[Date Withdrawn],[CodePoint UPP],[geom])
(SELECT Postcode,[Date Introduced],[Date Withdrawn],[CodePoint UPP],[geom]
FROM [CSW3 Postcode Mapping IA]
)
--(25651 rows affected)
The text was updated successfully, but these errors were encountered: