locationtech / rasterframes

Geospatial Raster support for Spark DataFrames
http://rasterframes.io
Apache License 2.0
243 stars 46 forks source link

Unsupervised learning example has incorrect extent column #436

Closed metasim closed 4 years ago

metasim commented 4 years ago

Not sure if this is a problem with the notebook or with the rf_assemble_tile function, but the extent column is actually a copy of crs

Screen Shot 2019-12-06 at 3 42 57 PM
metasim commented 4 years ago

Looks like bug is in cell 3:

filenamePattern = "https://github.com/locationtech/rasterframes/" \
                  "raw/develop/core/src/test/resources/L8-B{}-Elkton-VA.tiff"
catalog_df = pd.DataFrame([
    {'b' + str(b): filenamePattern.format(b) for b in range(1, 8)}
])

df = spark.read.raster(catalog_df, catalog_col_names=catalog_df.columns)
df = df.withColumn('crs', rf_crs(df.b1)) \
       .withColumn('extent', rf_crs(df.b1))
df.printSchema()