# Upload and filter GeoParquet using spatial SQL Source: https://www.hotdata.dev/use-cases/spatial-parquet Site index: https://www.hotdata.dev/llms.txt GeoParquet usually shows up next to everything else you're querying. Load the file into an instant database and run spatial filters in the same engine without a sidecar GIS stack. ## How it works ### Step 1: Load Parquet into an instant database **Claude** ``` Create an instant database with catalog geo, declare a store_locations table, and load stores.parquet into it. What name do I use when I query it? ``` **CLI** ```bash hotdata databases create --catalog geo --table store_locations hotdata databases load --catalog geo --table store_locations --file ./stores.parquet ``` **Python SDK** ```python import hotdata db_api = hotdata.DatabasesApi(api_client) db = db_api.create_database( hotdata.CreateDatabaseRequest( name="Store locations", schemas=[hotdata.DatabaseDefaultSchemaDecl( name="public", tables=[hotdata.DatabaseDefaultTableDecl(name="store_locations")] )] ) ) uploads = hotdata.UploadsApi(api_client) with open("stores.parquet", "rb") as f: up = uploads.upload_file(f.read()) conn_api = hotdata.ConnectionsApi(api_client) conn_api.load_managed_table( db.default_connection_id, "public", "store_locations", hotdata.LoadManagedTableRequest(mode="replace", upload_id=up.upload_id), ) # Query as: SELECT * FROM default.public.store_locations ``` ### Step 2: Confirm lon/lat (or WKT) columns **Claude** ``` Show my instant databases and list the tables inside q2. ``` **CLI** ```bash hotdata databases list hotdata databases tables list ``` **Python SDK** ```python import hotdata db_api = hotdata.DatabasesApi(api_client) db_api.list_databases() db_api.get_database("") ``` ### Step 3: Radius filter from a reference point **Claude** ``` Using my store locations upload, which stores fall roughly near downtown San Francisco? Give id and name, up to 50. ``` **CLI** ```bash hotdata query "SELECT id, name FROM geo.public.store_locations WHERE ST_Distance(ST_MakePoint(lon, lat), ST_GeomFromText('POINT(-122.4194 37.7749)')) < 5000 LIMIT 50" ``` **Python SDK** ```python import hotdata query_api = hotdata.QueryApi(api_client) query_api.query( hotdata.QueryRequest( sql=( "SELECT id, name FROM default.public.store_locations WHERE " "ST_Distance(ST_MakePoint(lon, lat), " "ST_GeomFromText('POINT(-122.4194 37.7749)')) < 5000 LIMIT 50" ), ), ) ``` See [SQL Reference: Geospatial](/docs/sql#geospatial-functions) for units and other predicates (`ST_Within`, `ST_Intersects`). ## Who uses this - Field ops blending telemetry files with fixed reference points. - Growth or marketing scoring leads from uploaded geographic lists. - Anyone joining warehouse tables to geo extracts without switching dialects.