mirror of
https://github.com/pacnpal/thrillwiki_laravel.git
synced 2025-12-20 05:31:10 -05:00
Refactor Location model to integrate PostGIS for spatial data, add legacy coordinate fields for compatibility, and enhance documentation for geocoding service implementation.
This commit is contained in:
@@ -19,9 +19,8 @@ The Location model provides polymorphic location management for parks, areas, an
|
||||
- `country` (string) - Country name
|
||||
- `postal_code` (string, nullable) - Postal/ZIP code
|
||||
|
||||
- **Coordinates**
|
||||
- `latitude` (decimal, 10,8) - Latitude coordinate
|
||||
- `longitude` (decimal, 11,8) - Longitude coordinate
|
||||
- **Spatial Data**
|
||||
- `coordinates` (point) - PostGIS point geometry with SRID 4326
|
||||
- `elevation` (decimal, 8,2, nullable) - Elevation in meters
|
||||
|
||||
- **Additional Details**
|
||||
@@ -35,10 +34,17 @@ The Location model provides polymorphic location management for parks, areas, an
|
||||
- `geocoded_at` (timestamp, nullable) - Last geocoding timestamp
|
||||
|
||||
### Indexes
|
||||
- Coordinates: `(latitude, longitude)`
|
||||
- Spatial: `coordinates` (spatial index for efficient queries)
|
||||
- Location: `(country, state, city)`
|
||||
- Postal: `postal_code`
|
||||
|
||||
### PostGIS Integration
|
||||
- Uses PostGIS point type for coordinates
|
||||
- SRID 4326 (WGS 84) for global coordinates
|
||||
- Spatial indexing for efficient queries
|
||||
- Native distance calculations
|
||||
- Geographic vs Geometric operations
|
||||
|
||||
## Relationships
|
||||
|
||||
### Polymorphic
|
||||
|
||||
Reference in New Issue
Block a user