[GIS] QGIS – KML File Not Displaying Correctly After Conversion

google mapskmlqgisshapefile

I have a ESRI shapefile made up of 140 polygons that I want to display on Google My Maps. I have my project and layer CRS set to WGS84 which is standard for displaying spatial data on google. However, my polygons do not appear when I open the file on QGIS and when I try to upload it to My Maps they're displayed as random points/lines instead of polygons and are far off the map from their original location. My attribute table contains only the names of each individual polygon, some have the same name. What should I do to have my .kml display properly? I thought it would contain all the relevant metadata already.

Shapefile before conversion w/ properties

Best Answer

You have a projection problem. The shapefile has a coordinate reference system (CRS) that is used as the units of measure in the geometry, and defined in the files PRJ. These need to match.

I suspect that you have added your data to QGIS. Then you went into properties-source and changed the CRS to WGS84. Below is a screen shot of some data using EPSG 2285. This is the CRS of the geometry and the PRJ of my original data.enter image description here

Now if I go into properties - source I see the same CRS.

enter image description here

Of course you can change it to another CRS but you have just confused QGIS because you told it that the underlying geometry is referencing a different CRS. Any KML exports after this point will not display correctly.

enter image description here

Delete your KML. Start a new project. Add your shapefile and confirm the CRS. Save the file as a KML and only at that point define the CRS of the output KML as WGS84.

Related Question