This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val inputFile = "/Users/jiayu/Downloads/Apache_Sedona_Wherobots/gemeinde_de.geojson" | |
val featuresFile = "/Users/jiayu/Downloads/Apache_Sedona_Wherobots/gemeinde_de_features.geojson" | |
val geoJson = sparkSession.read.json(inputFile) | |
geoJson.printSchema() | |
// Sedona requires that GEOJSON schema has to be Feature, not FeatureCollection | |
// because a FeatureCollection GeoJSON does NOT follow one geometry per record | |
// See https://sedona.apache.org/tutorial/rdd/#create-a-generic-spatialrdd | |
// So we need to separate meta data and features | |
val metaData = geoJson.select("crs", "source", "type") | |
metaData.show() |
OlderNewer