GeoPandas "Geometry Is in a Geographic CRS" Warning: How to Fix It
On this page
Problem statement
When you calculate area, length, or distance on a GeoDataFrame, GeoPandas may print a warning like this:
UserWarning: Geometry is in a geographic CRS. Results from 'area' are likely incorrect. Use 'GeoSeries.to_crs()' to re-project geometries to a projected CRS before this operation.
The same warning, with the operation's name in quotes, appears for the other operations whose answer depends on distance. Run against Colorado's 64 counties with GeoPandas 1.1, it fired for area, length, centroid, buffer, distance and sjoin_nearest — and did not fire for simplify, representative_point or union_all, even though simplify(0.01) is also working in degrees.
In practice it shows up in one of these ways:
- you call
.areaand get a tiny number: Denver County comes out as 0.0421 - you call
.lengthor.distance()and get a value in degrees, not metres .buffer()produces an ellipse instead of a circle.centroidwarns even though it returns a plausible-looking point
The geometry is stored as longitude and latitude, and in Colorado a degree of longitude is about 86 km of ground while a degree of latitude is about 111, so anything measured directly on degrees mixes two different lengths. Why that cannot be corrected by a factor is in projected vs geographic CRS; this page is the fix.
The warning is usually caused by one of these situations:
- the layer is in
EPSG:4326(WGS 84), or another geographic CRS such asEPSG:4269(NAD83), which is what US Census boundary files use - the data was loaded from GeoJSON, which is longitude/latitude by convention
- a metric operation ran before any
to_crs() - the result was read as metres when it was actually in degrees
Quick answer
If GeoPandas warns that your geometry is in a geographic CRS:
- check the CRS with
gdf.crsandgdf.crs.is_geographic - reproject to a projected CRS with
to_crs()before measuring - choose one suited to the extent: a UTM zone or national grid for local data, an equal-area CRS for area over a wide region
- run
.area,.length, or.distance()on the reprojected data - read the result in the projected CRS's units, usually metres
The data here is real: the US Census Bureau's 2024 county boundaries for Colorado, which are in NAD83.
import geopandas as gpd
counties = gpd.read_file("data/colorado_counties.shp") # EPSG:4269, degrees
print(counties.crs, "geographic:", counties.crs.is_geographic)
projected = counties.to_crs(counties.estimate_utm_crs())
projected["area_km2"] = projected.area / 1e6
print(projected.crs.name)
print(projected.set_index("NAME")["area_km2"].loc[["Denver", "Broomfield", "Las Animas"]].round(1))
EPSG:4269 geographic: True
WGS 84 / UTM zone 13N
NAME
Denver 400.4
Broomfield 86.9
Las Animas 12358.6
Name: area_km2, dtype: float64
The warning disappears because the geometry is now in metres. For Colorado the UTM areas are within 0.2% of the true area on the ellipsoid; the tables below show how that was checked.
Picking the right projected CRS
Confirm it is geographic, project, measure, read the units
Step 1: Confirm the CRS is geographic
A geographic CRS stores coordinates as longitude and latitude in degrees. Check it directly, and look at the axis units rather than trusting the EPSG code from memory:
print(counties.crs.name, counties.crs.is_geographic)
print([axis.unit_name for axis in counties.crs.axis_info])
print(counties.total_bounds.round(2))
NAD83 True
['degree', 'degree']
[-109.06 36.99 -102.04 41. ]
is_geographic is True for any longitude/latitude CRS, not just EPSG:4326. Coordinates between -180 and 180 are a second clue.
If gdf.crs is None, that is a different problem: GeoPandas has no CRS at all, and you need to assign the correct one with set_crs() before reprojecting.
Step 2: Choose a projected CRS
For a single US state the usual candidates are its UTM zone, a State Plane zone, or Conus Albers (EPSG:5070) when area over a wide region is the result; choosing a projected CRS goes through the choice in general. GeoPandas can pick the UTM zone for you:
utm = counties.estimate_utm_crs()
print(utm, "-", utm.name)
EPSG:32613 - WGS 84 / UTM zone 13N
It uses the centre of the layer's bounds. Colorado runs from 102°W to 109°W, and zone 13N covers 102°W to 108°W, so the westernmost counties are just outside their zone — Step 4 measures what that costs.
Step 3: Reproject with to_crs()
Use to_crs() to transform the coordinates into the projected CRS. This changes the coordinate values from degrees to metres.
counties_utm = counties.to_crs(utm)
print(counties_utm.crs.is_geographic, counties_utm.total_bounds.round(0))
False [ 139985. 4094066. 763240. 4546736.]
set_crs() would be the wrong call here: it relabels the degree values as metres without converting them (set_crs vs to_crs).
Step 4: Run the measurement
With the data in a projected CRS, the metric operations are valid and the warning is gone. To see how good the numbers are, compare them with the area computed on the ellipsoid itself by pyproj.Geod, which needs no projection at all:
from pyproj import Geod
geod = Geod(ellps="GRS80") # NAD83's ellipsoid
counties["true_km2"] = [abs(geod.geometry_area_perimeter(g)[0]) / 1e6 for g in counties.geometry]
for crs in [utm, "EPSG:5070", "EPSG:3857"]:
km2 = counties.to_crs(crs).area / 1e6
error = (km2 / counties["true_km2"] - 1) * 100
print(f"{str(crs):11} total {km2.sum():>9,.0f} km² median error {error.median():+7.3f}% worst {error.abs().max():6.3f}%")
print(f"{'ellipsoid':11} total {counties['true_km2'].sum():>9,.0f} km²")
EPSG:32613 total 269,603 km² median error -0.044% worst 0.172%
EPSG:5070 total 269,600 km² median error -0.000% worst 0.002%
EPSG:3857 total 447,303 km² median error +65.511% worst 75.094%
ellipsoid total 269,600 km²
UTM zone 13N is within 0.2% for every county. Near the zone's central meridian, 105°W, it shrinks areas by 0.08% — UTM's scale factor there is 0.9996 by design — and the largest errors, +0.17%, are Montezuma, Dolores and Mesa, the westernmost counties, which lie past the zone's edge. Conus Albers, an equal-area projection, is essentially exact. Web Mercator (EPSG:3857) also uses metres and also silences the warning — and overstates every county, by between 65% and 75% depending on its latitude.
Step 5: Interpret the units
The units come from the projected CRS, not from GeoPandas. For UTM and most metric grids, the units are metres, so .area returns square metres and .length and .distance() return metres. Some CRS are in feet — US State Plane zones often are — so check before dividing:
print(counties_utm.crs.axis_info[0].unit_name)
print(gpd.GeoSeries(crs="EPSG:2232").crs.name, "-", gpd.GeoSeries(crs="EPSG:2232").crs.axis_info[0].unit_name)
metre
NAD83 / Colorado Central (ftUS) - US survey foot
Colorado counties measured in metres
The data used on this page
Two real layers for Colorado, downloaded by the block below:
- Counties — the US Census Bureau's 2024 cartographic boundary file for counties (1:500,000), filtered to Colorado's 64 counties. It is in NAD83 (
EPSG:4269) and carries the Census land and water areasALANDandAWATERin square metres. - Stations — Amtrak's train stations in Colorado from the Bureau of Transportation Statistics' National Transportation Atlas Database, as GeoJSON in WGS 84. The layer also lists Amtrak's bus stops; only the 10 train stations are kept.
import io
import os
import zipfile
import geopandas as gpd
import requests
os.makedirs("data", exist_ok=True)
if not os.path.exists("data/colorado_counties.shp"):
reply = requests.get("https://www2.census.gov/geo/tiger/GENZ2024/shp/cb_2024_us_county_500k.zip", timeout=300)
reply.raise_for_status()
zipfile.ZipFile(io.BytesIO(reply.content)).extractall("census")
us = gpd.read_file("census/cb_2024_us_county_500k.shp")
us[us["STUSPS"] == "CO"][["GEOID", "NAME", "ALAND", "AWATER", "geometry"]].to_file("data/colorado_counties.shp")
if not os.path.exists("data/colorado_stations.geojson"):
reply = requests.get("https://services.arcgis.com/xOi1kZaI0eWDREZv/arcgis/rest/services/"
"NTAD_Amtrak_Stations/FeatureServer/0/query",
params={"where": "State='CO' AND StnType='TRAIN'", "outFields": "Code,StationName",
"f": "geojson"}, timeout=120)
reply.raise_for_status()
open("data/colorado_stations.geojson", "wb").write(reply.content)
for name in ("colorado_counties.shp", "colorado_stations.geojson"):
layer = gpd.read_file("data/" + name)
print(f"{name:26} {len(layer):>3} features {layer.crs}")
colorado_counties.shp 64 features EPSG:4269
colorado_stations.geojson 10 features EPSG:4326
Example 1: Reproduce and fix the warning
import warnings
import geopandas as gpd
counties = gpd.read_file("data/colorado_counties.shp")
denver = counties[counties["NAME"] == "Denver"]
with warnings.catch_warnings(record=True) as caught:
warnings.simplefilter("always")
area_wrong = denver.area.iloc[0]
print("warned:", [str(w.message).split(".")[0] for w in caught])
area_right = denver.to_crs("EPSG:5070").area.iloc[0]
print(f"in degrees: {area_wrong:.4f}")
print(f"in EPSG:5070: {area_right / 1e6:.1f} km²")
print(f"in EPSG:3857: {denver.to_crs('EPSG:3857').area.iloc[0] / 1e6:.1f} km² (no warning)")
print(f"Census ALAND + AWATER: {(denver['ALAND'] + denver['AWATER']).iloc[0] / 1e6:.1f} km²")
warned: ['Geometry is in a geographic CRS']
in degrees: 0.0421
in EPSG:5070: 400.7 km²
in EPSG:3857: 679.0 km² (no warning)
Census ALAND + AWATER: 400.7 km²
The Census figure is computed from the full-resolution TIGER boundary, so it differs a little from the simplified 1:500,000 outline used here.
Example 2: Distance between two points in metres
The straight-line distance between the Colosseum and the Eiffel Tower, measured four ways:
import geopandas as gpd
from pyproj import Geod
from shapely.geometry import Point
points = gpd.GeoSeries([Point(12.4924, 41.8902), Point(2.2945, 48.8584)], crs="EPSG:4326")
_, _, metres = Geod(ellps="WGS84").inv(12.4924, 41.8902, 2.2945, 48.8584)
print(f"ellipsoid (pyproj.Geod): {metres / 1000:8.1f} km")
for crs in ["EPSG:3035", "EPSG:3857"]:
p = points.to_crs(crs)
print(f"{crs}: {p.iloc[0].distance(p.iloc[1]) / 1000:8.1f} km")
print(f"EPSG:4326, no reprojection: {points.iloc[0].distance(points.iloc[1]):.2f} 'units'")
ellipsoid (pyproj.Geod): 1110.8 km
EPSG:3035: 1111.2 km
EPSG:3857: 1585.1 km
EPSG:4326, no reprojection: 12.35 'units'
EPSG:3035 (Lambert Azimuthal Equal Area for Europe) is equal-area, not equidistant, but over 1,100 km it is within half a kilometre of the ellipsoid. Web Mercator is 43% too long. And the unprojected answer is a distance in degrees — a number with no meaning on the ground, since a degree of longitude and a degree of latitude are different lengths here. For distances between points, pyproj.Geod is the direct route.
Example 3: Buffer in metres, then return to WGS 84
A 500 m catchment around each Colorado Amtrak station:
import geopandas as gpd
stations = gpd.read_file("data/colorado_stations.geojson") # EPSG:4326
utm = stations.estimate_utm_crs()
catchments = stations.to_crs(utm).buffer(500)
print(f"{catchments.area.mean():,.0f} m² each; a 500 m circle is {3.14159 * 500**2:,.0f} m²")
degree_buffer = stations.buffer(0.005).to_crs(utm).bounds # "about 500 m" in degrees
print("0.005° buffer, half-width east-west:", round(((degree_buffer.maxx - degree_buffer.minx) / 2).median()), "m")
print("0.005° buffer, half-height north-south:", round(((degree_buffer.maxy - degree_buffer.miny) / 2).median()), "m")
catchments_4326 = catchments.to_crs("EPSG:4326") # back to lon/lat for a web map
print(catchments_4326.crs)
784,137 m² each; a 500 m circle is 785,398 m²
0.005° buffer, half-width east-west: 429 m
0.005° buffer, half-height north-south: 555 m
EPSG:4326
The buffer in metres is a circle to within the polygon approximation GEOS uses. A buffer of 0.005 in degrees is an ellipse: wider north–south than east–west, because at Colorado's latitude a degree of longitude is shorter than a degree of latitude. And buffer(500) on the unprojected layer would be 500 degrees — a shape wider than the planet.
Example 4: Area across the lower 48 with an equal-area CRS
For area over a wide region, one UTM zone is not enough. Here every county in the conterminous United States is measured in Conus Albers and compared with the Census Bureau's own land and water area:
import geopandas as gpd
us = gpd.read_file("census/cb_2024_us_county_500k.shp")
lower48 = us[~us["STUSPS"].isin(["AK", "HI", "PR", "GU", "VI", "MP", "AS"])].to_crs("EPSG:5070")
albers_km2 = lower48.area / 1e6
census_km2 = (lower48["ALAND"] + lower48["AWATER"]) / 1e6
ratio = albers_km2 / census_km2
print(f"{len(lower48):,} counties; median ratio {ratio.median():.4f}")
print(f"within 1% of the Census figure: {(abs(ratio - 1) < 0.01).mean():.0%}")
worst = lower48.assign(ratio=ratio).sort_values("ratio")
print(worst[["NAME", "STUSPS", "ratio"]].head(3).round(3).to_string(index=False))
3,109 counties; median ratio 1.0000
within 1% of the Census figure: 90%
NAME STUSPS ratio
Keweenaw MI 0.098
Leelanau MI 0.149
Alger MI 0.186
The median county agrees to four decimal places, and 90% are within 1%. The outliers are counties whose legal boundary runs out into a lake or the sea: Keweenaw County, Michigan, is mostly Lake Superior in the Census figures, while the 1:500,000 cartographic file clips it to the shoreline, so the projected area is under a tenth of the Census one. That is a difference in the boundaries, not an error in the projection.
Angles are not lengths
Coordinates only have meaning relative to a CRS. A geographic CRS such as EPSG:4326 describes positions as angles: longitude and latitude in degrees. A projected CRS flattens the curved earth onto a plane and describes positions as linear distances, usually meters.
When you call .area on a geographic CRS, GeoPandas computes a planar area using the degree values as if they were on a flat grid. But degrees are not constant in size. One degree of latitude is roughly the same distance everywhere, while one degree of longitude shrinks toward the poles. So the same shape produces different "area" numbers depending on where it sits, and none of them are square metres: Denver's 0.0421 square degrees is 400.7 km², and the same 0.0421 would be about 30% more ground at the equator. That is why GeoPandas warns you and recommends reprojecting.
Reprojecting with to_crs() transforms the geometry into linear units, so area, length, distance, and buffer all behave as expected. The trade-off is that every flat projection distorts something. UTM keeps distortion small within its 6° zone — under 0.2% of area across Colorado. An equal-area projection keeps area correct across a wide region but distorts shape. Choose the projection that preserves the property you care about for your task.
EPSG:3857 (Web Mercator) is a projected CRS in metres, so it silences the warning, but it is not equal-area: its scale grows with latitude, and in Colorado it overstated county areas by 65–75% and would do so by far more in Alaska or Scandinavia. Use it for tiled web maps, never for measuring.
None CRSs, Web Mercator and estimate_utm_crs
None CRS is a different problem
If gdf.crs is None, GeoPandas cannot reproject at all. Assign the correct source CRS with set_crs() first, then reproject with to_crs().
Web Mercator silences the warning but is still wrong
EPSG:3857 is projected, so the warning disappears — the most dangerous fix, because the numbers look like metres. Across Colorado's counties it was 65–75% too large; between the Colosseum and the Eiffel Tower, 43% too long.
estimate_utm_crs() uses the centre of the bounds
estimate_utm_crs() picks the UTM zone containing the centre of the layer's bounding box. Colorado's western counties fall outside zone 13N and pick up the largest error, though still under 0.2%. For data spanning several zones, use an equal-area CRS for area, or measure on the ellipsoid.
Some operations are not covered by the warning
Which operations warn is decided inside GeoPandas, one method at a time. Checking them on the counties:
import warnings
checks = {
"area": lambda: counties.area, "length": lambda: counties.length,
"centroid": lambda: counties.centroid, "buffer": lambda: counties.buffer(0.01),
"distance": lambda: counties.distance(counties.geometry.iloc[0]),
"sjoin_nearest": lambda: gpd.sjoin_nearest(counties.head(3), counties),
"simplify": lambda: counties.simplify(0.01),
"representative_point": lambda: counties.representative_point(),
"union_all": lambda: counties.union_all(),
}
for name, run in checks.items():
with warnings.catch_warnings(record=True) as caught:
warnings.simplefilter("always")
run()
print(f"{name:21} {'warns' if caught else 'silent'}")
area warns
length warns
centroid warns
buffer warns
distance warns
sjoin_nearest warns
simplify silent
representative_point silent
union_all silent
simplify() takes its tolerance in the layer's units and does not warn, so simplify(100) on a longitude/latitude layer collapses every county to a triangle without a message. The same is true of representative_point() and union_all(), which are fine in degrees, and of anything you compute yourself from the raw coordinates.
Centroids move, a little
.centroid warns because a centroid computed on degrees is not the centroid on the ground:
counties = gpd.read_file("data/colorado_counties.shp")
in_degrees = counties.centroid.to_crs("EPSG:5070") # warns
projected = counties.to_crs("EPSG:5070").centroid
offset = in_degrees.distance(projected)
print(f"median {offset.median():.0f} m, largest {offset.max():.0f} m")
median 28 m, largest 149 m
Tens of metres for a county is often harmless for labelling, but not for anything that treats the centroid as a precise location.
The warning is informational, not an error
GeoPandas still returns a number when it warns. The risk is silently using a wrong value, so treat the warning as a prompt to reproject rather than something to ignore.
Combining geometries before measuring
union_all() does not care about units, so it is safe to dissolve before reprojecting — but measure the result only after to_crs().
Internal links
For the core workflow, see How to Calculate Area and Distance in GeoPandas (Correctly) and How to Reproject Spatial Data in Python (GeoPandas).
Related task guides:
- How to Create Buffers in GeoPandas for Spatial Analysis
- How to Get Polygon Centroids in GeoPandas
- How to Fix CRS Mismatch in GeoPandas
For the underlying concepts, read Coordinate Reference Systems (CRS) Explained for Python GIS and EPSG Codes Explained: How to Choose the Right CRS in Python.
FAQ
Why does GeoPandas say my geometry is in a geographic CRS?
Because the layer stores coordinates as longitude and latitude in degrees, usually EPSG:4326. Area, length, and distance computed on degrees are not in meters and are geometrically incorrect, so GeoPandas warns you to reproject first.
How do I get rid of the warning the right way?
Reproject to a projected CRS with to_crs() before measuring, for example gdf.to_crs(gdf.estimate_utm_crs()). Then call .area, .length, or .distance() on the reprojected data.
Can I just use EPSG:3857 to remove the warning?
It silences the warning because it is projected, but Web Mercator distorts area and distance away from the equator. Use a UTM zone or an equal-area CRS such as EPSG:5070 for measurements. Across Colorado it overstated county areas by 65–75%.
What units are my results in after reprojecting?
The units come from the projected CRS. UTM and most equal-area and national grids use metres, so .area returns square metres and .length and .distance() return metres. US State Plane zones are often in US survey feet; check crs.axis_info[0].unit_name.
Does the warning mean my data is corrupted or stored incorrectly?
No. The warning is purely about the operation, not the data. Storing geometry in EPSG:4326 is normal and correct for many purposes; the warning only fires because you ran a metric operation (area, length, distance, buffer, centroid) on angular coordinates, and it disappears once you reproject with to_crs().
How do I suppress the warning if I genuinely know what I'm doing?
You can wrap the call in warnings.catch_warnings() and filter UserWarning, but only do this when the result truly does not need linear units. In almost all cases the correct fix is reprojecting with to_crs(), not silencing the message.
Does .centroid give a wrong answer in a geographic CRS, or just warn?
The centroid is computed on the planar degree coordinates, so its position is off — for Colorado's counties by a median of 28 m and at most 149 m — and it warns for that reason. For accurate centroids, reproject with to_crs() first, compute .centroid, then reproject back to EPSG:4326 if you need lon/lat output.
Can I measure on EPSG:4326 without reprojecting by using a geodesic method instead?
Yes. For a small number of measurements you can compute geodesic area or distance directly on the ellipsoid, for example with pyproj.Geod, which avoids any projection distortion. For bulk vectorized work, reprojecting to a projected CRS with to_crs() is usually simpler and fast enough.