Converting x y coordinates to longitude latitude using QGIS?

  • I'm working with this downloadable shapefile that has X Y coordinates. They are akin to '3672187.92698000, 534175.72095400'.

    I would like to convert them to longitude latitude so they are more like '-90.097017, 29.963176'.

    I've seen this question tackled using ArcMap however I don't have that software. I was able to download and install QGIS but I am unfortunately perplexed by its complicated interface. Would like to do the conversion with it, if possible.

    ArcGIS seems to be an aside - the numbers could have come from anywhere but it appears you want to know what QGIS can do to import and project them.

    You say you have it in ESRI format, what do you mean? It's a Shapefile? Or is just a text file with coordinates? Besides, like you saw in the question you linked, you need to know the input Coordinate Reference System (CRS)(in your case a projected one), and the CRS of the Lat, Long you want (Geographic), you probably want the WGG84 (the one used by GPSs). Without that you can't accurately transform any pair of coordinates. Take a look at "Gentle Introductuion to GIS, chapter 7 - Working with projections"

    The example X, Y and lng/lat I gave should be an exact pair. I mentioned ArcGIS as that is the software linked to by the website from which the dataset came from. I've included a link to the complete dataset in the question.

    Your dataset link just references another question here. Regardless, the fact that the data originated in ArcGIS is irrelevant. As others have said, you need to know the input (source) coordinate system in order to properly transform to lat/long.

    Copy paste error--fixed dataset link. I'll see if I can figure out source coordinate system.

  • AndreJ

    AndreJ Correct answer

    7 years ago

    The dataset you mention is a shapefile, a format invented by ESRI, but understood by most GIS software, including QGIS.

    After extracting the zip, you can add it with Add vector layer and point to the .shp file. The CRS information is stored in the .prj file, and the layer CRS will automatically set right by QGIS. In your case, NAD_1983_StatePlane_Louisiana_South_FIPS_1702_Feet with US feet as units.

    With the openlayers plugin, you can add a Openstreetmap or Google background layer. For doing that, you have to set the project CRS to EPSG:3857.

    If you want coordinates in lat/lon degrees, just rightclick on the shapefile layer, and Save as ... to a new file under a different name, selecting EPSG:4326 as CRS for that, and check to add that layer to the canvas. Saving may take some time.

    For the next step, you better zoom in to see just a couple of points. Open the attribute table, and click on the pencil symbol at the bottom to enter the edit mode, and then the field calculator icon bottom right. Create a new field named degx, type real, precision 6, and select $x from geometry. After saving (which takes some time), do the same for degy and $y. Leave edit mode, then the attribute table.

    The new columns in the attribute table give you lat and lon in degrees.

    Worked perfectly! Then I was able to export the layer as a CSV with the newly added attributes and have exactly what I need! Thanks!

    I followed these steps exactly and my degx and degy are all NULL. Any idea what I did wrong?

    I figured out my issue. QGis was adding variable as a virtual column.

    How did you fix it? I am havig the same issue.

    Just FYI, I found the answer. GIS files can come in lines, points, or polygons (maybe more?). My GIS file was saved as lines, I needed to extract the point info and then I could easily get the coordinate info.

    The UI may have changed now, Import the file as described in the corrrect format, then export that layer Vector/Geometry Tools/Export Add geometry columns in the new format. Then save the new layer as csv.

License under CC-BY-SA with attribution


Content dated before 6/26/2020 9:53 AM