1

I have problems to find lost projection and hope someone could give a hint. I think there is no way to find the projection automatically so I did try a semi-automatic approach shown below.

My initial data are ESRI Shapefiles (only .DBF, .SHP, .SHX). The only information I have is that these Shapefiles should be somewhere in Germany. So my idea was to collect first all Projections for Germany. I did that using the following filter on this website:

https://epsg.io/?q=Germany+kind%3APROJCRS

There are about 71 projections. I wrote a small application using Openlayers, OpenStreetMap and proj4js and it looks like this:

enter image description here

A click on a Listitem registers a new projection and I am able to tell at a glance if the projection is correct or not. That works for a small set of Data unfortunally. Most of them apprearing somewhere in the water. Here is the JS Method that load a new projection:

function switchProjection(stringProj4JSDefinition) {

        var arrTmp = stringProj4JSDefinition.split('#');

        var epsg = arrTmp[0];
        var projection = arrTmp[1];

        proj4.defs('' + epsg + '', '' + projection + '');

        ol.proj.proj4.register(proj4);

        map.setView(new ol.View({
            projection: '' + epsg + ''
        }));

        var vectorSource;
        map.getLayers().forEach(function (layer) {
            if (layer instanceof ol.layer.Group) {

                layer.getLayers().forEach(function (groupLayer) {

                    if (layer instanceof ol.layer.Vector) {
                        vectorSource = layer.getSource();
                    }

                });
            }
            else if (layer instanceof ol.layer.Vector) {
                vectorSource = layer.getSource();
            } else if (layer instanceof ol.layer.VectorImage) {
                vectorSource = layer.getSource();
            } else if (layer instanceof ol.layer.Image) {
                vectorSource = layer.getSource();
            } else {
                vectorSource = layer.getSource();
            }

        });

        map.getView().fit(vectorSource.getExtent(), map.getSize());
    }

Any ideas what else I could try?

I am new to GIS.

Most of my shapefiles are already projected to Cartesian coordinate system, so maybe that's problem here but I'm usure.

Vince
  • 20,017
  • 15
  • 45
  • 64
BR75
  • 447
  • 4
  • 14
  • 4
    You could try Shapefile ProjectionFinder: https://www.egger-gis.at/automatic-projection-detection/shapefile-projectionfinder/ – TomazicM Mar 05 '20 at 19:28
  • 2
    Does this duplicate question answer your question?: https://gis.stackexchange.com/q/7839/8104 – Aaron Mar 05 '20 at 21:04
  • 1
    if you know one location's correct position this may help - https://blog.ianturton.com/geotools,/projections/2017/01/06/finding-a-projection.html – Ian Turton Mar 06 '20 at 09:05
  • Thanks for the helpful links, I will try all of them. I even know the city where my shapefiles belongs to. – BR75 Mar 06 '20 at 09:16

0 Answers0