QGIS 2.10.1 & SQL Server 2014

المشرف العام

Administrator
طاقم الإدارة
I'm struggling to load spatial data into QGIS from SQL Server 2014. I have a table with 4 geography columns (3 are polygon layers, one is a point layer). The table has a primary key column that is a 32-bit integer. I believe the data is loaded correctly as it displays fine in the spatial results tab in SSMS query editor. Also I am able to retrieve the data correctly with custom code I have written.

Whenever I attempt to load with QGIS (or preview with QGIS browser) I immediately receive a crash message "R6025 -pure virtual function call" and down the program goes.

I've tried to populate a geometry_columns table without any help. FWIW I do not see the primary key column listed when attempting to add a layer.

I traced the sql being generated by qgis when I try to load the point layer and found the following to be the culprit (this is part of the select query for the layer):

select [geography]::STGeomFromText('POLYGON( (-172.75210512499998572 -73.81694445636215107, 186.90200612499998556 -73.81694445636215107, 186.90200612499998556 143.2662874563621358, -172.75210512499998572 143.2662874563621358, -172.75210512499998572 -73.81694445636215107))',4326) It appears that latitude & longitude values are somehow scrambled. I manually queried the geography point field and found latitude ranging from 0 to 69.4 and longitude ranging from -164.4 to 178.3 which seems reasonable to me.

I'm baffled as to where QGIS came up with this bounding polygon that it is using to select the layer (complete sql statement below).

SELECT [id],[centroid]FROM [dbo].
where [centroid].STIntersects([geography]::STGeomFromText('POLYGON((-172.75210512499998572 -73.81694445636215107, 186.90200612499998556 -73.81694445636215107, 186.90200612499998556 143.2662874563621358, -172.75210512499998572 143.2662874563621358, -172.75210512499998572 -73.81694445636215107))',4326)) = 1 I plan to keep digging into this. If anybody has any ideas I would certainly appreciate hearing them!



أكثر...
 
أعلى