![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Wrapper around Georeferenced Rasters like GeoTIFF, NetCDF, JPG, and PNG that provides a standard interface
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.
const parseGeoraster = require("georaster");
fetch(url)
.then(response => response.arrayBuffer() )
.then(parseGeoraster)
.then(georaster => {
console.log("georaster:", georaster);
});
const parseGeoraster = require("georaster");
fs.readFile("data/GeogToWGS84GeoKey5.tif", (error, data) => {
parseGeoraster(data).then(georaster => {
console.log("georaster:", georaster);
})
});
const parseGeoraster = require("georaster");
const values = [ [ [0, 1, 2], [0, 0, 0], [2, 1, 1] ] ];
const noDataValue = 3;
const projection = 4326;
const xmin = -40;
const ymax = 14;
const pixelWidth = 0.00001;
const pixelHeight = 0.00001;
const metadata = { noDataValue, projection, xmin, ymax, pixelWidth, pixelHeight };
const georaster = parseGeoraster(values, metadata);
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' 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.
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);
});
});
name | description |
---|---|
maxs | array with max value for each band |
mins | array with min value for each band |
ranges | array with difference between max and min value for each band |
noDataValue | no data value |
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 (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 |
name | description |
---|---|
palette | Array that maps raster values to RGBA colors |
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 |
<script src="https://unpkg.com/georaster"></script>
You can view a simple demo of this here
Post a Github issue or contact the package author, Daniel J. Dufour, at daniel.j.dufour@gmail.com
FAQs
Wrapper around Georeferenced Rasters like GeoTIFF, NetCDF, JPG, and PNG that provides a standard interface
The npm package georaster receives a total of 2,751 weekly downloads. As such, georaster popularity was classified as popular.
We found that georaster demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.