Skip to content

Commit

Permalink
use data_footprint if dataset has mintpy.subset.lalo
Browse files Browse the repository at this point in the history
fixes: #74
  • Loading branch information
stackTom committed Aug 18, 2022
1 parent fe9fd18 commit 97170e4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
4 changes: 2 additions & 2 deletions public/js/AreaAttributesController.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ function AreaAttributesController(map, area) {
fullAttributes[curKey] = curValue;
}

// this way, we overwrite any attributes in extra attributes with the ones already
// there. this is so that extraAttributes has higher priority in deciding attributes
// this way, we overwrite any attributes already in the arrays with the ones
// in extraAttributes. this is so that extraAttributes has higher priority in deciding attributes
// while we migrate database to using separate table for attributes.
if (extraAttributes) {
for (var curKey in extraAttributes) {
Expand Down
12 changes: 10 additions & 2 deletions public/js/mainMap.js
Original file line number Diff line number Diff line change
Expand Up @@ -1444,8 +1444,16 @@ function MapController(loadJSONFunc) {
attributesController.setArea(area);
var attributes = attributesController.getAllAttributes();

var scene_footprint = attributesController.getAttribute("scene_footprint");
var polygonGeoJSON = Terraformer.WKT.parse(scene_footprint);
var footprint = attributesController.getAttribute("scene_footprint");
if (attributesController.areaHasAttribute("mintpy.subset.lalo")) {
// needed as high res datasets have mintpy.subset.lalo but no data_footprint
// TODO: FIX
var dataFootprint = attributesController.getAttribute("data_footprint");
if (dataFootprint) {
footprint = dataFootprint;
}
}
var polygonGeoJSON = Terraformer.WKT.parse(footprint);
var lineStringGeoJSON = this.polygonToLineString(polygonGeoJSON);

var properties = area.properties;
Expand Down

0 comments on commit 97170e4

Please sign in to comment.