First Look at a Geospatial File: What to Check Before You Trust It
Before you validate, fix, or check topology, it helps to know what you’re actually holding. A feature count in the thousands changes what checks are even practical. A CRS you didn’t expect explains a map that looks wrong before you’ve touched a single geometry. A handful of exact duplicates might be an import artifact, not a data-quality problem worth chasing.
This isn’t a repair tool and it isn’t a topology report: it’s the five-second first look that tells you which of those tools you actually need next.
Just want the summary, without the rest of the reading? Use the standalone tool — same engine, less prose.
1. Upload your file
A .geojson, or a shapefile: either as a single .zip, or as the individual .shp/.dbf/.shx files (and optionally .prj) selected together.
2. Why start with a summary?
Eight numbers, each answering a question you’d otherwise have to dig for:
- Features: how many rows. Determines whether an O(n²) check (like the Topology Checker’s pairwise overlap/gap detection) is even practical to run.
- Geometry type: Point, Line, Polygon, or a mix. Some checks only apply to one family; a “mixed” result is itself useful information.
- CRS: the coordinate reference system the file claims to be in. Not verified against the actual coordinates here: that mismatch detection is a distinct, more involved check, covered in Coordinate Reference Systems and the standalone CRS Inspector.
- Bounds: the bounding box, in the file’s own CRS units. A bounding box in the thousands or millions instead of the -180..180 / -90..90 range is usually the first hint of a CRS problem, before any dedicated check runs.
- Attributes: how many non-geometry columns, and their names. How much there is to a feature beyond its shape.
- Invalid: geometries that fail the Simple Features validity rules. See Geometry validity for what that actually means and how to fix it.
- Empty: geometries with no coordinates at all. Easy to miss in a raw file, and something naive code (yours or a library’s) can choke on silently.
- Duplicates: exact repeats (identical coordinates), detected by comparing binary geometry representations, not a full topological equality check. Fast enough for a large file; the Topology Checker has the slower, more thorough version if you need it.
4. Inspect: summarize your file
Run the same summary in Python or R on the current data (your file uploaded above, or the example already loaded below).
5. Same spatial question, two languages
Python and R read the same numbers off the same engines, but the accessors differ:
Python (GeoPandas)
len(gdf) # feature count
gdf.geometry.geom_type # per-feature geometry type
gdf.crs.to_string() # CRS
gdf.total_bounds # [minx, miny, maxx, maxy]
gdf.geometry.to_wkb() # exact-match key for duplicate detectionR (sf)
nrow(data) # feature count
sf::st_geometry_type(data) # per-feature geometry type
sf::st_crs(data)$input # CRS
sf::st_bbox(data) # xmin, ymin, xmax, ymax
sf::st_as_text(sf::st_geometry(data)) # exact-match keyThe CRS string is the one place they can genuinely disagree in formatting, not just vocabulary.1
1 st_crs()$input returns whatever string the file’s own CRS definition resolved to (often "EPSG:4326" for a clean case, but sometimes a full WKT string for a less common one), while GeoPandas’ .crs.to_string() goes through PyPROJ’s own formatting: same underlying CRS, not always the same displayed text. Worth knowing before assuming a mismatch between the two summary cards above means an actual data problem.
6. Load an example
The reusable cell pair above already loads a small dataset with one exact duplicate and one invalid geometry whenever nothing has been uploaded. Click ▶ Run on both languages above to see it. This button swaps in a dataset with a deliberately unusual CRS instead, to see the bounds stat do its job.2
2 Web Mercator coordinates plotted at the same zoom level as geographic coordinates land far outside any sensible map view: that’s the “bounds in the hundreds of thousands” tell in practice, not just in the abstract. Detecting exactly this kind of mismatch, and converting a file to a different CRS, is what Coordinate Reference Systems and its standalone tool do.
7. Where to next
A summary is a starting point, not an endpoint:
- CRS looks off? → Coordinate Reference Systems covers the mismatch heuristic above in depth, with conversion, or use the standalone CRS Inspector directly.
- Invalid geometries? → Geometry validity explains why, and how
make_valid()/st_make_valid()fix it, or use the standalone Validator directly. - Everything valid, but the dataset still looks wrong? → Topology errors covers overlaps, gaps, slivers, duplicates, and dangles: relationships between features, not properties of any one of them, or use the standalone Topology Checker.
- Just needed the numbers? The standalone Inspector has the same summary, no reading required.