File tree Expand file tree Collapse file tree 6 files changed +29
-4
lines changed
pyrasterframes/src/main/python/tests Expand file tree Collapse file tree 6 files changed +29
-4
lines changed Original file line number Diff line number Diff line change 1- version = 3.0 .3
1+ version = 3.0 .4
22runner.dialect = scala212
33indent.main = 2
44indent.significant = 2
Original file line number Diff line number Diff line change 1919 *
2020 */
2121
22+ // Leave me an my custom keys alone!
23+ Global / lintUnusedKeysOnLoad := false
24+
2225addCommandAlias(" makeSite" , " docs/makeSite" )
2326addCommandAlias(" previewSite" , " docs/previewSite" )
2427addCommandAlias(" ghpagesPushSite" , " docs/ghpagesPushSite" )
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ import scala.util.matching.Regex
3030 * Standard support for creating assembly jars.
3131 */
3232object RFAssemblyPlugin extends AutoPlugin {
33- override def requires = AssemblyPlugin
33+ override def requires = AssemblyPlugin && RFDependenciesPlugin
3434
3535 implicit class RichRegex (val self : Regex ) extends AnyVal {
3636 def =~ (s : String ) = self.pattern.matcher(s).matches
@@ -64,6 +64,14 @@ object RFAssemblyPlugin extends AutoPlugin {
6464 )
6565 shadePrefixes.map(p => ShadeRule .rename(s " $p.** " -> s " shaded.rasterframes. $p.@1 " ).inAll)
6666 },
67+ assembly / assemblyShadeRules ++= Seq (
68+ ShadeRule .rename(" cats.kernel.**" -> s " shaded.rasterframes.cats.kernel.@1 " )
69+ .inLibrary(RFDependenciesPlugin .autoImport.geotrellis(" raster" ).value)
70+ .inAll,
71+ ShadeRule .rename(" cats.kernel.**" -> s " shaded.spire.cats.kernel.@1 " )
72+ .inLibrary(" org.typelevel" %% " spire" % " 0.17.0" )
73+ .inAll,
74+ ),
6775 assembly / assemblyOption :=
6876 (assembly / assemblyOption).value.withIncludeScala(false ),
6977 assembly / assemblyJarName := s " ${normalizedName.value}-assembly- ${version.value}.jar " ,
Original file line number Diff line number Diff line change @@ -69,6 +69,12 @@ object RFProjectPlugin extends AutoPlugin {
69697070 url = url(" https://github.com/echeipesh" )
7171 ),
72+ Developer (
73+ id = " pomadchin" ,
74+ name = " Grigory Pomadchin" ,
75+ 76+ url = url(" https://github.com/pomadchin" )
77+ ),
7278 Developer (
7379 id = " bguseman" ,
7480 name = " Ben Guseman" ,
Original file line number Diff line number Diff line change @@ -66,7 +66,7 @@ def test_unstructured_write_schemaless(self):
6666 from pyrasterframes .rasterfunctions import rf_agg_stats , rf_crs
6767 rf = self .spark .read .raster (self .img_uri )
6868 max = rf .agg (rf_agg_stats ('proj_raster' ).max .alias ('max' )).first ()['max' ]
69- crs = rf .select (rf_crs ('proj_raster' ).crsProj4 . alias ('c ' )).first ()['c ' ]
69+ crs = rf .select (rf_crs ('proj_raster' ).alias ('crs ' )).first ()['crs ' ]
7070
7171 dest_file = self ._tmpfile ()
7272 self .assertTrue (not dest_file .startswith ('file://' ))
Original file line number Diff line number Diff line change 44from pyrasterframes .rasterfunctions import *
55from pyrasterframes .rf_types import *
66from pyspark .sql .functions import *
7- from pyspark .sql import Row
7+ from pyspark .sql import Row , DataFrame
88from pyproj import CRS as pyCRS
99
1010from . import TestEnvironment
@@ -185,3 +185,11 @@ def test_crs_udt_serialization(self):
185185
186186 roundtrip = udt .fromInternal (udt .toInternal (crs ))
187187 assert (crs == roundtrip )
188+
189+ def test_extract_from_raster (self ):
190+ # should be able to write a projected raster tile column to path like '/data/foo/file.tif'
191+ from pyrasterframes .rasterfunctions import rf_crs
192+ rf = self .spark .read .raster (self .img_uri )
193+ crs : DataFrame = rf .select (rf_crs ('proj_raster' ).alias ('crs' )).distinct ()
194+ assert (crs .schema .fields [0 ].dataType == CrsUDT ())
195+ assert (crs .first ()['crs' ].proj4_str == '+proj=utm +zone=16 +datum=WGS84 +units=m +no_defs ' )
You can’t perform that action at this time.
0 commit comments