Skip to content
This repository has been archived by the owner on Mar 16, 2023. It is now read-only.

Commit

Permalink
Merge pull request #201 from USGS-WiM/staging
Browse files Browse the repository at this point in the history
Staging into Master Release v1.1.1-beta
  • Loading branch information
harper-wavra authored Jun 27, 2022
2 parents 1d671a0 + 7730d41 commit e991e5b
Show file tree
Hide file tree
Showing 6 changed files with 81 additions and 37 deletions.
32 changes: 27 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,39 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased](https://github.com/USGS-WiM/StreamStats-National/tree/dev)

### Added
### Added

-

### Changed

-

### Deprecated

-

### Removed

-

### Changed
### Fixed

-
-

### Removed
### Security

-


## [v1.1.1-beta](https://github.com/USGS-WiM/StreamStats-National/releases/tag/v1.1.1-beta) - 2022-06-24


### Changed

-
- Pointed 'Query by Fire Perimeters' option to new service: https://nldi-polygon-query.streamstats.usgs.gov/docs
- Changed fire hydrology layers according to NIFC updates #194


## [v1.1.0-beta](https://github.com/USGS-WiM/StreamStats-National/releases/tag/v1.1.0-beta) - 2022-05-09

Expand Down
2 changes: 1 addition & 1 deletion code.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "StreamStats National",
"organization": "U.S. Geological Survey",
"description": "Web-based Geographic Information Systems application that provides users with access to hydrologic data and analytical tools",
"version": "v0.1.0-beta.1",
"version": "v1.1.1-beta",
"status": "Beta",

"permissions": {
Expand Down
4 changes: 2 additions & 2 deletions src/app/map/map.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ describe('MapComponent', () => {
// Check available layers
component["checkAvailableLayers"]();
expect(addLayerSpy).toHaveBeenCalledWith("NHD Flowlines", true);
expect(addLayerSpy).toHaveBeenCalledWith("Archived Wildland Fire Perimeters", true);
expect(addLayerSpy).toHaveBeenCalledWith("2019 Wildland Fire Perimeters", true);
});

it('should check available layers in workflow and add Query by Fire Parameters layers', () => {
Expand All @@ -188,7 +188,7 @@ describe('MapComponent', () => {
// Check available layers
component["checkAvailableLayers"]();
expect(addLayerSpy).not.toHaveBeenCalledWith("NHD Flowlines", true);
expect(addLayerSpy).toHaveBeenCalledWith("Archived Wildland Fire Perimeters", true);
expect(addLayerSpy).toHaveBeenCalledWith("2019 Wildland Fire Perimeters", true);
});

it('should add layers', () => {
Expand Down
34 changes: 16 additions & 18 deletions src/app/map/map.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -248,20 +248,18 @@ export class MapComponent implements OnInit {
if (!this.activeWorkflowLayers.length) {
if (this.workflowData && this.workflowData.steps) {
this.workflowData.steps[0].options.forEach((o: { text: string; selected: boolean; }) => {
if (o.text === "Query by Basin" && o.selected === true) {
this.addLayers('NHD Flowlines', true);
this.addLayers('Archived Wildland Fire Perimeters', true);
this.addLayers('2021 Wildland Fire Perimeters', true);
this.addLayers('2022 Wildland Fire Perimeters', true);
this.addLayers('MTBS Fire Boundaries', true);
this.addLayers('Burn Severity', true);
}
if (o.text === "Query by Fire Perimeters" && o.selected === true) {
this.addLayers('Archived Wildland Fire Perimeters', true);
this.addLayers('2021 Wildland Fire Perimeters', true);
this.addLayers('2022 Wildland Fire Perimeters', true);
this.addLayers('MTBS Fire Boundaries', true);
this.addLayers('Burn Severity', true);
if (o.selected == true) {
if (o.text === "Query by Fire Perimeters" || o.text === "Query by Basin") {
if (o.text === "Query by Basin") {
this.addLayers('NHD Flowlines', true);
}
this.addLayers('2000-2018 Wildland Fire Perimeters', true);
this.addLayers('2019 Wildland Fire Perimeters', true);
this.addLayers('2021 Wildland Fire Perimeters', true);
this.addLayers('2022 Wildland Fire Perimeters', true);
this.addLayers('MTBS Fire Boundaries', true);
this.addLayers('Burn Severity', true);
}
}
})
}
Expand Down Expand Up @@ -416,7 +414,7 @@ export class MapComponent implements OnInit {
this.selectedPerimeters = [];
this.createMessage('Querying layers. Please wait.');
Object.keys(this.workflowLayers).forEach(layerName => {
if (layerName === '2022 Wildland Fire Perimeters' || layerName === '2021 Wildland Fire Perimeters' || layerName === 'Archived Wildland Fire Perimeters') {
if (layerName === '2022 Wildland Fire Perimeters' || layerName === '2021 Wildland Fire Perimeters' || layerName === '2019 Wildland Fire Perimeters' || layerName === '2000-2018 Wildland Fire Perimeters') {
this.workflowLayers[layerName].query().nearby(this.clickPoint, 4).returnGeometry(true)
.run((error: any, results: any) => {
this.findFeatures(error,results,layerName);
Expand Down Expand Up @@ -453,13 +451,13 @@ export class MapComponent implements OnInit {
if (prop.toLowerCase().indexOf('date') > -1) {
val = new Date(val).toLocaleDateString();
}
popupcontent += '<b>' + prop + ':</b> ' + val + '<br>';
popupcontent += '<b>' + prop.toUpperCase() + ':</b> ' + val + '<br>';
}
});
popupcontent += '<br>';
if (layerName === 'MTBS Fire Boundaries') {
this.firePerimeterLayer = L.geoJSON(feat.geometry);
} else if (layerName === '2022 Wildland Fire Perimeters' || layerName === '2021 Wildland Fire Perimeters' || layerName === 'Archived Wildland Fire Perimeters') {
} else if (layerName === '2022 Wildland Fire Perimeters' || layerName === '2021 Wildland Fire Perimeters' || layerName === '2019 Wildland Fire Perimeters' || layerName === '2000-2018 Wildland Fire Perimeters') {
const col = layerName.indexOf('Active') > -1 ? 'yellow' : 'red';
this.firePerimeterLayer = L.geoJSON(feat.geometry, {style: {color: col}});
}
Expand All @@ -472,7 +470,7 @@ export class MapComponent implements OnInit {
}
this._mapService.setSelectedPerimeters(this.selectedPerimeters);
this.count ++;
this.checkCount(this.count, 4);
this.checkCount(this.count, 5);
}

public addTraceLayer(data) {
Expand Down
24 changes: 18 additions & 6 deletions src/app/shared/services/map.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -452,19 +452,25 @@ export class MapService {

Object.keys(this.workflowLayers).forEach(workflowLayer => {
let queryString;
if (workflowLayer == "Archived Wildland Fire Perimeters" || workflowLayer == "2021 Wildland Fire Perimeters" || workflowLayer == '2022 Wildland Fire Perimeters') {
if (workflowLayer == "Archived Wildland Fire Perimeters") {
if (workflowLayer == "2000-2018 Wildland Fire Perimeters" || workflowLayer == "2019 Wildland Fire Perimeters" || workflowLayer == "2021 Wildland Fire Perimeters" || workflowLayer == '2022 Wildland Fire Perimeters') {
if (workflowLayer == "2000-2018 Wildland Fire Perimeters") {
// TO DO #194
if (startBurnYear >= (new Date()).getFullYear()) {
count++;
}
queryString = 'FIRE_YEAR >= ' + startBurnYear.toString() + ' AND FIRE_YEAR <= ' + endBurnYear.toString();
queryString = 'fireyear >= ' + startBurnYear.toString() + ' AND fireyear <= ' + endBurnYear.toString();
} else if (workflowLayer == "2019 Wildland Fire Perimeters") {
if (startBurnYear >= (new Date()).getFullYear()) {
count++;
}
queryString = 'fireyear >= ' + startBurnYear.toString() + ' AND fireyear <= ' + endBurnYear.toString();
} else if (workflowLayer == "2021 Wildland Fire Perimeters") {
if (endBurnYear < (new Date()).getFullYear()) {
count ++;
}
queryString = '1=1';
} else if (workflowLayer == "2022 Wildland Fire Perimeters") {
if (endBurnYear < (new Date()).getFullYear()) {
if (endBurnYear <= (new Date()).getFullYear()) {
count ++;
}
queryString = '1=1';
Expand Down Expand Up @@ -627,8 +633,14 @@ export class MapService {

// Query Fire Perimeters
public trace(geojson: any) {
const httpOptions = { headers: new HttpHeaders({ 'Content-Type': 'application/json' }) };
return this._http.post<any>('https://firehydrology.streamstats.usgs.gov/trace', geojson, httpOptions)
const httpOptions = { headers: new HttpHeaders({ 'Content-Type': 'application/json; charset=utf-8' }) };
var data = {
"data": geojson,
"get_flowlines": true,
"downstream_dist": 15
}

return this._http.post<any>('https://nldi-polygon-query.streamstats.usgs.gov/nldi_poly_query/', data, httpOptions)
.pipe(catchError((err: any) => {
this._loaderService.hideFullPageLoad();
this.createMessage("Error tracing fire perimeters.", 'error');
Expand Down
22 changes: 17 additions & 5 deletions src/assets/config.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "v0.1.0-beta.1",
"version": "v1.1.1-beta",
"workflowsURL": "assets/workflows.json",
"nldiBaseURL": "https://labs.waterdata.usgs.gov/api/nldi/pygeoapi/processes/",
"nldiSplitCatchmentURL": "nldi-splitcatchment/execution",
Expand Down Expand Up @@ -49,15 +49,23 @@
"visible": true
},
{
"name": "Archived Wildland Fire Perimeters",
"url": "https://services3.arcgis.com/T4QMspbfLg3qTGWY/arcgis/rest/services/Interagency_Fire_Perimeter_History_All_Years_Read_Only/FeatureServer/0",
"name": "2019 Wildland Fire Perimeters",
"url": "https://services3.arcgis.com/T4QMspbfLg3qTGWY/arcgis/rest/services/Historic_GeoMAC_Perimeters_2019/FeatureServer/0",
"type": "agsFeature",
"layerOptions": {
"zIndex": 9999
},
"visible": true
},
{
"name": "2000-2018 Wildland Fire Perimeters",
"url": "https://services3.arcgis.com/T4QMspbfLg3qTGWY/arcgis/rest/services/Historic_Geomac_Perimeters_Combined_2000_2018/FeatureServer/0",
"type": "agsFeature",
"layerOptions": {
"zIndex": 9999
},
"visible": true
},

{
"name": "MTBS Fire Boundaries",
"url": "https://apps.fs.usda.gov/arcx/rest/services/EDW/EDW_MTBS_01/MapServer",
Expand Down Expand Up @@ -164,7 +172,11 @@
"color": "#ed8f24",
"fillColor": "#ed8f24"
},
"Archived Wildland Fire Perimeters": {
"2019 Wildland Fire Perimeters": {
"color": "#ed8f24",
"fillColor": "#ed8f24"
},
"2000-2018 Wildland Fire Perimeters": {
"color": "#ed8f24",
"fillColor": "#ed8f24"
}
Expand Down

0 comments on commit e991e5b

Please sign in to comment.