Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: GeoTIFF/georaster
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 271cce8edd9312a70effd45fbe003930346070b8
Choose a base ref
...
head repository: GeoTIFF/georaster
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 428711fd9bef63450c4e09ca300be578f40176dd
Choose a head ref

Commits on Nov 8, 2018

  1. Merge pull request #26 from DanielJDufour/master

    fixed bundling
    DanielJDufour authored Nov 8, 2018
    Copy the full SHA
    4aad6cd View commit details

Commits on Nov 22, 2018

  1. Copy the full SHA
    0311bcd View commit details
  2. Copy the full SHA
    1ca99a8 View commit details
  3. Merge pull request #27 from DanielJDufour/master

    Script Tag Example
    DanielJDufour authored Nov 22, 2018
    Copy the full SHA
    7849313 View commit details
  4. Update README.md

    DanielJDufour authored Nov 22, 2018
    Copy the full SHA
    069c5ac View commit details
  5. updated example

    DanielJDufour committed Nov 22, 2018
    Copy the full SHA
    fe1e39c View commit details
  6. updated example

    DanielJDufour committed Nov 22, 2018
    Copy the full SHA
    22b92a5 View commit details
  7. updated example again

    DanielJDufour committed Nov 22, 2018
    Copy the full SHA
    e23e973 View commit details
  8. updated demo

    DanielJDufour committed Nov 22, 2018
    Copy the full SHA
    e04406a View commit details

Commits on Jan 7, 2019

  1. Update README.md

    DanielJDufour authored Jan 7, 2019
    Copy the full SHA
    8d31392 View commit details

Commits on Jan 9, 2019

  1. snapshot: skip readRasters when constructing from url

    Michael Hiley committed Jan 9, 2019
    Copy the full SHA
    838aa5e View commit details

Commits on Jan 11, 2019

  1. get async/await working; provide very simple single-pixel getValues f…

    …or proof of concept
    Michael Hiley committed Jan 11, 2019
    Copy the full SHA
    8dba636 View commit details

Commits on Jan 14, 2019

  1. getValues now allows you to read a window with some width/height, so …

    …you can do one getValues per leaflet tile
    Michael Hiley committed Jan 14, 2019
    Copy the full SHA
    daf5d19 View commit details
  2. use GeoTIFF.readRasters instead of GeoTIFFImage.readRasters to take a…

    …dvantage of image overviews
    Michael Hiley committed Jan 14, 2019
    Copy the full SHA
    69b6e75 View commit details

Commits on Jan 16, 2019

  1. update georaster bundle build

    Michael Hiley committed Jan 16, 2019
    Copy the full SHA
    45e0e53 View commit details

Commits on Jan 21, 2019

  1. add COG test; not working yet due to http error

    Michael Hiley committed Jan 21, 2019
    Copy the full SHA
    e74f76f View commit details

Commits on Mar 24, 2019

  1. Copy the full SHA
    971b030 View commit details
  2. Copy the full SHA
    080bf71 View commit details
  3. Copy the full SHA
    0a67885 View commit details
  4. fixed eslint issues

    DanielJDufour committed Mar 24, 2019
    Copy the full SHA
    6b5ec80 View commit details

Commits on Mar 25, 2019

  1. updated travis yml

    DanielJDufour committed Mar 25, 2019
    Copy the full SHA
    a02cc1d View commit details
  2. updated travis

    DanielJDufour committed Mar 25, 2019
    Copy the full SHA
    8d580d5 View commit details
  3. updated travis

    DanielJDufour committed Mar 25, 2019
    Copy the full SHA
    ceedd3a View commit details
  4. Copy the full SHA
    4282898 View commit details
  5. updated testing

    DanielJDufour committed Mar 25, 2019
    Copy the full SHA
    45e076b View commit details
  6. updated package.json

    DanielJDufour committed Mar 25, 2019
    Copy the full SHA
    8521cfd View commit details
  7. Merge pull request #35 from DanielJDufour/master

    Updated Testing and Package Version
    DanielJDufour authored Mar 25, 2019
    Copy the full SHA
    ba88f48 View commit details
  8. Update README.md

    DanielJDufour authored Mar 25, 2019
    Copy the full SHA
    b19d013 View commit details

Commits on Apr 11, 2019

  1. added toCanvas function

    DanielJDufour committed Apr 11, 2019
    Copy the full SHA
    0a5dfc6 View commit details

Commits on Apr 18, 2019

  1. Copy the full SHA
    ddad6f6 View commit details

Commits on Jul 11, 2019

  1. Copy the full SHA
    8857b2a View commit details

Commits on Jul 18, 2019

  1. updated toCanvas

    DanielJDufour committed Jul 18, 2019
    Copy the full SHA
    743a8d6 View commit details
  2. updated ver

    DanielJDufour committed Jul 18, 2019
    Copy the full SHA
    b780b47 View commit details
  3. Merge pull request #39 from ragauskl/unhandled-promise-rejection-bug

    Added missing promise rejection; Added missed debug variable
    DanielJDufour authored Jul 18, 2019
    Copy the full SHA
    0fa280d View commit details
  4. updated builds

    DanielJDufour committed Jul 18, 2019
    Copy the full SHA
    cf80ad4 View commit details
  5. updated mocha

    DanielJDufour committed Jul 18, 2019
    Copy the full SHA
    245206e View commit details

Commits on Aug 28, 2019

  1. Copy the full SHA
    47453f4 View commit details
  2. fixed merge conflicts

    DanielJDufour committed Aug 28, 2019
    Copy the full SHA
    6b7710e View commit details

Commits on Aug 29, 2019

  1. Copy the full SHA
    ea35cd2 View commit details
  2. Merge pull request #40 from DanielJDufour/ReturnMultipleRastersFromCOG

    Return multiple rasters from cog
    DanielJDufour authored Aug 29, 2019
    Copy the full SHA
    e75a111 View commit details
  3. Copy the full SHA
    288f9cf View commit details
  4. Copy the full SHA
    e250790 View commit details
  5. Merge pull request #41 from DanielJDufour/ImprovedErrorHandling

    added try catch around ovr detection
    DanielJDufour authored Aug 29, 2019
    Copy the full SHA
    400f977 View commit details

Commits on Nov 29, 2019

  1. Copy the full SHA
    50e7b12 View commit details

Commits on Nov 30, 2019

  1. Merge pull request #43 from aviklai/master

    #42 - Supporting browser and node.js builds using cross-fetch.
    DanielJDufour authored Nov 30, 2019
    Copy the full SHA
    95e5b53 View commit details
  2. updated to 1.0.0

    DanielJDufour committed Nov 30, 2019
    Copy the full SHA
    c1afadc View commit details
  3. Copy the full SHA
    d172840 View commit details

Commits on Dec 16, 2019

  1. Copy the full SHA
    e04cb09 View commit details

Commits on Feb 7, 2020

  1. added webpack analyze

    DanielJDufour committed Feb 7, 2020
    Copy the full SHA
    c3e3d12 View commit details

Commits on Apr 11, 2020

  1. updated

    DanielJDufour committed Apr 11, 2020
    Copy the full SHA
    fd4a83e View commit details
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -76,5 +76,8 @@ package-lock.json

