这是indexloc提供的服务,不要输入任何密码
Skip to content

Query tab goes blank when viewing empty geometry #7655

@jaygordon

Description

@jaygordon

Describe the bug

If I execute a PostGIS query that returns geometry values, then click the "View all geometries in the column" button in the geometry column's header:

  • If all selected geometries are non-empty, the Geometry Viewer will correctly open and map the geometries.
  • But if one or more of the selected geometries are empty, the contents of that Query Tool tab go blank. Clicking anywhere in that blank tab has no effect, and the tab can't be closed.

To Reproduce

Steps to reproduce the behavior:

  1. Open a query tab.
  2. Load the PostGIS extension if it isn't already loaded: CREATE EXTENSION postgis;
  3. Execute the following query to return two rows, one with an empty geometry and the other with a non-empty one.
WITH intersections AS (
    SELECT 'intersection of two different points' lbl,
    ST_Intersection('POINT(0 0)', 'POINT(1 1)') geom
  UNION ALL
    SELECT 'intersection of two identical points' lbl,
    ST_Intersection('POINT(2 2)', 'POINT(2 2)') geom
)
SELECT lbl,
    ST_IsEmpty(geom), --a result of "true" confirms that the geometry is empty
    ST_SetSrid(geom, 4326) --return the geometry so we can try to map it
FROM intersections;
  1. Select only the row for the non-empty geometry and click the "View all geometries in the column" button (screenshot 1, below). The Geometry Viewer should open and map the point (screenshot 2).
  2. Select the row for the empty geometry (and optionally the non-empty geometry) and click the "View all geometries in the column" button (screenshot 3). The entire tab shoud go blank and become nonresponsive (screenshot 4).

Expected behavior

I would expect the Geometry Viewer to open and for any non-empty geometries to be mapped while any empty geometries would be omitted from the map. If all selected geometries are empty I would expect a blank map, or alternatively, a notification that all selected geometries are empty.

Error message

I don't know if an error message is issued because I can't seet the Messages subtab of the Query tab, as the Query tab is blank and nonresponsive.

Screenshots

  1. Map the non-empty geometry:
    image

  2. Result:
    image

  3. Map empty and non-empty geometries:
    image

  4. Result:
    image

Desktop (please complete the following information):

  • OS: Windows 10 Pro
  • Version: 10.0.19045
  • Mode: Desktop
  • pgAdmin4 version: 8.9

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions