Validate & Normalize GeoJSON Geometry
gis_validate_geometryValidate and normalize GeoJSON geometry for GIS servers. Ensures WGS84 coordinates, unwraps Feature wrappers, closes polygon rings, and returns compact GeoJSON ready for downstream queries.
Instructions
Validate and normalize a GeoJSON geometry string for use with GIS servers.
Checks that the geometry is a supported type with valid WGS84 [lon, lat] coordinates, unwraps Feature/FeatureCollection wrappers, and closes any unclosed polygon rings. Returns a compact, single-line GeoJSON string that can be passed directly to the FEMA NFHL (nfhl_screen_flood_zone) or USGS National Map (hydro_find_waterways, etc.) tools.
Use when: you already have coordinates/GeoJSON and want to confirm it's valid and correctly formatted before querying another GIS server. Don't use when: you want to draw a shape interactively (use gis_open_map).
Returns on success: { "valid": true, "geometry": str, # compact GeoJSON string, ready to paste downstream "summary": { # geo_type, crs_epsg, vertex_count, part_count, ... # bbox [minLon,minLat,maxLon,maxLat], approx area/length } }
Error responses:
{"valid": false, "error": "..."} — invalid JSON, unsupported type, out-of-range coordinate (e.g. swapped lat/lon), or malformed BoundingBox.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| geometry | Yes | GeoJSON geometry as a JSON string. Supported types: Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon. Also accepts a BoundingBox shorthand: {"type": "BoundingBox", "bbox": [minLon, minLat, maxLon, maxLat]}. A GeoJSON Feature or single-feature FeatureCollection is also accepted and unwrapped to a bare geometry. All coordinates must be WGS84 decimal degrees in [lon, lat] order. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||