Via PostGIS I import a shapefile layer with polygons of EU countries. I try select all rows and after still display blue straight line without the end. Where is the problem?
Geometry Viewer in pgAdmin 4 displays a straight line instead of polygons of European union countries
Hello. Do you have a screenshot by any chance?– swiss_knightMay 11, 2022 at 12:21
You probably need to change -- by using
ST_Transform() -- the coordinate reference system (CRS) of your geometries, e.g. by using such query instead of a standard
SELECT ST_Transform(geom, 4326) AS geom_wgs84, -- adapt "geom" to fit the name of your geometry field if necessary * FROM mytable -- WHERE ...;
if it's 3D geometry, they won't be rendered as well, so you need to use
SELECT ST_Transform(geom, 4326) AS geom_wgs84, ST_Force2D(ST_Transform(geom, 4326)) AS geom_2d_wgs84, * FROM mytable -- WHERE ...;
All this because of that:
When users click a feature in the map, a small pop-up will show up with its property table. If the SRID is 4326 (WGS84) the viewer will transform the coordinates to Web Mercator and add background tile layer.