Data naming conventions
To ensure data loads correctly, please adhere to the following rules.-
File naming: Files and directories must not start with an underscore (
_) or a period (.). These files will be ignored and result in anAnalysisException: [UNABLE_TO_INFER_SCHEMA]error.- Incorrect:
_my_data.parquet - Correct:
my_data.parquet
- Incorrect:
-
S3 storage path: When loading from S3, the bucket name cannot contain periods (
.).- Incorrect:
s3://wherobots.sf.data/ - Correct:
s3://wherobots-sf-data/
- Incorrect:
-
Incorrect Path:
s3://wherobots.sf.data/2025/_august_parcels.parquetThis path will fail because the bucket name (wherobots.sf.data) contains periods and the filename (_august_parcels.parquet) starts with an underscore. -
Correct Path:
s3://wherobots-sf-data/2025/august_parcels.parquetThis path is valid because the bucket name uses dashes instead of periods and the leading underscore is removed from the filename.
Load data from text files
Assume we have a WKT file, namelyusa-county.tsv, at Path /Download/usa-county.tsv as follows:
Load a raw DataFrame
Use the following code to load the data and create a raw DataFrame:- Scala
- Java
- Python
Create a Geometry type column
All geometrical operations in Spatial SQL are on Geometry type objects. Therefore, before any kind of queries, you need to create a Geometry type column on a DataFrame.spatialdDf. The output will be something like this:
Spatial SQL provides lots of functions to create a Geometry column, please read Spatial SQL constructor API.
Load GeoJSON Data
WherobotsDB supports reading GeoJSON files using thegeojson data source. It is designed to handle JSON files that use GeoJSON format for their geometries.
This includes SpatioTemporal Asset Catalog (STAC) files, GeoJSON features, GeoJSON feature collections and other variations.
The key functionality lies in the way ‘geometry’ fields are processed: these are specifically read as Sedona’s GeometryUDT type, ensuring integration with Sedona’s suite of spatial functions.
Load MultiLine GeoJSON FeatureCollection
Suppose we have a GeoJSON FeatureCollection file as follows. This entire file is considered as a single GeoJSON FeatureCollection object. Multiline format is preferable for scenarios where files need to be human-readable or manually edited.multiLine option to True to read multiline GeoJSON files.
- Python
- Scala
- Java
Load Single Line GeoJSON Features
Suppose we have a single-line GeoJSON Features dataset as follows. Each line is a single GeoJSON Feature. This format is efficient for processing large datasets where each line is a separate, self-contained GeoJSON object.option is not specified, WherobotsDB reads a GeoJSON file as a single line GeoJSON.
- Python
- Scala
- Java
Load Shapefile
WherobotsDB supports loading Shapefile as a DataFrame.- Scala/Java
- Java
- Python
.shp file.
- When the input path is a directory, all shapefiles directly under the directory will be loaded. If you want to load all shapefiles in subdirectories, please specify
.option("recursiveFileLookup", "true"). - When the input path is a
.shpfile, that shapefile will be loaded. Sedona will look for sibling files (.dbf,.shx, etc.) with the same main file name and load them automatically.
geometry by default. You can change the name of the geometry column using the geometry.name option. If one of the non-spatial attributes is named “geometry”, geometry.name must be configured to avoid conflict.
- Scala/Java
- Java
- Python
key.name option to the name of the record number column:
- Scala/Java
- Java
- Python
.cpg file. If you see garbled values in string fields, you can manually specify the correct charset using the charset option. For example:
- Scala/Java
- Java
- Python
Load GeoParquet
WherobotsDB natively supports loading GeoParquet file. Wherobots will infer geometry fields using the “geo” metadata in GeoParquet files.- Scala
- Java
- Python
Inspect GeoParquet metadata
WherobotsDB provides a Spark SQL data source"geoparquet.metadata" for inspecting GeoParquet metadata. The resulting dataframe contains
the “geo” metadata for each input file.
- Scala/Java
- Java
- Python
version, primary_column and columns fields of the resulting dataframe will be null.
geoparquet.metadata only supports reading GeoParquet specific metadata. Users can use G-Research/spark-extension to read comprehensive metadata of generic Parquet files.Load from GeoPackage
WherobotsDB supports loading Geopackage file format as a DataFrame.- Scala/Java
- Java
- Python
- Scala/Java
- Java
- Python
- Scala/Java
- Java
- Python
- webp rasters are not supported
- ewkb geometries are not supported
- filtering based on geometries envelopes are not supported
Load from OSM PBF
WherobotsDB supports loading OSM PBF file format as a DataFrame.- Scala/Java
- Java
- Python
idis the unique identifier of the object.kindis the type of the object, it can benode,wayorrelation.locationis the location of the object, it contains thelongitudeandlatitudeof the object.tagsis a map of key-value pairs that represent the tags of the object.refsis an array of the references of the object.ref_rolesis an array of the roles of the references.ref_typesis an array of the types of the references.
Load data from JDBC data sources (PostGIS)
The ‘query’ option in Spark SQL’s JDBC data source can be used to convert geometry columns to a format that WherobotsDB can interpret. This should work for most spatial JDBC data sources. For Postgis there is no need to add a query to convert geometry types since it’s already using EWKB as it’s wire format.- Scala
- Java
- Python
Load data from GeoPandas file reader
WherobotsDB Python has implemented serializers and deserializers which allows to convert WherobotsDB Geometry objects into Shapely BaseGeometry objects. Based on that it is possible to load the data with geopandas from file and create Sedona DataFrame based on GeoDataFrame object.create_spatial_dataframe method in Sedona.
Load data from Python Shapely
The following Shapely geometry types are supported:- Point
- MultiPoint
- LineString
- MultiLinestring
- Polygon
- MultiPolygon
Create a schema
To create Spark DataFrame from Shapely objects, you need to first create a schema. Please use GeometryType from sedona.sql.types module.Create Shapely geometries
Now you can create Shapely geometries and convert them to a Sedona DataFrame.- Point
- MultiPoint
- LineString
- MultiLineString
- Polygon
- MultiPolygon
Confirm the DataFrame structure
Load data from Snowflake
Tables created in Snowflake can be loaded on to Sedona Dataframes using Sedona. Once the data is loaded, it can be processed using the extensive catalog and efficient computation of WherobotsDB. In order to enable bi-directional communication between Spark and Snowflake, a map of configuration parameters must be passed asoptions to the SedonaContext object.
The configuration parameters include connection and context options. Details on the possible values of these options can be found here.
Load entire table from Snowflake
Thedbtable option can be used to load the contents of the entire table from Snowflake to a Sedona Dataframe, effectively running a SELECT * FROM table query.
- Python
- Scala
- Java
Load query results from Snowflake
Thequery option can be used to load the results of a query. Snowflake employs query and predicate pushdown which is enabled by default.
If you wish to disable pushdown, the autopushdown option can be used with value as off.
- Python
- Scala
- Java
Load data from AWS RDS PostGIS
Tables created in a AWS RDS PostGIS (PostgreSQL) instance can be imported on to Sedona Dataframes using Sedona. Once the data is loaded, it can be processed using the extensive catalog and efficient computation of WherobotsDB. Data can be loaded on to a Sedona Dataframe using theload() function. A map of configuration and context options must be passed to establish connection with the RDS instance.
If you’re unable to establish connection with the RDS instance, double check if the instance is accessible by the server running this code.
For more information on intra or inter VPC connection with the RDS instance, consult here.
Load entire table from RDS
Thedbtable option can be used to load the contents of the entire table from RDS to a Sedona Dataframe, effectively running a SELECT * FROM table query.
- Python
- Scala
- Java
Load query results from RDS
Thequery option can be used to load the results of a query.
- Python
- Scala
- Java

