GithubHelp home page GithubHelp logo

geotiff / geoblaze Goto Github PK

View Code? Open in Web Editor NEW
178.0 12.0 28.0 76.97 MB

Blazing Fast JavaScript Raster Processing Engine

Home Page: http://geoblaze.io

License: MIT License

JavaScript 92.28% Shell 4.88% Python 1.96% HTML 0.88%
geotiff satellite satellite-imagery raster gis maps remote-sensing

geoblaze's Introduction

GeoBlaze

A blazing fast javascript raster processing engine


GeoBlaze is a geospatial raster processing engine written purely in javascript. Powered by geotiffjs, it provides tools to analyze GeoTIFFs. Using geoblaze, you can run computations ranging from basic statistics (min, max, mean, mode) to band arithmetic and histogram generation in either a web browser or a node application.

Learn more by reading our documentation

Getting Started

  1. Add GeoBlaze to your project
  npm install geoblaze
  1. Load a GeoTIFF and run a calculation
import geoblaze from 'geoblaze';

const url = 'http://url-to-geotiff';

async function getMean () {
  const georaster = await geoblaze.parse(url);
  const mean = await geoblaze.mean(georaster);
  return mean;
}

This is a contrived example, but using geoblaze is really this simple!

Contributing

We would love to have your support improving geoblaze. Here are some ways to contribute:

Issues

If you find a ๐Ÿ›, please report it as an issue! To avoid overwhelming our developers, please first scan the list of bugs to make sure it hasn't already been reported. Make sure to add steps to reproduce, so we can quickly find and fix the problem.

We are also accepting feature requests! Our goal is to make geoblaze as useful to the community as possible. Towards that goal, we would love suggestions for additional features to improve the tool.

Please tag issues with the appropriate label.

Pull Requests

We are always accepting new PRs. To get started, see the developer's guide below

We squash and rebase all PRs. Please squash all of your commits into one and rebase off dev.

Submitting a PR

  1. Make sure the branch is rebased and passing tests.

  2. Answer all of the questions in the PR template.

  3. Add the "needs review" label to your PR.

  4. Upon review, the label will be adjusted. If the label is switched to "needs development", this means there are comments that need to be addressed. After addressing the comments, move the label back to "needs review"

  5. Once comments have been addressed, a reviewer will move the label to "can deploy". After a final check, the PR will be merged and deployed.

Developer's Guide

Setup

  1. Fork the repository

  2. Clone your fork

  git clone [email protected]:[your-username]/geoblaze.git
  1. Install dependencies
  cd geoblaze
  npm install

Linting

GeoBlaze uses eslint for linting. We suggest using an eslint plugin for your text editor. Here are some common options:

Our style guide extends the eslint:recommended set of standards and is therefore relatively minimal. As the project expands in scope and number of contributors, we will start to consider more linting rules. Please feel free to suggest some in a PR!

To test for linting errors:

  npm run lint

Testing

GeoBlaze uses flug as its testing framework.

To run tests:

  1. Run the setup script. This script will download all of the necessary test data from s3.
  npm run setup
  1. Run tests. Each test file will automatically spin up a server using srvd.
  npm run test

Resources:

Used By

geoblaze's People

Contributors

danieljdufour avatar dependabot[bot] avatar geojs avatar jcphill avatar kristofj-umd avatar sdpeyton avatar tommatheussen avatar

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

geoblaze's Issues

Implement RasterWindow for Identify

We absolutely don't want to load all of the raster pixel values into JavaScript memory for a simple identify function. We should use a rasterWindow, which you can be seen used here: https://www.npmjs.com/package/geotiff

Using RasterWindow will also decrease the odds of maxing out the system memory and crashing the browser.

Enhance speed of average calculations

I think it'll be faster if we have an if statement or ternary expression in the reduce function rather than having filter then reduce. That's because we're currently iterating over all the values twice. Not sure though. We can write performance tests too to find out!

Handle FeatureCollection

Here's example of geojson:
http://bl.ocks.org/d/17662f9239fd6e4c38008c48125af756

{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {},
"geometry": {
"type": "Polygon",
"coordinates": [
[
[
-112.1484375,
-55.37911044801048
],
[
101.6015625,
-55.37911044801048
],
[
101.6015625,
68.9110048456202
],
[
-112.1484375,
68.9110048456202
],
[
-112.1484375,
-55.37911044801048
]
]
]
}
}
]
}

Explore Rearchitecting to Classes

Not necessarily gonna rearchitect

Code complexity will become an issue as we increase the number of features we support. Converting to classes may improve readability

This is a research task - if this refactor would significantly hurt performance, we should abort

Refactor Testing

With features getting more complex, testing will need to be re-architected to be more efficient at getting high coverage. Specifically, we need:

  • a common access point for geometries
  • coverage of bbox, single and multi-part geometries, feature collections, union geometries
  • coverage for all possible geometry input formats
  • a standard for how these tests are asserted

get performance metrics

Need to write tests (probably in a separate repository) that tests and compares GDAL, GeoDjango, rasterio, and geoblaze.

Speed up Identify Calculation

Identify runs slow on mobile devices probably because readRasters takes a while to run (not 100% sure on this though).

We could speed this up by doing the following:

  • converting the values stored in the geotiff.js object to a regular array when the size of the object isn't too big. This would mean that you load the values into JavaScript and when you run an identify, you directly grab the element in the array that corresponds with the user-designated cell.

We can use the Browser's performance API, to track how long operations take.

Expand Point Support

gio-convert-geometry should handle points when passed in as object with x and y as properties

[USER REQUEST] Describe 3rd Param for Histogram

Currently, documentation doesn't describe that third options parameter for histogram. A user spent a long time and had to go through our source code to figure out what params to pass in with options. We need to update documentation.

Create automated testing

Is your feature request related to a problem? Please describe.

We need to set up automated testing, so we can automatically test pull requests

Describe the solution you'd like

We probably should create a .circleci folder and create a config.yml inside of this folder. This config.yml configures the Circle CI tests. Here's an example of a config.yml file: https://github.com/FirstDraftGIS/cooccurrences/blob/master/.circleci/config.yml

Describe alternatives you've considered

TravisCI also provides from testing for Open Source projects. I'd be happy with Travis CI, too! :-) Here's an example of a .travis.yml file: https://github.com/DanielJDufour/date-extractor/blob/master/.travis.yml

Additional context

N/A

Clip Raster by Vector

Is your feature request related to a problem? Please describe.
A user should be able to clip a raster by a vector. In other words, the clip function should clip the raster by the geometry's bounding box and set all the remaining values outside of the geometry to No Data. It should also update the metadata for the raster.

Describe the solution you'd like
A clear and concise description of what you want to happen.
Create a clip module that takes in a georaster and geovector and returns the result as a georaster. The approach could include:

  1. Calculating bbox of geometry
  2. Getting insides of the geometry
  3. Iterating through rows of pixels, creating a new row starting at xmin of geometry, and adding NoData where outside geometry and current pixel value where inside the geometry

Describe alternatives you've considered
None at the moment

Additional context
You'll need to borrow some logic from https://github.com/GeoTIFF/geoblaze/blob/master/src/intersect-polygon/intersect-polygon.module.js and potentially split out some of the code, creating a separate getInsides module

Add Debug Mode

We should add a debug mode in the settings, also as a url param, that will add a lot of alerts to the page with relevant info. For example, after we run an identify, the alert should say how much each part of that process took.

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.