I have a shapefile that define X and Y in meters, not lat and lon. Then I have another file (CSV) that stores points locations as lat and lon, e.g. 30.4, 2.2.

I want to load these two files as two layers in QGIS 2.10. First I added a shapefile as a Vector Layer. Then I added a CSV file as a Delimited Text Layer.

I can only see a map (shapefile). How can I correctly project lat and lon? I tried to set different CRS, e.g. EPSG: 3857, for the Delimited Text Layer, but nothing works.


The best approach I found so far is the right-click either layer, select 'Save As', select your preferred CRS and "Add layer to canvas'. Your new layer should be re-projected and visible.

Another thought as well; do you have 'enable on the fly' checked under Project Properties > CRS?

Hope this helps.

| improve this answer | |

The short answer is to begin by trying to set the CRS for the delimited text layer to EPSG:4326. You will be prompted to supply the CRS when you load the delimited text layer.

To elaborate, each data format stores your geometries in coordinates. Those coordinates have to be interpreted with reference to a CRS. If your coordinates are lat/long, you have to use a CRS that expects lat/long. EPSG:3857, which you have tried, is a projected coordinate system (which already is not going to work for the spherical coordinates of lat/long) that expects coordinates in meters.

But even for so-called "unprojected" lat-long, your coordinates are expressed with reference to a specific datum. In practice, if these are modern data, there is a good chance that they will have been measured in WGS84 (the datum used by GPS satellites), and even if it is a regional data such as NAD83 (North American Datum 1983), the error will be on the order of a meter or two. Depending on the scale of your maps/analysis, this may not matter. If it does, you need to determine the CRS that these data were generated for.

Once you have loaded the delimited text layer with the correct CRS, you should save it by right-clicking the layer and choosing Save As.

Assuming your shapefile has correct projection information, as long as OTF (on the fly) reprojection is turned on, QGIS should automatically align your layers. If the shapefile is missing projection information, or you have assigned an incorrect CRS to either data source, they will not align.

| improve this answer | |

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.