Polygons from WKT-file imported to QGIS end up in the wrong place

I have some six polygons recieved as a WKT comma separated file from a company. When I import them to QGIS the Polygons end up in the ocean south of Sudan, and I’m pretty sure that I live in the north of Sweden. At least that’s the language spoken on the radio… :slight_smile:

The first two lines in the CSV look like this:
WKT,Name,description,id_2
POLYGON ((20.7821821402714 67.1745210694852,20.785150685553 67.1745408268809,20.7850051686274 67.1761044322888,20.7821894161176 67.1760959653845,20.7821821402714 67.1745210694852)),1 (Three commas not visible here…)

… and the rest of the lines look pretty much the same as above.
I’ve tried to swap the Lat-Long in the file without success. I have the same Coord system (WGS 84 / Pseudo Mercator EPSG 3857) in the base map as well as in the layer.
But still South of Sudan.
Everything is going to end up in a capture and a volume measurement.

Anybody?

Rgds Roger

WGS84 and Pseudo Mercator are two different CRS’s with different EPSG’s. Have you tried importing the CSV into Google Earth? The coordinates are definitely backwards.

Could you PM me a download link to the WKF?

Google Earth wont accept the “POLYGON ((…))” command. I have to enter Fields containing Lat and Long.

This is the projection Google has by default. I have selected the same for my layer…

I pulled the coords for the perimeter of the polygon out as points and it took me to the incorrect location you said in this form. Reversing lat/lon took me to Sweden although I don’t know if it is exactly where you need to be.


Latitude,Longitude
20.7821821402714,67.1745210694852
20.785150685553,67.1745408268809
20.7850051686274,67.1761044322888
20.7821894161176,67.1760959653845
20.7821821402714,67.1745210694852

vs

I get where that could be confusing. Pseudo Mercator derived from WGS84, but is not the same.

EPSG: 4326 uses a coordinate system on the surface of a sphere or ellipsoid of reference.

EPSG: 3857 uses a coordinate system PROJECTED from the surface of the sphere or ellipsoid to a flat surface.

Think of it as this way:
EPSG 4326 uses a coordinate system the same as a GLOBE (curved surface). EPSG 3857 uses a coordinate system the same as a MAP (flat surface).

Either way it doesn’t have anything to do with what you’re experiencing.

Does this look correct? The WKT data is definitely WGS84. I am using 3857 for the project and the XYZ tiles layer for Google Earth is also 3857. Basically what was happening is that the program was using the values for lat/lon as x/y flat coordinates. Looking further to find a base map that will run WGS84.

The place is correct. But the problem still remains: When I’m pulling the coords as…

Latitude,Longitude
20.7821821402714,67.1745210694852
20.785150685553,67.1745408268809

I’m getting them as points, and haven’t managed to tie the points together to get a Polygon. If I try to pull them from the (“POLYGON”) (WKT) - string (which is the only format I’m getting QGIS to accept)

POLYGON ((20.7821821402714 67.1745210694852,20.785150685553 67.1745408268809,20.7850051686274 67.1761044322888,20.78218

they are ending up south of Ghana. And this NO MATTER if i flip the coords or not

I tried to change the proj to 3857, but the polygons won’t leave the sea south of Ghana…

Your last posting looks correct. How did you do this? :slight_smile:

I set my project to CRS 3857. I pulled in my Google Earth XYZ Tiles as a layer which is also 3857. I then imported the CSV file and set its CRS to WGS84. This transformed the lat/lon coordinates to the flat plane x/y coordinates used by Pseudo-Mercator.

Is this someone’s sadistic way of giving you locations to fly? Lol. :slight_smile:

Here’s an XML file for connections to load into XYZ Tiles.

QGIS XYZ Tiles for Google Earth and Open Street Maps

Project 3857. Check
Installed your XML. Check
Added Google Sat as base layer. Check
Imported the CSV (“Sarkas”). Check
The new layer set to WGS84 (or rather: WGS84 / Pseudo-Mercator EPSG:3857) Check

Gives this:

No Google Map… :slight_smile:

Looking in Layer properties gives this:

Looks all right to me…

The Shapefile CSV needs to be strictly WGS84 EPSG 4326 since that is what the coordinates in the file are. Otherwise is turns them into X/Y values which is why they come into the origin point under Ghana and are distorted.

All right. You wrote “then imported the CSV file and set its CRS to WGS84” so I assumed it didn’t care…

So:
Project level: WGS 84 / Pseudo - Mercator EPSG 3857
Google Map: WGS 84 / Pseudo - Mercator EPSG 3857
Polygon Layer: WGS 84 EPSG 4326

Everything checked. No Polygons where they should be.
Deleted the layer and re-read it. Relized that I have to enter the correct WGS84 EPSG 4326 in the import dialogue. Checked and done.

Now working. :slight_smile:

I can -sort of- understand the discussion about EPSG 4326 using coords on the surface of a sphere (a globe)and 3857 on a flat surface ( a map)
But why do I have to mix projections to get this to work? Can’t get this into my head. Why is coords in 3857 are X/Y - values when the same coord in 4326 are “real” coordinates…

But geee, this in nothing for the faint-hearted… So lucky to have someone to ask stupid questions.

when you are in pseudo Mercator look at your coordinates on the bottom toolbar. They will be in XY linear units. The coordinates that are in the CSV look like decimal units, but they are actually decimal degrees latitude and longitude.

I have a lot of digging ahead of me. This is difficult, but I reccon I have to grasp this if I pretend to be “in mapping”.
I took an University degree in Mapping some ten years ago, but everything is gone, I’m afraid to say…

I used to know basics, for example the difference between WGS84 with/without “Pseudo-Mercator”. Used to know… :slight_smile:

Do you have a link I can dig in to and finally learn this?

Nonetheless: Thank you for your kind assistance

1 Like

Here’s a couple that will help people grasp sphere vs plane.

Cartesian vs Geodetic

WGS84 (4326) vs Pseudo-Mercator (3857)

There’s a whole different discussion to be had about vertical datum, but we can get there later. Honestly it’s probably the biggest pain in the arse across the board that people are struggling with in drone mapping, but also GIS savvy people trying to understand land surveying and construction. The whole ellipsoid, geoid, orthometric and surface elevations thing… I’ll try to pull together some links.

I second that. Michael is a big help!

Amen, Brother!

And most land surveyors (that I’ve been around) don’t want anything to do with GIS workers, and consider them almost as much of a pariah as drone mappers. And, as far as they are concerned, general confusion is their ally.

…and it’s not a joke. Get paid $125/hr to drive for an hour, spend 2 hours “figuring out” why monuments aren’t where they are supposed to be, 2 hours writing field notes, take lunch, do some actual surveying for 2 or 3 hours and then an hour back home.

1 Like

Slowly the hourly fee decreases down to almost zero…But the again: Fun to learn stuff.
Thanks for your links. Keep 'em coming! :slight_smile:

Once again: Thanks for your help!

1 Like