2

I am new to QGIS and I have two layers I want to plot in QGIS but I somehow cannot convert one of them to other projection systems. This is a problem because each layer ends up in a different position and they should overlap:

  • Layer one: comes from a .csv and the polygons come in a WKT and are in cartesian format (long, lat). This is the layer that I cannot reproject to other systems.

EDIT I just checked and when loading the first layer, QGIS gives a message that says that this layer has no CRS. This confuses me even more...

  • Layer two: comes from a .shp file (with its correspondent .prj, .shx, etc.) and this one I can convert to other projections but I can't get it to Layer One's projection coordinates

How do I solve this? The second layer I downloaded it from the spanish national statistics institute (www.ine.es/en/censos2011_datos/cen11_datos_resultados_seccen_en.htm) , the first one came as a given. Also if someone knows how to do it in R, answers are more than welcome.

Screenshots, note the coordinates that QGIS yields (first image is layer 1, second layer 2):

Layer 1 Layer 2

sample data:ID NOMBRE PROVINCIA_INE MUNICIPIO_INE PROVINCIA_INE_ID MUNICIPIO_INE_ID SECCIONES_CENSALES WKT 0-EU-ES-28-01-020-085 Miraflores de la Sierra Madrid SOTO DEL REAL 28 28144 2802801001, 2803401001, 2804501016, 2806701001, 2806701002, 2806701003, 2808501001, 2808501002, 2808501003, 2812001001, 2814401001, 2814401002, 2814401003, 2814401004 POLYGON ((-3.799082 40.849834, -3.796926 40.848022, -3.792479 40.848271, -3.790517 40.846764, -3.787734 40.845321, -3.78545 40.838735, -3.774378 40.826942, -3.758486 40.820663, -3.744765 40.808853, -3.744925 40.807285, -3.740955 40.8054, -3.734056 40.805329, -3.732387 40.803447, -3.724855 40.801006, -3.723403 40.798152, -3.725922 40.793204, -3.73773 40.782672, -3.740098 40.777218, -3.737176 40.76905, -3.744816 40.76572, -3.736435 40.757916, -3.722519 40.740666, -3.715269 40.736091, -3.710177 40.729491, -3.717865 40.728543, -3.726083 40.73087, -3.7327 40.730485, -3.732848 40.735456, -3.738881 40.744419, -3.758577 40.758865, -3.759803 40.761586, -3.763947 40.761308, -3.771251 40.763863, -3.783859 40.770073, -3.802624 40.770618, -3.807198 40.777535, -3.811236 40.779251, -3.811895 40.785679, -3.813971 40.786912, -3.813479 40.796021, -3.828123 40.808769, -3.827749 40.814979, -3.830158 40.817935, -3.829713 40.830901, -3.815049 40.841148, -3.815182 40.84314, -3.808855 40.848724, -3.804239 40.849631, -3.802079 40.848544, -3.799082 40.849834)) 0-EU-ES-28-01-011-086 El Molar Madrid EL MOLAR 28 28086 2800901001, 2805901001, 2808601001, 2808601002, 2808601003, 2810801001, 2810801002, 2812901004, 2814501002, 2816401001, 2816401002, 2816801001 POLYGON ((-3.593485 40.750705, -3.58733 40.748226, -3.582657 40.750591, -3.576659 40.750026, -3.572034 40.743977, -3.561801 40.743847, -3.55564 40.738086, -3.547488 40.734555, -3.54409 40.734615, -3.539326 40.73283, -3.530666 40.734047, -3.525766 40.732757, -3.528184 40.713665, -3.532074 40.711415, -3.544003 40.692216, -3.546959 40.691724, -3.553206 40.687127, -3.555312 40.682785, -3.553432 40.680278, -3.555185 40.668964, -3.554494 40.666867, -3.55023 40.664916, -3.556324 40.662384, -3.555827 40.660775, -3.555775 40.65033, -3.559066 40.650485, -3.566692 40.650369, -3.568148 40.643543, -3.577771 40.645808, -3.584164 40.645122, -3.584663 40.653534, -3.589333 40.655884, -3.593463 40.654804, -3.597052 40.65802, -3.601595 40.669762, -3.601294 40.673301, -3.604856 40.679733, -3.600745 40.696273, -3.60206 40.696628, -3.603361 40.710937, -3.607021 40.715053, -3.608081 40.71439, -3.605649 40.72052, -3.595097 40.725437, -3.591719 40.728969, -3.593485 40.750705))

  • Would it be possible to upload samples of the layers or links to them? – Ed Rollason Jun 6 '17 at 9:30
  • Uploading sample, links and screenshots – Miguel M. Jun 6 '17 at 9:44
0
  1. Know the projections of your data (layer 2 has EPSG:3042, layer 1 is unknown)
  2. Create a QGIS project, set the projection of the whole project
    Project --> Project Properties --> CRS --> "Enable on the fly CRS transformation" and select your desired display projection (e.g. EPSG:4326 or EPSG:3042)
  3. Set the CRS of your CSV data (which lacks projection information)
    Right-click the layer --> Properties --> General --> CRS
    Find& select the appropiate CRS ( I'd start guessing with EPSG:4326)
  4. Now you should have both layers visually overlapping thanks to the on-the-fly transformation

You can also reproject your data so you have two sources with the same projection. This way you don't rely on the magical on-the-fly transformation, but have actually modified your data sources, allowing you to continue working with them in whatever tool you prefer.

  • I had some problems in my laptop (company owned), I was able to use your solution on my personal laptop. Thanks! – Miguel M. Jun 7 '17 at 9:22

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.