![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.
cell-aspect-ratio
Advanced tools
Utility Functions for working with Cell Aspect Ratios
npm install cell-aspect-ratio
Cell Aspect Ratio (CAR) is the ratio of "real world" height to width for cells in a grid. It's best understood in contrast to Pixel Aspect Ratio (PAR). Whereas PAR refers to the dimensions of a pixel or cell in "pixels", CAR refers to the dimensions of a pixel or cell in meters or degrees.
This library was created to solve a particular image/grid resizing problem. When a grid's height and width don't share a common denominator, it's impossible to resize the image without introducing some image stretching. This image stretching is often undetectable to the human eye, but for geospatial or scientific calculations this is important. Additionally, at least one GeoSpatial format, ASCII Grid, requires that all cells be squares with the same height and width. I need a way to resize without introducing small changes in the height vs. width ratio.
import { resize } from "cell-aspect-ratio";
// or const { resize } = require("cell-aspect-ratio");
const result = resize({
debug: false,
height: 5365,
width: 4201,
target_height: 54,
maxDenominator: 100
});
result is an object with information needed to resize the grid precisely
{
numerator: 1,
denominator: 99,
pad_x: 56, // how many empty no-data columns to add to your grid before resizing
pad_y: 80, // how many empty no-data rows to add to your grid before resizing
new_area: 23179365,
new_height: 5445,
new_width: 4257,
new_cell_size: 98.99999999999999,
scale: 0.010101010101010102,
resized_height: 55,
resized_width: 43,
cell_size_diff: 0.35185185185186185
}
FAQs
Utility Functions for working with Cell Aspect Ratios.
We found that cell-aspect-ratio 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.