Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RasterJoin df.toLayer etc fail on non-standard CRS / Extent col names #503

Open
vpipkt opened this issue Sep 10, 2020 · 1 comment · May be fixed by #504
Open

RasterJoin df.toLayer etc fail on non-standard CRS / Extent col names #503

vpipkt opened this issue Sep 10, 2020 · 1 comment · May be fixed by #504
Assignees
Labels
bug When it really isn't a "feature". good first issue Good for newcomers

Comments

@vpipkt
Copy link
Member

vpipkt commented Sep 10, 2020

This code:

val df = spark.read.raster //....
          .select(rf_tile($"red"), rf_extent($"red") as "red_extent", rf_crs($"red") as "red_crs")
          .toLayer(tlm)

Fails with error about column crs as crs not found. Pinpointed this to https://github.com/locationtech/rasterframes/blob/develop/core/src/main/scala/org/locationtech/rasterframes/extensions/RasterJoin.scala#L44

I believe in this case since there is no projected raster tile column (note use of rf_tile), it is trying to select crs and extent by name.

Should look for columns by type instead.

@vpipkt vpipkt added the bug When it really isn't a "feature". label Sep 10, 2020
@vpipkt vpipkt self-assigned this Sep 10, 2020
vpipkt added a commit to s22s/rasterframes that referenced this issue Sep 10, 2020
@vpipkt
Copy link
Member Author

vpipkt commented Sep 10, 2020

A highlight from the stack trace:

	at org.apache.spark.sql.Dataset.withColumn(Dataset.scala:2225)
	at org.locationtech.rasterframes.extensions.RasterJoin$$anonfun$usePRT$1$3.apply(RasterJoin.scala:46)
	at org.locationtech.rasterframes.extensions.RasterJoin$$anonfun$usePRT$1$3.apply(RasterJoin.scala:45)
	at scala.Option.map(Option.scala:146)
	at org.locationtech.rasterframes.extensions.RasterJoin$.usePRT$1(RasterJoin.scala:45)
	at org.locationtech.rasterframes.extensions.RasterJoin$.apply(RasterJoin.scala:52)
	at org.locationtech.rasterframes.extensions.ReprojectToLayer$.apply(ReprojectToLayer.scala:52)
	at org.locationtech.rasterframes.extensions.DataFrameMethods$class.toLayer(DataFrameMethods.scala:215)

@metasim metasim added the good first issue Good for newcomers label Sep 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug When it really isn't a "feature". good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants