Skip to content

Commit

Permalink
refactor: add more epsg tests
Browse files Browse the repository at this point in the history
  • Loading branch information
blacha committed Jan 7, 2024
1 parent 3697ade commit ca60fda
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/core/src/__test__/cog.image.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,10 @@ describe('Cog.Big', () => {
const [firstImage] = cog.images;
assert.equal(firstImage.stripCount, 0);
assert.equal(firstImage.isTiled(), true);
assert.equal(firstImage.epsg, 2193);

const img = cog.images[4];

assert.deepEqual(img.tileCount, { x: 2, y: 2 });
});

Expand Down Expand Up @@ -199,6 +201,7 @@ describe('CogStrip', () => {

it('should have strip information', async () => {
const [firstImage] = cog.images;
assert.equal(firstImage.epsg, 3857);
assert.equal(firstImage.isTiled(), false);
assert.equal(firstImage.stripCount, 2);

Expand Down
4 changes: 4 additions & 0 deletions packages/core/src/__test__/cog.read.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ describe('CogRead', () => {

assert.equal(tiff.isLittleEndian, true);
assert.equal(tiff.version, TiffVersion.BigTiff);
assert.equal(tiff.images[0].epsg, null);
validate(tiff);
});

Expand All @@ -51,6 +52,8 @@ describe('CogRead', () => {

assert.equal(tiff.isLittleEndian, true);
assert.equal(tiff.version, TiffVersion.Tiff);
assert.equal(tiff.images[0].epsg, null);

validate(tiff);

const [firstTif] = tiff.images;
Expand Down Expand Up @@ -150,5 +153,6 @@ describe('CogRead', () => {

const tiff = await Tiff.create(source);
assert.equal(tiff.images.length, 5);
assert.equal(tiff.images[0].epsg, 3857);
});
});

0 comments on commit ca60fda

Please sign in to comment.