geotrellis | geographic data processing engine for high performance | Dataset library
kandi X-RAY | geotrellis Summary
kandi X-RAY | geotrellis Summary
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.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of geotrellis
geotrellis Key Features
geotrellis Examples and Code Snippets
Community Discussions
Trending Discussions on geotrellis
QUESTION
I am working on a project for finding water depth and extent using digital ground model (DGM). I have multiple tiff files covering the area of interest and i want to combine them into a single tiff file for quick processing. How can i combine them using my own code below or any other methodology?
I have tried to concatenate the tiles bye getting them as an input one by one and then combining them but it throws GC error
probably because there is something wrong with code itself. The code is provided below
ANSWER
Answered 2019-Aug-08 at 00:47The idea you follow is correct, probably OOM happens since you're loading lot's of TIFFs into memory so it is not surprising. The solution is to allocate more memory for the JVM. However you can try this small optimization (that probably will work):
QUESTION
Is there a way to extract/query latitude, longitude and elevation data from a tif file using RasterFrames (http://rasterframes.io/)?
Following the documentation, I did loadRF a tif file from the following site: https://visibleearth.nasa.gov/view.php?id=73934, however all I can see is generic information and don't know which RasterFunction to use in order to extract position and elevation or any other relevant information. I did try everything I can find in the API.
I did also try to extract temperature information using the following source as well: http://worldclim.org/version2
All I get is tile column with DoubleUserDefinedNoDataArrayTile and boundary (extend or crs).
RasterStack in R can extract this information according to this blog: https://www.benjaminbell.co.uk/2018/01/extracting-data-and-making-climate-maps.html
I need a more granular DataFrame such as lat,lon,temperature(or whatever data is embedded into the tif file).
Is this possible with RasterFrames or GeoTrellis?
...ANSWER
Answered 2019-Aug-02 at 13:04The long story short - yes, it is possible (at least with GeoTrellis). It is also possible with RasterFrames, I suppose, but will require some time to figure out how to extract this data. I can't answer more detailed since I need to know more about the dataset and about the pipeline you want to perform and apply.
QUESTION
I'm writing MapBox vector tiles using geotrellis vectorpipe.
see here for the basic flow: https://geotrellis.github.io/vectorpipe/usage.html
Typically GeoJson Features can have an id
field, so that Features can be rolled up into FeatureCollections. I need to make use of this field, but vectorpipe doesn't (natively) have this capability.
This is the Feature
type used, and you can see it only has space for 1) a Geometry
and 2) a data object D
(which ends up populating properties
in the output). There is no spot for an id
.
https://geotrellis.github.io/scaladocs/latest/index.html#geotrellis.vector.Feature
Upstream there's a method called writeFeatureJsonWithID()
that does let you inject an id
field into a Feature
when writing GeoJson.
My question is this:
I have worked through the vectorpipe code (https://github.com/geotrellis/vectorpipe), and I can't figure out if/where the data ever exists as GeoJson in a way where I can override and inject the id
, maybe using the writeFeatureJsonWithID()
or something I write explicitly. A lot of conversions are implicit, but it also may never explicitly sit as json.
Any ideas for how to get an id
field in the final GeoJson written to vector tiles?
EDIT
Right now I think the trick is going to be finding a way to override .unfeature()
method here:
The problem is that the internal.vector_tile.Tile
is private, so I can construct it without forking the project.
ANSWER
Answered 2019-Mar-27 at 20:37Ended up having to fork geotrellis, hard-code a metadata => id
function in Layer.unfeature()
and compile locally to include in my project. Not ideal, but it works fine.
Also opened an issue here: https://github.com/locationtech/geotrellis/issues/2884
QUESTION
I am trying to process Sentinel 2 data from (example)
http://sentinel-s2-l1c.s3-website.eu-central-1.amazonaws.com/#tiles/10/S/EG/2016/10/12/0/
The jp2 files are not georeferenced, and I need to put all the jp2 files as bands in a geotif. I have googled aplenty and find no way to do this in Java or Scala.
I am pretty familiar with Geotools, i've done a lot of geotif processing with geotools, but I can't figure out how to
a. Make a geotif raster out of a jp2 file (given coords for the envelope), and
b. take those and make a multiband geotif out of them
I am decent with Scala, so I've looked at geotrellis, but don't see a solution with that either.
Does anyone know how to make geotifs out of JP2 files (given a polygon) and then make a multiband geotif?
thanks
...ANSWER
Answered 2018-May-17 at 12:47I've never tried this, but, I would break the problem down to:
- Import JP2 image
- GeoReference the image
- For each band in the image data, convert to GeoTiff
Step 1 will need you to make sure that you have the JP2K plugin, that page also gives some sample code showing how to use it.
Step 2 should just be a case of building a GridCoverage
using a GridCoverageFactory
- see the user guide for an example (I am assuming you know where the bounds of the grid are and it's projection etc).
Step 3 is a simple CoverageWriter
, there is an example here.
QUESTION
I want to submit a Spark job on a remote YARN cluster using the spark-submit command. My client is a Windows machine and the cluster is composed of a master and 4 slaves. I copied the Hadoop config files from my cluster to the remote machine, namely core-site.xml and yarn-site.xml and set the HADOOP_CONF_DIR variable in spark-env.sh to point to them.
However, when I submit a job using the following command :
...ANSWER
Answered 2018-Mar-13 at 21:57You need to change order or parameters passed to spark-submit
. In your configuration:
QUESTION
I'm using IntelliJ IDEA v2017.3.2 Community Edition and it seems to keep pulling the wrong repo versions for Scala plugins.
I've tried setting scalaVersion := "2.11.8" in build.sbt and idea.sbt, but it keeps trying to pull from 2.12 plugin repos.
My build.sbt is as follows:
...ANSWER
Answered 2018-Jan-15 at 23:42SBT and your application can (and most probably will) use two different Scala versions (and the one SBT uses is not controlled by the build definition file, but rather by the version of Scala that SBT itself uses). SBT 0.13.x was written in Scala 2.10.x (and that forced plugins to use that version as well) while SBT 1.0.x is now in Scala 2.12.
I believe that you can solve your issue either by downgrading to a version of SBT that supports the plugins you need, or upgrading to a version of the plugins you need that support Scala 2.12/SBT 1.0.x (for example, while sbt-assembly 0.14.3, 0.14.6 does).
QUESTION
I load a set of point from a CSV file to a RDD:
...ANSWER
Answered 2017-Nov-13 at 06:05I'll start from the last question:
Indeed to perform a reproject on a PointFeature
you can use ReprojectPointFeature
implict case class. To use it just be sure that you have import geotrellis.vector._
in reproject
function call scope.
QUESTION
I'm using geotrellis to load geotiff rasters from Landsat 8 that are sitting on S3. However, they are stored on a per-band basis. I can use S3GeoTiff
class to load individual bands, e.g.:
ANSWER
Answered 2017-Jun-09 at 17:01From the RDDs of single files with no maxTileSize
option set, you'll end up with RDDs of full images (one element). I'd recommend setting the maxTileSize option.
There's an overload that allows you to place extra information into the key. This is how I'd approach this problem generically.
Here is some code that does what you are looking for, which utilizes those options:
QUESTION
Given an RDD[(SpatialKey, Tile)]
in GeoTrellis, how do I compute the aggregate KeyBounds[SpatialKey]
?
ANSWER
Answered 2017-May-05 at 16:23For any RDD[(K, V])]
where K is Boundable, i.e. there is an implicit Boundable[K]
in scope, you can do:
QUESTION
I am working with an API written in Scala that uses SBT to build it into a JAR file. I deploy the JAR file to a virtual machine (VM) and I can execute it successfully - the API starts up and handles requests.
Now I am trying to use the IntelliJ (v 2016.3.4) remote-debug configuration to place breakpoints in the source Scala code. Here's what I have done:
1) Open my source code as a Scala SBT project in IntelliJ .
2) Opened VM port 5005
3) Executed JAR on VM:
java -noverify "-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005" -cp /home/vagrant/shared/build/geotrellis-chatta-demo-assembly-0.1-SNAPSHOT.jar geotrellis.chatta.Main
I get this output:
Listening for transport dt_socket at address: 5005
4) Added a remote-debug configuration in IntelliJ and started it. The IntelliJ console shows me this:
Connected to the target VM, address: 'localhost:5005', transport: 'socket'
However, none of my breakpoints work.
Am I missing something in the above steps? I'm very new to Scala, haven't worked with Java seriously in years, and am just starting with IntelliJ.
UPDATE: IntelliJ debugger is definitely working - if I pause it, the API stops responding to requests until it becomes un-paused. But no stops on breakpoints.
...ANSWER
Answered 2017-Feb-05 at 22:03Did you specify source code attachments for the JAR you are debugging? In IntelliJ, find the JAR and associate it with the source code.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install geotrellis
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
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page