Skip to content

Commit 052eff1

Browse files
author
Nikolai Maltsev
committed
Issue #60. Fix null-point error if image has no projection information
1 parent ad4681a commit 052eff1

10 files changed

+545
-197
lines changed

dist/georaster.browser.bundle.js

Lines changed: 290 additions & 91 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/georaster.browser.bundle.min.js

Lines changed: 5 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/georaster.bundle.js

Lines changed: 244 additions & 100 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/georaster.bundle.min.js

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ class GeoRaster {
7474
this._data = data;
7575
this.rasterType = 'geotiff';
7676
this.sourceType = 'ArrayBuffer';
77+
this._metadata = metadata;
7778
} else if (Array.isArray(data) && metadata) {
7879
this._data = data;
7980
this.rasterType = 'object';

src/parseData.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,9 @@ export default function parseData(data, debug) {
9090
const {
9191
GeographicTypeGeoKey,
9292
ProjectedCSTypeGeoKey,
93-
} = image.getGeoKeys();
93+
} = (image.getGeoKeys() || {});
9494

95-
result.projection = ProjectedCSTypeGeoKey || GeographicTypeGeoKey;
95+
result.projection = ProjectedCSTypeGeoKey || GeographicTypeGeoKey || data.metadata.projection
9696
if (debug) console.log('projection:', result.projection);
9797

9898
result.height = height = image.getHeight();

0 commit comments

Comments
 (0)