A municipal engineer once phoned me in a state of controlled panic. His new sewer network layer had been delivered by a contractor, and when he loaded it over the city’s own street map, every manhole sat about eighty meters south-east of the street it was supposed to be under. The contractor insisted the data was perfect. The engineer’s team insisted the street map was perfect. A dig was scheduled for the following week. I asked one question: “What coordinate system does each layer say it is in?” He read out two names. They looked almost identical. One was a national datum from the 1970s. The other was the modern satellite-based system that replaced it. Both layers were defined. Both layers were correct, in their own systems. Nobody had told the software how to convert between them properly. The error was a datum shift, and it was the size of a small building.
Layers that refuse to line up are among the most common and most expensive problems in GIS, because the data often looks “nearly right” and people trust it. This guide is a diagnostic manual. It starts from what you see on the screen, and works backwards to the cause: a wrong label, a missing transformation, a swapped axis, a unit mix-up or a data error that has nothing to do with coordinate systems at all. For each pattern I’ll show how to confirm the diagnosis and fix it.
This article is a deep dive into the third item of Top 10 Most Common GIS Errors and How to Fix Them. If your problem is that a layer has no CRS at all, start with Missing or Unknown Projection: How to Fix It. If you want the theory behind everything here, read Coordinate Reference Systems (CRS) Explained Simply and Map Projections: How to Choose the Right One.