# test data files
data/geonode_atlanteil.tif
data/*.json
data/*.xml
data/rgb_raster.tif
data/*.tif
stats.json
6 changes: 4 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
language: javascript
language: node_js
node_js:
- "10"

notifications:
email:
@@ -8,4 +10,4 @@ install: npm install

before_script: cd data && bash setup_data.sh

script: npm run test
script: npm run eslint && npm run test-all
66 changes: 61 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
Wrapper around Georeferenced Rasters like GeoTIFF, NetCDF, JPG, and PNG that provides a standard interface. You can also create your own georaster from simple JavaScript objects.

# load from url on front-end
```
```javascript
const parseGeoraster = require("georaster");
fetch(url)
.then(response => response.arrayBuffer() )
@@ -13,7 +13,7 @@ fetch(url)
```

# load from file on back-end
```
```javascript
const parseGeoraster = require("georaster");
fs.readFile("data/GeogToWGS84GeoKey5.tif", (error, data) => {
parseGeoraster(data).then(georaster => {
@@ -23,7 +23,7 @@ fs.readFile("data/GeogToWGS84GeoKey5.tif", (error, data) => {
```

# load from simple object on front-end
```
```javascript
const parseGeoraster = require("georaster");
const values = [ [ [0, 1, 2], [0, 0, 0], [2, 1, 1] ] ];
const noDataValue = 3;
@@ -36,7 +36,43 @@ const metadata = { noDataValue, projection, xmin, ymax, pixelWidth, pixelHeight
const georaster = parseGeoraster(values, metadata);
```

# properties
# load [cloud optimized geotiff](https://www.cogeo.org/)
This option allows you to basically load the pixels only when you need them versus the other options
that require you to load the whole image into memory. It will also attempt to automatically discover any available overview files.

*where to clip*

`top` is how many pixels from the **top** of the image to skip over before we start clipping

`bottom` is how many pixels from the **bottom** of the image to skip over before we start clipping

`left` is how many pixels in from the **left** side of the image to skip over before we start clipping

`right` is how many pixels in from the **right** side of the image to skip over before we start clipping


*clipping resolution*

`width` is how many pixels **wide** should be the returned image. This helps to configure the resolution.

`height` is how many pixels **tall** should be the returned image. This helps to configure the resolution.

*resampling*

`resampleMethod` is how to resample the pixels for the returned image. This value is passed on to [geotiff.js](https://github.com/geotiffjs/geotiff.js)' readRasters function and defaults to 'bilinear'. The alternative is 'nearest', which is faster and better for categorical data like landcover and continous classes with smooth variation like temperature.

```javascript
const raster_url = "https://landsat-pds.s3.amazonaws.com/c1/L8/024/030/LC08_L1TP_024030_20180723_20180731_01_T1/LC08_L1TP_024030_20180723_20180731_01_T1_B1.TIF";
parseGeoraster(raster_url).then(georaster => {
console.log(georaster.height);
const options = { left: 0, top: 0, right: 4000, bottom: 4000, width: 10, height: 10 };
georaster.getValues(options).then(values => {
console.log("clipped values are", values);
});
});
```

# required properties
| name | description |
| ---- | ----------- |
| maxs | array with max value for each band |
@@ -46,9 +82,29 @@ const georaster = parseGeoraster(values, metadata);
| pixelWidth | width of pixel in dimension of coordinate reference system |
| pixelHeight | height of pixel in dimension of coordinate reference system |
| projection | equal to EPSG code, like 4326 |
| values | two dimensional array of pixel values |
| values | two dimensional array of pixel values (for Cloud Optimized GeoTIFF's, use `getValues` instead) |
| width | number of pixels wide raster is |
| xmax | xmax in crs, which is often in longitude |
| xmin | xmin in crs, which is often in longitude |
| ymin | ymin in crs, which is often in latitude |
| ymax | ymax in crs, which is often in latitude |

# optional properties
| name | description |
| ---- | ----------- |
| palette | Array that maps raster values to RGBA colors |

# functions
| name | description |
| ---- | ----------- |
| getValues | described above |
| toCanvas | experimental! returns a canvas picture of the data. You can pass in options object with height or width specified |

# loading georaster package through a script tag
```html
<script src="https://unpkg.com/georaster"></script>
```
You can view a simple demo of this [here](https://geotiff.github.io/georaster/test/)

# Support
Post a Github issue or contact the package author, Daniel J. Dufour, at daniel.j.dufour@gmail.com
Empty file modified data/setup_data.sh
100644 → 100755
Empty file.
Loading