I have several files in WKT format, and something strange happens when I import them in QGIS (v.2.18.1) (layer->add layer->add delimited Text Layer), files containing lines and polygons are correctly located on the map, but those containing points are not, and the same CRS is used (EPSG: 4326, WGS84) for all files.

Lines and Polygons are located here, all OK

The examples that I put correspond to data an area of the north of Spain, and as you can verify, the lines and points are loaded in that zone, but the points go to the Indian Ocean, in the coast of Tanzania.

Points are bad located

Here you can download the wkt files used (are only 65KB zip file) : wkt_example.zip file link

It is very strange, because the coordinates are good, if I take a point of the file that is misplaced, and I copy the coordinates within google maps, the point is correctly located in the north of Spain.

Here I put some lines (only the first ones) with the content of these files (utf-8).

File-> Point.wkt

0x6510|Océano Atlántico|POINT(43.71632 -8.14070)
0x6510|Océano Atlántico|POINT(43.73159 -7.99925)
0x6510|Océano Atlántico|POINT(43.80043 -7.98792)
0x5000||POINT(43.66791 -8.05667)
0x5000||POINT(43.67915 -8.03564)
0x5000||POINT(43.68267 -7.99418)
0x6400|Parque Eólico Couce Do Penido|POINT(43.67048 -7.95805)
0x6400|Parque Eólico Couce Do Penido|POINT(43.67100 -7.93513)
0x5000||POINT(43.70138 -8.01916)

File-> Lines.wkt

0x15||LINESTRING(43.69263,-8.05847 43.68713,-8.06396 43.68164,-8.05847 43.68164,-8.06946 43.67615,-8.06396)
0x15||LINESTRING(43.67615,-8.06396 43.67615,-8.06946 43.67615,-8.06396 43.67615,-8.06946 43.67065,-8.06946 43.66516,-8.06946)
0x14||LINESTRING(43.66516,-7.85522 43.67065,-7.84973)
0x15||LINESTRING(43.70911,-8.05298 43.70361,-8.05847 43.69812,-8.05847 43.69812,-8.06396 43.69263,-8.05847)
0x15||LINESTRING(43.71460,-8.03650 43.70911,-8.04199 43.71460,-8.04199 43.70911,-8.04199 43.71460,-8.04749 43.70911,-8.05298)
0x15||LINESTRING(43.71460,-8.01453 43.70911,-8.02002 43.71460,-8.02551 43.71460,-8.03650)
0x15||LINESTRING(43.70911,-8.00903 43.71460,-8.01453)
0x15||LINESTRING(43.71460,-7.97058 43.70911,-7.98706 43.70361,-7.99805 43.70361,-8.00354 43.70911,-8.00903)
0x15||LINESTRING(43.70911,-7.85522 43.70911,-7.84973)

and File-> Polygons.wkt

0x32||POLYGON((43.69263,-8.06946 43.69263,-8.06396 43.68164,-8.06396 43.68164,-8.06946 43.67065,-8.06946 43.66516,-8.06946 43.66516,-8.18481 43.69263,-8.18481))
0x32||POLYGON((43.68164,-8.06946 43.67615,-8.06396 43.67615,-8.06946 43.67065,-8.06396 43.67615,-8.06946))
0x32||POLYGON((43.69263,-8.06396 43.69263,-8.05847 43.68713,-8.06396 43.68164,-8.06396))
0x4b|0001 Cariño|POLYGON((43.74756,-8.18481 43.74756,-8.01453 43.66516,-8.01453 43.66516,-8.18481))
0x32||POLYGON((43.71460,-8.04199 43.70911,-8.05298 43.71460,-8.05298))
0x32||POLYGON((43.70911,-8.00354 43.71460,-8.01453 43.70911,-8.02002 43.71460,-8.02551 43.71460,-8.00354))
0x32||POLYGON((43.71460,-8.00354 43.71460,-7.97607 43.70361,-7.99805 43.70911,-8.00354))
0x32||POLYGON((43.70911,-7.85522 43.70911,-7.84973 43.70361,-7.84973))
0x4b|0001 Cariño|POLYGON((43.74756,-8.01453 43.74756,-7.84973 43.66516,-7.84973 43.66516,-8.01453))
  • Very odd. They should all be in the wrong place because in WKT coordinates are supposed to be in longitude-latitude order.
    – user30184
    Dec 12 '16 at 9:44

Your point layer coordinates are flipped. The template for WKT is (x,y), where as Geographic coordinates are (y,x) = (lat,lon).

Alas, your Line and Polygon features are corrupted as well. The comma separating coordinate pairs appear after one value, not a pair, thus the 1st and last vertices are misplaced.

Correct point (albeit flipped) appears as Point(XY):

0x6510|Océano Atlántico|POINT(43.71632 -8.14070)

Incorrect Lines, note the comma between odd pairs, appears as Line(X,YX,YX,..,Y):

0x15||LINESTRING(43.69263,-8.05847 43.68713,-8.06396 43.68164,-8.05847 43.68164,-8.06946 43.67615,-8.06396)

enter image description here

  • Many thanks, Dun, I imported my data from an old map in format 'polish format' from garmin and in that format the latitude and longitude were in reverse order, hence my error. Dec 12 '16 at 12:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.