Skip to content

Commit

Permalink
Issue GeoTIFF#60. Fix null-point error if image has no projection inf…
Browse files Browse the repository at this point in the history
…ormation
  • Loading branch information
Nikolai Maltsev committed May 19, 2022
1 parent ad4681a commit 052eff1
Show file tree
Hide file tree
Showing 10 changed files with 545 additions and 197 deletions.
381 changes: 290 additions & 91 deletions dist/georaster.browser.bundle.js

Large diffs are not rendered by default.

8 changes: 5 additions & 3 deletions dist/georaster.browser.bundle.min.js

Large diffs are not rendered by default.

344 changes: 244 additions & 100 deletions dist/georaster.bundle.js

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion dist/georaster.bundle.min.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ class GeoRaster {
this._data = data;
this.rasterType = 'geotiff';
this.sourceType = 'ArrayBuffer';
this._metadata = metadata;
} else if (Array.isArray(data) && metadata) {
this._data = data;
this.rasterType = 'object';
Expand Down
4 changes: 2 additions & 2 deletions src/parseData.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,9 @@ export default function parseData(data, debug) {
const {
GeographicTypeGeoKey,
ProjectedCSTypeGeoKey,
} = image.getGeoKeys();
} = (image.getGeoKeys() || {});

result.projection = ProjectedCSTypeGeoKey || GeographicTypeGeoKey;
result.projection = ProjectedCSTypeGeoKey || GeographicTypeGeoKey || data.metadata.projection
if (debug) console.log('projection:', result.projection);

result.height = height = image.getHeight();
Expand Down

0 comments on commit 052eff1

Please sign in to comment.