Apache Pinot supports multiple geospatial data types and formats, enabling you to work with location data in the most appropriate format for your use case.Documentation Index
Fetch the complete documentation index at: https://docs.startree.ai/llms.txt
Use this file to discover all available pages before exploring further.
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
| Use Case | Recommended Type | Reason |
|---|---|---|
| City-wide analysis | Geometry | Fast, sufficient accuracy |
| Global applications | Geography | Accurate across all locations |
| Small regions (< 100km) | Either | Difference is minimal |
| Navigation/GPS data | Geography | Requires precise distances |
| Engineering/CAD data | Geometry | Working in projected coordinates |
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
| Function | Purpose | Example |
|---|---|---|
ST_GeomFromGeoJson(string) | Create geometry from GeoJSON | Convert GeoJSON to internal format |
ST_GeogFromGeoJson(string) | Create geography from GeoJSON | Same but with spherical calculations |
ST_AsGeoJson(binary) | Convert to GeoJSON | Export data for web applications |
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

