3

I have one polygon file containing all German municipalities as well as a point file. For each municipality, I would like to compute the average of a certain attribute of all points within the municipality's borders. I use the spatial join command for this. However, I am getting the error message that CRS do not match and thus I do not receive any results.

The polygon file seems to be EPSG:25832, the following shows the .prj content

PROJCS["ETRS_1989_UTM_Zone_32N",
    GEOGCS["GCS_ETRS_1989",
        DATUM["D_ETRS_1989",
            SPHEROID["GRS_1980",6378137.0,298.257222101]
            ],
        PRIMEM["Greenwich",0.0],
        UNIT["Degree",0.0174532925199433]
    ],
    PROJECTION["Transverse_Mercator"],
    PARAMETER["False_Easting",500000.0],
    PARAMETER["False_Northing",0.0],
    PARAMETER["Central_Meridian",9.0],
    PARAMETER["Scale_Factor",0.9996],
    PARAMETER["Latitude_Of_Origin",0.0],
    UNIT["Meter",1.0]
]

The point file is in the format EPSG:31467 (Gauß-Krüger-projection in the 3. meridial zone, Ellipsoid Bessel, date Potsdam (central point Rauenberg)).

First, I add the polygon vector file. Then I import the text delimited file. Polygons and points overlap, but I cannot conduct a spatial join because of non-matching CRS (obviously). However, when reprojecting the latter file to the former, polygons and points do not overlap anymore and I do not get any results of the join (the alert that layers have different CRS does NOT pop up anymore). The way how I reproject is by right clicking on the layer - save as ... - choose corresponding CRS.

What am I doing wrong?


In reference to @AndreJ's comment, here are the Extents for both unchanged layers.

Polygon Layer:

In layer spatial reference system units
xMin,yMin 280371.06,5235855.98 : xMax,yMax 921292.37,6101443.71
Layer Spatial Reference System
+proj=utm +zone=32 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs

Point Layer

In layer spatial reference system units
xMin,yMin 3281000.00,5238000.00 : xMax,yMax 3920000.00,6102000.00
Layer Spatial Reference System
+proj=tmerc +lat_0=0 +lon_0=9 +k=1 +x_0=3500000 +y_0=0 +ellps=bessel
+towgs84=598.1,73.7,418.2,0.202,0.045,-2.455,6.7 +units=m +no_defs
  • Can you add the extent of the unchanged layers, as reported by Rightclick, Properties, metadata tab? – AndreJ Mar 29 '15 at 15:00
  • @AndreJ thank you for your comment! I just edited my post with the requested info. – Jhonny Mar 29 '15 at 15:17
  • 1
    If they are the same then use Define Projection to make them exactly the same, Spatial Join is very touchy with spatial references. There is a difference between WKT, SRID/EPSG/WKID and Esri defintitions, after you have saved in the same spatial reference ensure their spatial references are Esri spatial references and then you should have no problems. – Michael Stimson Mar 29 '15 at 22:44
  • 1
    Is "on the fly" CRS transformation activated? If it is not activated it might look like the polygons and points overlap correctly before you convert the projection of the points, though the two layers in fact are not overlapping (because of an error in the defined projection). I know they are supposed to overlap, but maybe a wrongly defined projection does not show until you reproject as you described above. To activate it click on Project -> Project Properties -> CRS and then activate it in the top of the window. – Chris Mar 30 '15 at 12:05
  • 1
    @Chris a prompt appears when importing a text delimited file that asks you to specify the CRS. I do not know exactly why but suddenly the spatial join worked out like a charme. I suppose the trick is that, indeed, the layer needs to be saved to a file in the new CRS in contrast to be set to a new CRS "on the fly". I hope this helps others who tackle the same problem. Thank you all for contributing! – Jhonny Apr 9 '15 at 8:17
1

Answer from the comments:

The layer needs to be saved to a file in the new CRS in contrast to be set to a new CRS "on the fly". I hope this helps others who tackle the same problem. Thank you all for contributing!

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.