I'm currently working in a MySQL database version 5.7. I've a polygon table that was created using the following way:

  ref_geo CHAR(80) NOT NULL,

I was inserting polygons using the following structure:

INSERT INTO coords(ref_geo, geom ) VALUES( 'XX_01', ST_GEOMFROMTEXT( WKT ) );

*where WKT received the Well-known text without setting the SRID. However all coordinates were in EPSG:4326 (WGS84).

I can plot those fine in my WebMap application:

enter image description here

I want to do some visualization in QGIS, but I'm having a harding time doing it. What I did was to create a connection to MySQL Database and then I went to Layer | Add Layer | Add Vector Layer in QGIS. So QGIS can add the geometry table to Layers panel and it recognizes that is a polygon layer enter image description here but it doesn't show any feature. I even use the Set SRID option QGIS provides to ensure the data was interpreted in EPSG:4326, and then "Zoom to Layer", but still, the shapes are not being displayed by QGIS.

Funny and important fact: When I select one feature and click to zoom to it. The QGIS layout zooms to the right place (without showing the feature itself) : enter image description here

Therefore, anyone has any hint in how can I make QGIS to display my geometry table data?

EDIT: Here is a subset of my WKT.

  • is it possible that your polygon layer is below the satellite layer?
    – Ian Turton
    Jul 14, 2021 at 15:20
  • No It's not. I check it previously and even removed the satellite layer to make sure, and still, no feature is showing up Jul 14, 2021 at 15:35
  • can you add an example of your WKT?
    – Ian Turton
    Jul 14, 2021 at 15:53
  • what spatial reference systems (SRS) are you using? (note: mysql v8+ has better geometry/projection support)
    – Mapperz
    Jul 14, 2021 at 16:40
  • 1
    Did you try ST_GEOMFROMTEXT( WKT, 4326 ) instead of ST_GEOMFROMTEXT( WKT )? Not sure if it will change something but worth a try?! Also as your geometry are polygon, turning the wrong side (also called winding) may be your issue cause. Can you give us one WKT sample by editing your question?
    – ThomasG77
    Jul 14, 2021 at 21:15


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.