Data Type Overview
Geometry vs Geography
Understanding the difference between geometry and geography types is crucial for choosing the right approach for your spatial data:Geometry Type
Cartesian Plane Calculations
- Treats coordinates as X/Y values on a flat surface
- Distance measurements in coordinate units (often degrees)
- Best for smaller areas where Earth’s curvature is negligible
- Faster calculations but less accurate over large distances
Geography Type
Spherical Earth Calculations
- Accounts for Earth’s curvature in all calculations
- Distance measurements always in meters
- More accurate for large distances and areas near poles
- Slightly slower but geographically correct
When to Use Each Type
Supported Data Formats
Apache Pinot supports three industry-standard geospatial formats:1. Well-Known Text (WKT)
Human-readable text format that’s easy to understand and debug. Supported WKT Types:2. Well-Known Binary (WKB)
Compact binary format optimized for storage and transmission.3. GeoJSON Format
NEW: Full GeoJSON support for modern web applications and APIs. Supported GeoJSON Types:- Point, LineString, Polygon
- MultiPoint, MultiLineString, MultiPolygon
- GeometryCollection
- Feature, FeatureCollection
GeoJSON Functions
GeoJSON Examples
Point Geometry:Data Type Conversion
Between Geometry and Geography
Format Conversions
Schema Configuration
Basic Geospatial Column
Transform Function Examples
Choose the appropriate transform function based on your data source and application requirements: For Global Applications (prefer geography):Best Practices
Coordinate Order
Performance Considerations
- Geography calculations are ~10-20% slower than geometry but more accurate
- ST_Distance with geography only supports point geometries (use geometry types for linestrings/polygons)
- GeoJSON parsing has slight overhead compared to WKT
- WKB format is most compact for storage
- Multiple formats in the same table are supported but increase storage

