Skip to content

Add toString and comments - #3217

Merged
echeipesh merged 6 commits into
locationtech:masterfrom
echeipesh:docs/updates
Apr 4, 2020
Merged

echeipesh merged 6 commits into
locationtech:masterfrom
echeipesh:docs/updates

Conversation

@echeipesh

@echeipesh echeipesh commented Apr 1, 2020 •

Copy link
Copy Markdown
Contributor

Added some toString overrides to commonly used classes that make the REPL output more readable.

Demo

scala> val source = GeoTiffRasterSource("/tmp/aspect.tif")
source: geotrellis.raster.geotiff.GeoTiffRasterSource = GeoTiffRasterSource(/tmp/aspect.tif)

scala> val wm = source.reproject(WebMercator)
wm: geotrellis.raster.RasterSource = GeoTiffReprojectRasterSource(/tmp/aspect.tif,WebMercator,DefaultTarget,NearestNeighbor)

scala> val raster = wm.read(GridBounds(0L,0L,255L,255L)).get
raster: geotrellis.raster.Raster[geotrellis.raster.MultibandTile] = Raster(ArrayMultibandTile(256,256,1,float32ud-9999.0),Extent(-8769150.640916323, 4271288.442457698, -8765983.641700394, 4274455.441673627))

scala> raster.tile.band(0)
res0: geotrellis.raster.Tile = ArrayTile(256,256,float32ud-9999.0)

@CloudNiner CloudNiner left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice smattering of code cleanup and QoL improvements. I know you didn't assign anyone yet but this LGTM

def convert(targetCellType: TargetCellType): RasterSource =
GeoTiffReprojectRasterSource(dataPath, crs, resampleTarget, resampleMethod, strategy, targetCellType = Some(targetCellType))

override def toString: String = s"GeoTiffReprojectRasterSource(${dataPath.value},$crs,$resampleTarget,$resampleMethod)"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GeoTiffReprojectRasterSource will have an additional parameter OverviewStrategy in #3200. Should we add that to this method as well?

}
}

override def toString: String = s"GeoTiffResampleRasterSource(${dataPath.value},$resampleTarget,$method)"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GeoTiffResampleRasterSource will have an additional parameter OverviewStrategy in #3200. Should we add that to this method as well?

}

override def hashCode: Int =
override def hashCode(): Int =

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for reminding, I updated the Scala 2.13 migration issue #2893

It is added automatically VS Code and version of this plugin changes frequently
Some subclasses are case classes and thats already fine.
Comment thread .travis/hbase-install.sh
sudo mv $HOME/downloads/hbase-2.2.3-bin.tar.gz hbase-2.2.3-bin.tar.gz && tar xzf hbase-2.2.3-bin.tar.gz
sudo rm -f hbase-2.2.3/conf/hbase-site.xml && sudo mv .travis/hbase/hbase-site.xml hbase-2.2.3/conf
sudo hbase-2.2.3/bin/start-hbase.sh
if [ ! -f $HOME/downloads/hbase-2.2.4-bin.tar.gz ]; then sudo wget -O $HOME/downloads/hbase-2.2.4-bin.tar.gz http://www-us.apache.org/dist/hbase/2.2.4/hbase-2.2.4-bin.tar.gz; fi

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah annoying ):

@echeipesh
echeipesh merged commit 9649420 into locationtech:master Apr 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants