Git Product home page Git Product logo

geotrellis's Introduction

GeoTrellis

CI Join the chat at https://gitter.im/geotrellis/geotrellis ReadTheDocs Changelog Contributing

Maven Central Snapshots

GeoTrellis is a Scala library and framework that provides APIs for reading, writing and operating on geospatial raster and vector data. GeoTrellis also provides helpers for these same operations in Spark and for performing MapAlgebra operations on rasters. It is released under the Apache 2 License.

Please visit the project site for more information as well as some interactive demos.

You're also welcome to ask questions and talk to developers (let us know what you're working on!) via Gitter.

Getting Started

GeoTrellis is currently available for Scala 2.12 and 2.13, using Spark 3.3.x.

To get started with SBT, simply add the following to your build.sbt file:

libraryDependencies += "org.locationtech.geotrellis" %% "geotrellis-raster" % "<latest version>"

To grab the latest SNAPSHOT, RC or milestone build, add these resolvers:

// maven central snapshots
resolvers ++= Seq(
  "sonatype-snapshot" at "https://oss.sonatype.org/content/repositories/snapshots/"
)

// or eclipse snapshots
resolvers ++= Seq(
  "eclipse-releases" at "https://repo.eclipse.org/content/groups/releases",
  "eclipse-snapshots" at "https://repo.eclipse.org/content/groups/snapshots"
)

If you are just getting started with GeoTrellis, we recommend familiarizing yourself with the geotrellis-raster package, but it is just one of the many available. The complete list of published GeoTrellis packages includes:

  • geotrellis-accumulo: Accumulo store integration for GeoTrellis
  • geotrellis-accumulo-spark: Accumulo store integration for GeoTrellis + Spark
  • geotrellis-cassandra: Cassandra store integration for GeoTrellis
  • geotrellis-cassandra-spark: Cassandra store integration for GeoTrellis + Spark
  • geotrellis-gdal: GDAL bindings for GeoTrellis
  • geotrellis-geotools: Conversions to and from GeoTools Vector and Raster data
  • geotrellis-hbase: HBase store integration for GeoTrellis
  • geotrellis-hbase-spark: HBase store integration for GeoTrellis + Spark
  • geotrellis-layer: Datatypes to describe sets of rasters
  • geotrellis-macros: Performance optimizations for GeoTrellis operations
  • geotrellis-proj4: Coordinate Reference systems and reproject (Scala wrapper around Proj4j)
  • geotrellis-raster: Raster data types and operations, including MapAlgebra
  • geotrellis-raster-testkit: Testkit for testing geotrellis-raster types
  • geotrellis-s3: Amazon S3 store integration for GeoTrellis
  • geotrellis-s3-spark: Amazon S3 store integration for GeoTrellis + Spark
  • geotrellis-shapefile: Read ESRI Shapefiles into GeoTrellis data types via GeoTools
  • geotrellis-spark: Geospatially enables Spark and provides primitives for external data stores
  • geotrellis-spark-pipeline: DSL for geospatial ingest jobs using GeoTrellis + Spark
  • geotrellis-spark-testkit: Testkit for testing geotrellis-spark code
  • geotrellis-store: Abstract interfaces for storage services, with concrete implementations for local and Hadoop filesystems
  • geotrellis-util: Miscellaneous GeoTrellis helpers
  • geotrellis-vector: Vector data types and operations extending JTS
  • geotrellis-vector-testkit: Testkit for testing geotrellis-vector types
  • geotrellis-vectortile: Experimental vector tile support, including reading and writing

A more complete feature list can be found on the Module Hierarchy page of the GeoTrellis documentation. If you're looking for a specific feature or operation, we suggest searching there or reaching out on Gitter.

For older releases, check the complete list of packages and versions available at locationtech-releases.

Hello Raster

scala> import geotrellis.raster._
import geotrellis.raster._

scala> import geotrellis.raster.render.ascii._
import geotrellis.raster.render.ascii._

scala> import geotrellis.raster.mapalgebra.focal._
import geotrellis.raster.mapalgebra.focal._

scala> val nd = NODATA
nd: Int = -2147483648

scala> val input = Array[Int](
     nd, 7, 1, 1,  3, 5, 9, 8, 2,
      9, 1, 1, 2,  2, 2, 4, 3, 5,
      3, 8, 1, 3,  3, 3, 1, 2, 2,
      2, 4, 7, 1, nd, 1, 8, 4, 3)
input: Array[Int] = Array(-2147483648, 7, 1, 1, 3, 5, 9, 8, 2, 9, 1, 1, 2,
2, 2, 4, 3, 5, 3, 8, 1, 3, 3, 3, 1, 2, 2, 2, 4, 7, 1, -2147483648, 1, 8, 4, 3)

scala> val iat = IntArrayTile(input, 9, 4)  // 9 and 4 here specify columns and rows
iat: geotrellis.raster.IntArrayTile = IntArrayTile([I@278434d0,9,4)

// The renderAscii method is mostly useful when you're working with small tiles
// which can be taken in at a glance.
scala> iat.renderAscii(AsciiArtEncoder.Palette.STIPLED)
res0: String =
∘█  ▚▜██▖
█  ▖▖▖▜▚▜
▚█ ▚▚▚ ▖▖
▖▜█ ∘ █▜▚

scala> val focalNeighborhood = Square(1)  // a 3x3 square neighborhood
focalNeighborhood: geotrellis.raster.op.focal.Square =
 O  O  O
 O  O  O
 O  O  O

scala> val meanTile = iat.focalMean(focalNeighborhood)
meanTile: geotrellis.raster.Tile = DoubleArrayTile([D@7e31c125,9,4)

scala> meanTile.getDouble(0, 0)  // Should equal (1 + 7 + 9) / 3
res1: Double = 5.666666666666667

Documentation

Documentation is available at geotrellis.io/documentation.

Scaladocs for the the master branch are available here.

Further examples and documentation of GeoTrellis use-cases can be found in the docs/ folder.

Contributing

Feedback and contributions to the project, no matter what kind, are always very welcome. A CLA is required for contribution, see Contributing for more information. Please refer to the Scala style guide for formatting patches to the codebase.

Where is our commit history and contributor list prior to Nov 2016?

The entire old history is available in the _old/master branch.

Why?

In November 2016, GeoTrellis moved it's repository from the GeoTrellis GitHub Organization to it's current home in the LocationTech GitHub organization. In the process of moving our repository, we went through an IP review process. Because the Eclipse foundation only reviews a snapshot of the repository, and not all of history, we had to start from a clean master branch.

Unfortunately, we lost our commit and contributor count in the move. These are significant statistics for a repository, and our current counts make us look younger than we are. GeoTrellis has been an open source project since 2011. This is what our contributor and commit count looked like before the move to LocationTech:

Commit and contributor count before LocationTech move

Along with counts, we want to make sure that all the awesome people who contributed to GeoTrellis before the LocationTech move can still be credited on a contributors page. For posterity, I will leave the following contributors page to what it was before the move:

https://github.com/lossyrob/geotrellis-before-locationtech/graphs/contributors

Tie Local History to Old History

You can also tie your local clone's master history to the old history by running

> git fetch origin refs/replace/*:refs/replace/*

if origin points to https://github.com/locationtech/geotrellis. This will allow you to see the old history for commands like git log.

geotrellis's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

geotrellis's Issues

Remove Raster#rows and Raster#cols

These are redundant with the cols/rows stored in RasterExtent.

If necessary we can write methods which call-through to RasterExtent, although ultimately we should just rewrite all uses to use the RasterExtent directly.

Add operations for compressing/decompressing rasters

It would be useful to have operations which compress and decompress their value ranges. CompressedArrayHistogram currently implements something similar, but this functionality really belongs in an operation and not in a histogram.

Add an offset to ArrayHistogram

Currently ArrayHistogram maps values directly as array indices. It would be good to add an offset parameter to modify this addressing, so that if you have data ranging from e.g. 145-316 you won't end up wasting the first 145 buckets of the histogram.

The offset can default to 0 to preserve the existing behavior. Operations involving ArrayHistogram should also be changed.

Integrate slf4j for logging

We're no longer using Configgy for logging, as that project is no longer being supported. slf4j (simple logging facade) seems like a good choice, and would let us combine our logging configuration with akka's logging configuration.

Need operations to support querying Postgis for Array[Feature]

Right now we don't really have code to do this, so you do a lot of it manually.

I think that we want to stick with manually composing SQL (at least for now) but we should at least have an operation like:

GetPointsFromPostgis(sql:Op[String]):Op[Array[Point]] or something.

Operations should automatically & asynchronously process input

Operations (or some Operations) should automatically and asynchronously run the input operations specified in their constructors. One possibility is that they will extend an Input and Output class with type parameters that describe their input and output, or we might consider using a technique from the shapeless library.

Clean up PNG rendering

Right now there's a lot of overlap, confusion, and ugliness with PNG rendering. Here's what we should aim for:

  1. Java PNGWriter class

This is an optimized class for taking a ByteBuffer of RGB data and writing it to an OutputStream using static methods.

  1. Scala PNGWriter class

This is a wrapper around the Java class that will convert a raster into a ByteBuffer.

(OPTIONAL: #1 and #2 could be combined if necesary)

  1. Code for mapping data rasters into RGB rasters based on ColorBreaks, etc
  2. Operations for doing doing #3
  3. High-level operations that given a raster and some params will generate breaks, do the mapping ,etc.

Right now we have a weird mixture of this stuff. The goal would be to move knowledge about colors and such up to step #3 from step #2.

Support full alpha channel (e.g. ARGB) for PNG

Currently we support PNG via a single transparent color value.

We should instead provide support for an alpha channel. This would allow us to support partial transparency.

We should still maintain support for 24-bit color because if we don't need alpha transparency then it's a bit more efficient.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.