Sunday, 26 February 2017

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.



Answer



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.



No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...