Bug report #21732

Items from table do not load properly

Added by Zannis Kostalas over 5 years ago. Updated over 5 years ago.

Status:Feedback
Priority:Normal
Assignee:-
Category:Data Provider/MSSQL
Affected QGIS version:3.4.2 Regression?:No
Operating System:Windows 10 Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:29547

Description

I have a table with geography (SRID 4326) line items. While the majority of them show properly some of them do not show at all. Note that these lines straddle the anti-meridian but this normally does not cause any other issues than the resulting cross-globe lines.

If I try to load the table directly from the db with just the "use estimated parameters" selected in connection options and try to apply a simple filter "id IN (xxx,xxx,xxx,xxx,xxx,xxx) the "test query" function returns 0 rows. If I select to load the layer nonetheless, there is nothing in the map but the attribute table is populated with the rest of the fields

If I also select "skip invalid geometry handling", the test query returns 6 rows which is what I would expect, but still nothing shows in the map.

Casting geography to WKT using .STAsText() and extracting data in a csv results in the layer loading properly.

I am attaching a csv with the following fields:

id: Primary Key, unique non null smallint
PATH: geography, binary from MSSQL 16
wkt_geography: result of PATH.STAsText()
path_geom: casting PATH to geometry using geometry::STGeomFromWKB([PATH].STAsBinary(), 4326)
wkt_geometry: casting the above to text
validity_check: applying .STIsValid() to PATH
validity_check_geom: applying .STIsValid() to PATH after casting to geometry

in the hopes that some conclusion can be drawn as to why this happens.

lines_checks.csv Magnifier (64.7 KB) Zannis Kostalas, 2019-04-02 10:55 AM

History

#1 Updated by Giovanni Manghi over 5 years ago

  • Status changed from Open to Feedback

Does the same happens also with PostGIS?

Also available in: Atom PDF