First, Understand What the Software Is Doing
When you load several layers, modern GIS software performs on-the-fly reprojection. Each layer has its own CRS. The project has a CRS. The software converts every layer’s coordinates, in memory, to the project CRS for display. The files themselves are never changed.
This is wonderful, and it causes most of the confusion, for three reasons.
- It hides differences. Layers in different systems can display together correctly, so you may never notice that they differ, until you run an analysis that needs a single system.
- It trusts the labels. The software believes each layer’s CRS definition. If a label is wrong, the layer is moved incorrectly, and no warning appears.
- It needs the right transformation between datums. If you convert between two different datums, there is a choice of mathematical transformations, and the software may pick a default that is not accurate for your region.
So “my layers don’t line up” can mean one of several different things. The key to solving it is to recognize which.
The Diagnostic Flow
Follow these steps in order. They usually find the answer in minutes.
- Check the CRS of each layer, not only the project CRS. (QGIS: layer properties, Information or Source tab. ArcGIS Pro: layer properties, Source tab, Spatial Reference.)
- Check the project CRS (QGIS: bottom-right corner. ArcGIS Pro: map properties).
- Compare each layer against a trusted reference such as a good basemap, loaded in a known system.
- Look at the coordinate values of each layer’s extent. Do they match the stated CRS?
- Identify the pattern of the misalignment (see below).
- Form a hypothesis, and test it by changing one thing at a time.
- Verify at several points, especially at the corners of the data.
- Fix permanently: reproject to a single working CRS, and save the result.
Recognizing the Pattern
The way the layers fail to align tells you what is wrong. Learn these patterns.
| What you see | Most likely cause |
|---|---|
| Layer is thousands of kilometers away, or at 0,0 | Wrong CRS label, or coordinates treated as degrees instead of meters (or the reverse) |
| A consistent shift of tens to hundreds of meters, same direction everywhere | Datum mismatch, or a missing or wrong datum transformation |
| A consistent shift of a meter or less | Two closely related datums or realizations that differ slightly, or an accuracy limit of the data |
| One layer is a different size, but centered correctly | Units (feet versus meters), or a scale error |
| Layer is mirrored, flipped or rotated 90 degrees | Axis order swapped (X and Y, or latitude and longitude) |
| Error is small in one area, and grows toward the edges | Wrong projection, wrong zone, or a scanned/georeferenced layer with a poor transformation |
| Layer is correct in one region, wrong in another | Mixed systems in the same dataset, or data crossing a zone boundary |
| Vector and raster offset by half a pixel | Pixel-center versus pixel-corner convention |
| Some features align and others don’t | Not a CRS problem. A data quality or editing problem |
| Elevation values differ by tens of meters between datasets | Vertical datum mismatch (not horizontal) |
| Layers align on screen but analysis results are wrong | Differences hidden by on-the-fly projection |
Now let’s go through each in detail.
Cause 1: A Wrong CRS Label
What happens: a layer is labeled with one CRS, but its coordinates are actually in another. The software moves it according to the label, and puts it in the wrong place.
Symptoms: a large offset, sometimes thousands of kilometers. The layer might appear in another country, or at the equator.
How to confirm:
- Read the coordinate extent of the layer and compare with what the CRS should produce. A layer labeled WGS 84 (degrees) whose X values are 450,000 is mislabeled. A layer labeled as a UTM zone whose X values are 2.3 is also mislabeled.
- Compare with a reference layer in a known system.
- Test candidate systems as described in Missing or Unknown Projection: How to Fix It.
How to fix:
- Find the correct CRS using clues, numbers and verification.
- Redefine the CRS (without moving the data). In QGIS, use Assign projection or set the layer CRS, and export the corrected layer. In ArcGIS Pro, use Define Projection. With GDAL, use
-a_srs. - Then reproject to your working system, if needed.
- Document what was wrong, and tell the data provider.
Warning: don’t apply this fix just to “make it line up” without evidence. If a layer has been shifted by another cause (a datum problem, for instance), forcing a different label may seem to work in one place while making the data wrong in others.
Cause 2: Datum Mismatch and Missing Transformations
This is the cause behind my opening story, and it is subtle, because every layer has a correct, valid CRS.
What is a datum shift?
A datum is the model of the Earth, and the reference to which coordinates are tied. Different datums put the same latitude and longitude at different physical places. Older national datums, fitted to a region, can differ from modern satellite datums such as WGS 84 or the European and North American realizations by a few meters up to several hundred meters, depending on the region and the datums involved. Converting properly requires a datum transformation, which is more than just changing projection.
Symptoms
- A consistent shift of tens to hundreds of meters, in about the same direction across the whole layer.
- Layers that are both “correct” and “labeled” in different datums.
- Alignment that is good in some regions and slightly worse in others, since the shift varies slowly across the territory.
How to confirm
- Check the datum named in each layer’s CRS, not only the projection. Two systems with similar names, such as the same projection on two different datums, are the usual culprits.
- Test with a transformation (below) and see whether the shift disappears.
- Measure the shift at several known points. If it is consistent in size and direction, suspect a datum difference.
How to fix
- Make sure each layer’s CRS is correct, including the datum.
- Reproject with the proper datum transformation. When you convert between systems that involve different datums, your software presents transformation options, or chooses one by default.
- QGIS: when you add layers whose datums differ, a dialog may ask you to choose a transformation. You can set defaults in Project > Properties > Transformations. For permanent conversion, use Reproject layer and choose the coordinate operation.
- ArcGIS Pro: the Project tool offers a geographic transformation parameter. Choose the one recommended for your region.
- Choose the right transformation. Many national agencies publish an official transformation between their datum and WGS 84 or the modern system, sometimes as a grid file (a table of shifts across the territory) that gives much better accuracy than a simple formula.
- Make sure the needed grid files are installed. Software can’t use a transformation grid it doesn’t have. When it can’t, it may fall back on a less accurate method, without making noise. Modern PROJ-based tools can download grids on demand if you allow network access, and can list the available operations.
- Verify with known control points.
In Python
from pyproj import Transformer
from pyproj.transformer import TransformerGroup
# List the transformations available between two systems, and whether grids are missing
group = TransformerGroup("EPSG:27700", "EPSG:4326", always_xy=True)
print("Available:", [t.description for t in group.transformers])
print("Unavailable (missing grids):", [str(u) for u in group.unavailable_operations])
# Use the best available transformation
transformer = Transformer.from_crs("EPSG:27700", "EPSG:4326", always_xy=True)
lon, lat = transformer.transform(530000, 180000)(The code 27700 is the British National Grid, used here as an example.) Always compare the result with a known point.
Dynamic datums and epochs
The continents move by a few centimeters each year. Modern global systems such as the recent realizations of WGS 84 and ITRF are dynamic and tied to a date (epoch). Over decades, this adds up to differences of a meter or more between a regional “static” system and a global one. For high-precision work, such as surveying, the epoch matters. For ordinary mapping, it is usually negligible, but a consistent shift of around a meter between “equivalent” systems is a clue.
Cause 3: Axis Order and Coordinate Swaps
What happens: latitude and longitude (or X and Y) are written in the wrong order.
Symptoms:
- A layer appears mirrored, flipped, or at a mirrored location on the globe, such as in the ocean off a coast that mirrors the right one.
- Points appear in a completely different hemisphere. A point at 48.85 north and 2.35 east becomes 2.35 north and 48.85 east, in the Gulf of Guinea.
- Web service requests return empty maps or errors.
Why it happens:
- Different standards use different orders. GeoJSON and most GIS software use longitude, latitude (x, y). The official definition of EPSG:4326 lists latitude first. Some web services, such as WMS 1.3.0 with EPSG:4326, follow the official order. Humans usually say “latitude, longitude.” Libraries differ, and some, such as Leaflet’s marker positions, use latitude first.
- Tables with columns named inconsistently, or imported with the wrong columns assigned to X and Y.
How to confirm: compare the values. A latitude can never exceed 90. If your “latitude” column has values like 120, it is a longitude. Plot a single, well-known point, such as a landmark, and see where it lands.
How to fix:
- Swap the columns or the coordinates, and recreate the geometry. In QGIS, when importing a delimited text layer, assign the X field to longitude and the Y field to latitude. In GeoPandas,
gpd.points_from_xy(df.lon, df.lat)takes x first. - In pyproj, use
always_xy=Trueto keep longitude-latitude order regardless of the CRS definition. - In web service requests, read the capabilities, and use the order that the version and CRS require. See Intro to Web GIS APIs and OGC Standards (WMS, WFS, WMTS).
- Prefer projected systems or CRS:84 (longitude first by definition) for map requests, to sidestep the problem.
Cause 4: Units (Feet and Meters)
What happens: a layer is in feet but treated as meters, or the reverse.
Symptoms: the layer has the right shape and center but the wrong size, by a factor of about 3.28. Distances and areas are off by a factor of 3.28 and about 10.76 respectively. Sometimes the layer is correctly placed at the origin of its coordinate system but too large or small.
How to confirm: measure a known distance, such as a city block, a road width or a standard building, and compare with expectation. Check the linear unit in the CRS definition.
How to fix: correct the CRS definition (some systems exist in versions for meters and versions for feet, with different codes), or reproject properly from the right source CRS. Watch out for the US survey foot versus the international foot. They differ by a tiny relative amount, which becomes noticeable at the large coordinate values of some state plane systems, resulting in a shift of the order of meters if you pick the wrong one.
Cause 5: Wrong Projection or Zone
What happens: the layer is defined in a projection or UTM zone that doesn’t match its coordinates, or data spans a zone boundary.
Symptoms: the layer is roughly in the right place, but the error grows with distance from one point. Or it is correct for one part of the area but wrong in another.
How to confirm: test with the neighboring zones. Check where the data lies relative to the zone boundaries. See the coordinates pattern table in Missing or Unknown Projection: How to Fix It.
How to fix: assign the correct system. For data that spans several zones, choose a single projection suited to the whole area, and reproject everything to it. See Map Projections: How to Choose the Right One.
Cause 6: Rasters, Half-Pixel Shifts and Georeferencing Errors
Pixel center versus pixel corner
Raster formats define the position of a cell either at its corner (area) or its center (point). If software interprets this differently, the raster is offset by half a pixel, in both directions. For a 30-meter pixel, it is a 15-meter shift. For a 10-centimeter drone image, it is negligible.
Symptoms: an offset of exactly half a cell between a raster and a vector layer or another raster, in one consistent direction.
Fix: check the raster’s metadata, which may include a flag describing the convention. Some tools allow you to shift the raster by half a cell, or to set the convention. Verify with a known feature.
Poor georeferencing
Scanned maps and images aligned with control points can have local distortions that vary across the image.
Symptoms: the error changes from place to place, and is larger away from the control points.
Fix: improve the georeferencing with better, better-distributed control points, or a more suitable transformation. See Georeferencing a Scanned Map Step by Step.
Resampling and reprojection effects
When you reproject a raster, the grid changes, and values are resampled. This can produce slight shifts at the pixel level, and unwanted smoothing or blocky effects. Choose the correct resampling method (nearest neighbor for categories, bilinear or cubic for continuous values), and set the output resolution deliberately. See Raster Processing in Python: Rasterio, Xarray, and NDVI from Code.
Cause 7: Not a CRS Problem at All
Sometimes layers don’t align because the data itself is different.
- Different sources, different accuracy. A road layer digitized at a small scale will not align precisely with one surveyed to centimeters. The “misalignment” is the difference in accuracy, and it is irregular, with no consistent pattern.
- Different dates. Roads move, rivers shift, buildings are demolished. A layer from 1998 will not match imagery from 2024.
- Different generalization. A coastline generalized for a regional map doesn’t follow every bay.
- Editing mistakes. Features that have been moved by accident.
- Different definitions. A boundary and a building footprint may legitimately differ.
- Imagery distortions. Aerial images that are not properly orthorectified are displaced by terrain and building height. Tall buildings lean, and hilltops are shifted.
How to tell: the misalignment is irregular, varies feature by feature, and doesn’t follow a consistent shift, scale or rotation. A CRS problem produces a systematic error. A data quality problem produces a random one.
Cause 8: Vertical Datum Mismatch
Heights can be referenced to the ellipsoid, to mean sea level (the geoid) or to local tide gauges. They can differ by tens of meters, so a terrain model and a set of GPS elevations can appear to be offset vertically.
Symptoms: elevation values differ by a nearly constant amount between datasets, such as 20 to 50 meters in some regions. Horizontal alignment is fine.
Fix: identify the vertical reference of each dataset, and convert with a geoid model. See Digital Elevation Models (DEM) and Terrain Analysis and Working with Drones (UAV) and GIS, where drones typically record ellipsoidal heights.
Step by Step: Fixing It Permanently
Once you have the diagnosis, make the fix permanent. Don’t rely on on-the-fly display.
1. Choose a working CRS
Choose one projected CRS with meters, suited to your area and your task, for analysis. See Map Projections: How to Choose the Right One. Document it.
2. Make sure each layer’s own CRS is correct
Fix labels first (define), then datums and axes. Only then reproject.
3. Reproject every layer into the working CRS
- QGIS: Processing > Reproject layer, with the right coordinate operation.
- ArcGIS Pro: Project tool, with the right geographic transformation.
- GDAL:
# Vector: transform to the target CRS
ogr2ogr -f GPKG roads_utm.gpkg roads.shp -t_srs EPSG:32631
# Raster: warp to the target CRS, with an appropriate resampling method
gdalwarp -t_srs EPSG:32631 -r bilinear dem_wgs84.tif dem_utm.tif- GeoPandas:
import geopandas as gpd
roads = gpd.read_file("roads.shp")
buildings = gpd.read_file("buildings.gpkg")
target = "EPSG:32631"
roads = roads.to_crs(target)
buildings = buildings.to_crs(target)
assert roads.crs == buildings.crs- PostGIS:
ALTER TABLE roads
ALTER COLUMN geom TYPE geometry(LineString, 32631)
USING ST_Transform(geom, 32631);4. Save the results as new files
Don’t overwrite the originals. Save to a format that stores the CRS, such as GeoPackage.
5. Verify
Overlay the reprojected layers on a reference basemap. Check several locations, including the corners and edges. Measure a few known distances. Compare coordinates of landmarks with their known values.
6. Document
Write down the original and final CRS of each layer, the transformation used, the date and your verification. Include it in the metadata. See Metadata in GIS: Why It Matters and How to Create It.
A Worked Example: The Sewer Layer That Sat 80 Meters Away
- Symptom: the contractor’s manholes are about 80 meters south-east of the correct streets, consistently across the district.
- Check CRS labels: the street layer is in the national grid based on the old national datum. The sewer layer is in the modern system, based on the satellite datum. Both labels are correct.
- Pattern: a consistent shift in one direction, roughly constant across the area. This is characteristic of a datum difference.
- Hypothesis: on-the-fly projection is applying no transformation (or a low-accuracy default) between the two datums.
- Test: in the project settings, select the official transformation published by the national mapping agency, and installed with its grid file. The shift drops to under one meter.
- Make it permanent: reproject the sewer layer into the city’s working CRS, with the official transformation, and save it as a new GeoPackage.
- Verify: check a dozen manholes against known surveyed points. Residuals are about half a meter, consistent with the survey accuracy.
- Prevent: write the official transformation into the project template, and tell the contractor which system the city expects, so that future deliveries arrive in the right one.
- Result: the dig was scheduled for the right spot.
The problem was invisible to anyone who looked only at the layer names. It was obvious to anyone who looked at the pattern.
Prevention
- Define a standard working CRS for each project and organization, and write it in the project template.
- Reproject on import, and save the working copies, instead of relying on on-the-fly display.
- Check every incoming dataset’s CRS and datum before using it. See Missing or Unknown Projection: How to Fix It.
- Specify the delivery CRS (EPSG code, datum, units, vertical reference) in contracts and data requests.
- Choose and document datum transformations for your region, and install the grids that your national agency recommends.
- Use formats that carry the CRS, such as GeoPackage and GeoTIFF. See Shapefile vs. GeoJSON vs. GeoPackage: Which Format to Use?
- Validate alignment with a reference every time you receive new data, at several places.
- Keep a library of control points for your area, such as surveyed benchmarks, for quick checks.
- Be careful with web services, and test the axis order. See Intro to Web GIS APIs and OGC Standards (WMS, WFS, WMTS).
- Train the team to distinguish define from reproject, and to look at patterns rather than guess.
- Record the accuracy of each dataset in its metadata.
Common Mistakes
- Trusting on-the-fly alignment and doing analysis on mixed systems.
- Fixing the symptom by dragging or nudging a layer, instead of finding the cause.
- Forcing a CRS label to make it “look right” without evidence.
- Ignoring the datum and looking only at the projection.
- Using a default transformation of unknown accuracy.
- Not installing the datum grids the transformation needs.
- Swapping latitude and longitude and not noticing for a long time.
- Forgetting units (feet versus meters).
- Checking alignment in only one spot.
- Assuming that all misalignment is a CRS problem, when it is a data quality difference.
- Reprojecting several times in a chain, accumulating errors. Always go from the original data to the target.
- Overwriting the original files.
- Not documenting the transformation, so nobody can repeat it.
Quick Diagnosis Checklist
- Are all layer CRSs defined and correct (including datum)?
- Are the project CRS and the working CRS what you intend?
- Do the coordinate values match each CRS?
- Is the offset consistent (a systematic cause) or irregular (a data quality cause)?
- Is the offset large (label or axis problem), tens to hundreds of meters (datum), or exactly half a cell (raster convention)?
- Is the size wrong (units)?
- Is the layer flipped or mirrored (axes)?
- Is a datum transformation applied, and is it the right one?
- Are the transformation grids installed?
- Does the fix hold at several points across the whole area?
Final Thoughts
When a team argues about whose data is “wrong”, it is often a sign that both are right and nobody has asked the right question. The right question isn’t “which layer is correct?” It is “what coordinate system, datum and units is each one in, and how did we convert between them?” Once you ask it, and look at the pattern of the error, the answer is nearly always within reach.
The next time two layers refuse to meet, resist the temptation to nudge one by hand. Measure the offset, name the pattern, test one hypothesis at a time and fix the cause. You will save yourself the cost of an eighty-meter mistake.
Where to go next: continue with Fixing Topology Errors and Overlaps for problems inside a layer, and QGIS Crashes and Performance Issues: Fixes when the software itself misbehaves.



