0

I have a shapefile, currently uploaded into QGIS of some vectors. I took the coordinates of the middle of these vectors in order to find their x and y coordinates. These coordinates are for instance: X 189372,586045238 and Y 519791,329052381. However, I need the long lat coordinates in order to link this data to other databases.

Already tried selecting EPSG:4326 as CRS, the tip in: Converting x,y coordinates to longitude,latitude using QGIS However, the coordinates do not change into the coordinates I want as a result.

Also tried the programming solution (Python) mentioned in: Converting x,y coordinates to longitude,latitude using QGIS However this code gives a lot of errors and results in nothing for me.

I think I'm missing something. What is it?

6
  • 3
    ­transform() does what you're looking for.
    – Erik
    Commented Nov 25, 2022 at 13:38
  • I found the transform function, however I don't see which CRS ID it is currently in. Is there somehow I can find this? I have a prj file, don't know if this can help?
    – Borisjan
    Commented Nov 25, 2022 at 13:45
  • 2
    The first tab in the layer properties should show the correct CRS - provided you didn't change anything. If you did, load the data again.
    – Erik
    Commented Nov 25, 2022 at 13:49
  • What do you mean be taking the coordinates? You can select the coordinates from the map view with mouse right click in any coordinate system that you wish.
    – user30184
    Commented Nov 25, 2022 at 14:11
  • @layer_crs will give you the current layer's CRS
    – Matt
    Commented Nov 25, 2022 at 18:08

1 Answer 1

0

When you say that the coordinates do not change into the ones you want, do you mean in the attribute table? Follow the steps in the comments to transform the projection into EPSG:4326.

The values in the attribute table will not change, but you can populate new ones by using the answer to this question:

How to determine the centroid of polygons?

3
  • I tried what they told me in the link you sent. However, this doesn't result in EPSG:4326 for me. The comment in the link also says: The result looks something like: 397640.915545362 , 2126924.53637653 Which are not the north and east degrees I need
    – Borisjan
    Commented Nov 29, 2022 at 12:38
  • @Borisjan did you first transform the vector to EPSG:4326?
    – GeoMonkey
    Commented Nov 29, 2022 at 14:55
  • 1
    Thanks, I found the problem! It was indeed first transfering the vector to EPSG:4326 and afterwards extracting the middle coordinates
    – Borisjan
    Commented Nov 30, 2022 at 11:09

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.