Skip to main content

Coordinates, Geometry, and Spatial Questions

Geospatial analysis begins with a question, not a map. A coordinate is an ordered tuple in a declared coordinate reference system (CRS). A geometry gives those coordinates a spatial type such as point, line, or polygon. A feature combines geometry with identity and attributes. Confusing these layers makes attractive but meaningless results easy to produce.

Prerequisites​

You should be comfortable with tabular rows, JSON, and basic Python. Review data types and structures if needed. No GIS background is assumed.

Learning goals​

  • Separate coordinates, geometry, features, attributes, and spatial support.
  • Choose point, line, polygon, or raster representations from a measurement question.
  • Write down the unit of analysis, study extent, observation time, and boundary rule.
  • Recognize that proximity and containment require a declared CRS and predicate.

From a decision to a spatial representation​

Suppose a city team asks, “Which district has access to a clinic?” Before opening software, make the terms observable:

Decision elementDeclared meaning in this batch
unit of analysisa stable place_id or district_id, not a screen pixel
pointa teaching location represented by one longitude-latitude pair
linean ordered route trace; vertices are not automatically a traveled geodesic
polygonan administrative surface with an interior and boundary
raster cella 1,000 m by 1,000 m support area with one stored value
timea static fixture snapshot, not a claim about current services
extentthe fixture's declared coverage, not the whole city
boundary rulereported explicitly because a point can touch two district boundaries

A clinic entrance, parcel centroid, and service-area polygon are different measurements even if all describe one facility. A line between two GPS fixes does not reveal the path traveled between them. A polygon aggregate cannot be interpreted as individual behavior. Representation is part of the claim.

The repository fixtures deliberately include a point on the shared district boundary, a place with missing attributes, a self-intersecting polygon, and a line crossing the antimeridian. These are not cleanup noise; they expose choices that a production data contract must settle.

Worked example​

import json
from collections import Counter
from pathlib import Path

fixture = Path("tests/fixtures/geospatial-data-science")
files = ["places.geojson", "routes.geojson", "districts.geojson"]
features = []
for name in files:
document = json.loads((fixture / name).read_text(encoding="utf-8"))
features.extend(document["features"])

types = Counter(feature["geometry"]["type"] for feature in features)
places = [feature for feature in features if "place_id" in feature["properties"]]
boundary = next(feature for feature in places if feature["properties"]["place_id"] == "boundary-stop")
missing_kind = sum(feature["properties"]["kind"] is None for feature in places)
longitude, latitude = boundary["geometry"]["coordinates"]
print(f"features={len(features)} points={types['Point']} lines={types['LineString']} polygons={types['Polygon']}")
print(f"boundary_point=({longitude:.3f},{latitude:.3f}) missing_kind={missing_kind}")

Expected output:

features=9 points=5 lines=2 polygons=2
boundary_point=(13.400,52.520) missing_kind=1

Counting geometry types is only an inventory. It does not answer whether the point belongs to either district, whether the route length is meaningful, or whether missing kind means “unknown” rather than “no kind.” Those require explicit semantics.

Limitations and common mistakes​

  • Coordinates without a CRS are numbers, not verified Earth locations.
  • A point is often an abstraction of an object with area, uncertainty, or multiple entrances.
  • Polygon boundaries can be legally, administratively, or geometrically disputed.
  • Straight screen distance, network travel distance, and geodesic distance answer different questions.
  • Spatial coincidence does not establish causal influence.
  • This tiny fixture is designed for reasoning, not for estimating citywide performance.

Practice​

For “How many residents can reach a clinic within 20 minutes?”, define the unit, origin, destination, travel mode, time window, boundary policy, and uncertainty. Explain why a circular buffer around each clinic is not yet a travel-time answer.

Next steps​

Next, learn how a coordinate reference system and projection determine what coordinate values and units mean.

Primary sources​

Checked 2026-10-18: OGC, Simple Feature Access 1.2.1; IETF, RFC 7946 GeoJSON; Shapely, geometry and coordinate-system manual.