Skip to content

Cratis Fundamentals geospatial types in .NET

Cratis Fundamentals provides C# geospatial records for representing a location, a connected path or a bounded area. Choose Point, LineString or Polygon according to what your application needs to describe. Their JSON converters use GeoJSON, a JSON format for geographic shapes.

Type Use for
Point Single locations (addresses, landmarks, sensors)
LineString Connected paths and routes
Polygon Areas and regions bounded by rings

The records live in Cratis.Geospatial, so a model can declare whether a property holds a location, path or area. Each uses longitude before latitude. A Polygon uses a LinearRing for its outer boundary and for any holes inside it.

The GeoJSON converters are included in Cratis.Json.Globals.JsonSerializerOptions. If your code uses its own serializer options, register the converters there; choosing a record type alone does not enable GeoJSON output. Geospatial Serialization covers that setup.

Read Understanding Geospatial Types to decide which shape fits your data, then follow the type links above for construction examples.