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?
1 Answer
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
:
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 ST_Force2D()
:
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.