1

I tried to import this CSV file into QGIS and generally it seems to work. However about half of the data points end up correct in German state of Brandenburg, the other half of the points ends up quite far away in Kazakhstan/the Caspian see (see screenshot), but still appearing somehow in a more or less correct spatial distribution (like the shape of the state shifted far away). So it seems like half the points get moved to the east and I have no idea why. I tried to check the data set but the coordinates seem to look the same or at least I can't find a difference putting them into different locations.

Does someone have an idea of what I could try?

enter image description here

enter image description here

enter image description here

14
  • 1
    Can you provide sample data? What kind of coordinates you have (CRS)? How far away from where they should be are the points?
    – Babel
    Commented Jun 2, 2023 at 15:08
  • Sorry for the delay i had to figure out how to add images... In my original post you see a sample of the CVS-file with the coordinats for Y and X. On the third image, the left dots are correctly in the state of Brandenburg and the right ones are very far away lol
    – shushu
    Commented Jun 2, 2023 at 16:21
  • Posting you data as screenshot does not help much. Can you upload a csv to a cloud and share the link? Or at least paste an extract of the table to your question?
    – Babel
    Commented Jun 2, 2023 at 16:21
  • 1
    Some of your coordinates (2456 of them) are 6 digit X-Koordinate without decimal places and the other 1978 points are 7 digit. Do you have a local coordinate system set on your input device?
    – Cary H
    Commented Jun 2, 2023 at 18:11
  • 1
    @shushu How were these points collected? Where did they originally come from? If it was a GPS Receiver, what coordinate system do you think they used? Also is it possible that a few of the points are the same point?
    – Cary H
    Commented Jun 2, 2023 at 19:37

1 Answer 1

3

See at the bottom for a workflow how to load the points correctly, correcting "wrong" coordinate values and using a virtual layer.

The problem: older "false easting" values

The problem with the points that appear in the Caspian see is a known problem. In Brandenburg, there are two (similar) CRS in use and your coordinate values are a mix of both. The (older) official (state/authority) CRS is/was EPSG:325833 - a non-standard deviation of EPSG:25833 (ETRS89/ UTM zone 33N, used nowadays) with an additional "False Easting" of 3000 km: an additional 3 (7 digit values) put in front of the correspoinding x-coordinates value of the 6 digit values of EPSG:25833.

So your points appear 3.000.000 m to the east (points shifted 3000 km eastwards) when interpreted in the newer definition with only 6 digit values.

See here for a description and another one in german as well as this explanation:

They use an inofficial EPSG-Code 325833 which is EPSG:25833 with an additional false easting of 3000 km (which is the official CRS for Brandenburg, ETRS89 with 7 digit rightings). https://udig.github.io/data/brandenburg.html

A more detailed description can be found in a contribution by Michael Neid, Gunthard Reinkensmeier, Thomas Rothe: "Die verflixte 3 – die UTM-Abbildung in Brandenburgim Wandel der Zeiten", in: Vermessung Brandenburg, 15/2010, no. 2, p. 106-109 (ISSN 1430-7650), downloadable here as pdf document.

Solution

To solve the problem, select the points appearing in Kazakhstan/the Caspian Sea on the map and create a new field using field calculator only for the selected features with the expression "X-Koordinate" -3000000. Then export/save the selected features to a CSV. Load this CSV, this time using the newly created field for x coordinates.

Then the points will appear in the right place.

Other cases

There are two other points in your dataset where instead of that you should divide the x coordinate by 10 (skipping the last 0). This is the case of Waldgebiet 362 (Templin, but appears in western Uzbekistan) and Waldgebiet 9 (Guteborn, appears in Northern Afghanistan).

Complete workflow to get all points in the right place

To proceed to get all points in the correct place, there are different workflows. You could e.g. correct the coordinate values in the CSV before loading them to QGIS. In what follows, I propose a workflow where you load the csv to QGIS and get a layer with the points in the right place.

By the way, I recommend to change fieldames from X-Koordinaten/Y-Koordinaten to a name without hyphen - as this can generate headaches when using in an expression or query. I used your initial fieldnames, thought, in what follows to show how to deal with it.

  1. Load your CSV file to QGIS as data only layer (no geometries). In the import/Data source manager dialog window, check the box No geometry (attribute table only) - or even easier: drag and drop your CSV to the QGIS window.

  2. Run Field Calculator on the loaded CSV, creating a new field called X with the corrected coordinate values, using this expression (by the way: after creating the field, you can't exit editing mode or save the changes here, we'll do that afterwards):

    case 
       when "X-Koordinate" > 5000000 then "X-Koordinate"-5000000  
       when "X-Koordinate"=3949330 then "X-Koordinate"/10 
       when "X-Koordinate"=3300000 then "X-Koordinate"-3000000  
       when "X-Koordinate">3000000 then "X-Koordinate"-3000000 
       when "X-Koordinate" > 0 then "X-Koordinate" 
    end
    
  3. Use select by expression to only select features with valid coordinate values, exluding those with values NULL or 0 or empty. Use this expression:

    "X-Koordinate" > 0 and  "Y-Koordinate" > 0
    
  4. Save the selected features only (thus skipping the empty ones and saving the new field X created in step 2) by right clicking on the layer > Export > Save selected features as... > and save it as CSV (Encoding: UTF-8; CRS: invalid projection). Be sure you have checked the box Add saved file to map.

  5. Create a new Virtual layer: Menu Layer > Create Layer > New Virtual layer. Add this query, where you should replace coordinates with the name of the layer created in step 4:

    select *, make_point (X,"Y-Koordinate",25833) as geometry from coordinates
    
  6. The virtual layer is created as a point layer, but with no CRS definition yet: right click the virtual layer > Layer CRS > Set Layer CRS... > select EPSG:25833.

  7. Points might not be visible yet. Save the layer (e.g. to a Geopackage; Shapefile would truncate your fieldnames) by right-clicking on the virtual layer > Export > Save features as.

The saved layer is loaded to QGIS and now your points should appear in the right place:

enter image description here

3
  • Wow thank you so much Babel! It feels good to know that the data is not entirely correct and that it's not just me being new to QIGS but someone with way more experience couldn't make them make sense. I'll contact the person at the forest administration and ask what happend. Again thank you so much for your effort!
    – shushu
    Commented Jun 2, 2023 at 20:58
  • 1
    Thank you so much Babel! I am amazed by your readiness to help! I will try it out tomorrow at work and let you know if i managed.
    – shushu
    Commented Jun 4, 2023 at 9:32
  • 1
    It worked! Thank you so much for helping me with this problem that i would probably never have solved by myself! Thank you!
    – shushu
    Commented Jun 5, 2023 at 16:20

Your Answer

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

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