Skip to content

Commit

Permalink
feat: #635 Support downloading spatial sample file (#656)
Browse files Browse the repository at this point in the history
feat(635): allow downloading spatial sample file, refs: #635
  • Loading branch information
MCatherine1994 authored Jul 5, 2024
1 parent ab424ca commit e4c2a15
Show file tree
Hide file tree
Showing 7 changed files with 206 additions and 1 deletion.
12 changes: 12 additions & 0 deletions admin/src/app/foms/fom-submission/fom-submission.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,18 @@ <h1 class="text-muted">FSP ID: {{project.fspId}}</h1>
</div>

</div>

<div class="sample-spatial-download" ngbDropdown>
<button ngbDropdownToggle class="btn btn-sm btn-outline-primary" type="button">
Download Spatial Templates
</button>
<div ngbDropdownMenu>
<a class="dropdown-item" href="assets/sample-spatial-files/sample_cut_block_file.json" download>Cut block</a>
<a class="dropdown-item" href="assets/sample-spatial-files/sample_road_section_file.json" download>Road section</a>
<a class="dropdown-item" href="assets/sample-spatial-files/sample_wtra_file.json" download>Wildlife/tree retention area</a>
</div>
</div>

<div class="form-group mb-0">

<app-upload-box [multipleFiles]="false"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ form {
margin-bottom: 2rem;
}

.sample-spatial-download {
margin-bottom: 0.5rem;
}

// Public Review Dates
.review-dates {
@include clearfix();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { DatePipe, NgFor, NgIf } from '@angular/common';
import { AfterViewInit, Component, OnDestroy, OnInit } from '@angular/core';
import { MatSnackBar, MatSnackBarRef, SimpleSnackBar } from '@angular/material/snack-bar';
import { ActivatedRoute, Router } from '@angular/router';
import { NgbDropdown, NgbDropdownMenu, NgbDropdownToggle } from '@ng-bootstrap/ng-bootstrap';
import { ProjectResponse, ProjectService, SpatialObjectCodeEnum, SubmissionDetailResponse, SubmissionRequest, SubmissionService, SubmissionTypeCodeEnum, WorkflowStateEnum } from '@api-client';
import { RxFormBuilder, RxFormGroup } from '@rxweb/reactive-form-validators';
import { User } from '@utility/security/user';
Expand All @@ -27,7 +28,10 @@ import { FormsModule, ReactiveFormsModule } from '@angular/forms';
NgFor,
SubmissionFormatOverviewComponent,
DatePipe,
UploadBoxComponent
UploadBoxComponent,
NgbDropdown,
NgbDropdownToggle,
NgbDropdownMenu,
],
selector: 'app-fom-submission',
templateUrl: './fom-submission.component.html',
Expand Down
110 changes: 110 additions & 0 deletions admin/src/assets/sample-spatial-files/sample_cut_block_file.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
{
"type": "FeatureCollection",
"crs": {
"type": "name",
"properties": {
"name": "EPSG:3005"
}
},
"features": [
{
"type": "Feature",
"geometry": {
"type": "Polygon",
"coordinates": [
[
[
1474614.5923999995,
555392.24159999937
],
[
1474537.8630999997,
555275.82469999976
],
[
1474588.1340999994,
555146.17860000022
],
[
1474723.0717999991,
555080.0326000005
],
[
1474818.3220000006,
555138.24110000022
],
[
1474902.9889000002,
555220.26209999993
],
[
1474818.3220000006,
555334.03309999965
],
[
1474701.9050999992,
555437.22079999931
],
[
1474614.5923999995,
555392.24159999937
]
]
]
},
"properties": {
"DEV_DATE": "2022-03-30",
"NAME": "Nature's valley"
}
},
{
"type": "Feature",
"geometry": {
"type": "Polygon",
"coordinates": [
[
[
1474614.5923999995,
555392.24159999937
],
[
1474537.8630999997,
555275.82469999976
],
[
1474588.1340999994,
555146.17860000022
],
[
1474723.0717999991,
555080.0326000005
],
[
1474818.3220000006,
555138.24110000022
],
[
1474902.9889000002,
555220.26209999993
],
[
1474818.3220000006,
555334.03309999965
],
[
1474701.9050999992,
555437.22079999931
],
[
1474614.5923999995,
555392.24159999937
]
]
]
},
"properties": {
"DEV_DATE": "2022-03-31"
}
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"geometry": {
"type": "LineString",
"coordinates": [
[
-126.786352462,
53.365359508
],
[
-126.786519787,
53.374321183
],
[
-126.775181383,
53.372154906
]
]
},
"properties": {
"DEV_DATE": "2022-03-30"
}
}
]
}
46 changes: 46 additions & 0 deletions admin/src/assets/sample-spatial-files/sample_wtra_file.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"type": "FeatureCollection",
"crs": {
"type": "name",
"properties": {
"name": "EPSG:3005"
}
},
"features": [
{
"type": "Feature",
"geometry": {
"type": "Polygon",
"coordinates": [
[
[
1474782.182,
555366.06629999913
],
[
1474701.9050999992,
555437.22079999931
],
[
1474651.1418999992,
555411.07010000013
],
[
1474667.5091999993,
555386.94989999942
],
[
1474760.1136000007,
555331.38729999959
],
[
1474782.182,
555366.06629999913
]
]
]
},
"properties": {}
}
]
}
1 change: 1 addition & 0 deletions api/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ function getLogLevel():string {
SpatialFeatureModule,
],
})

export class AppModule {
constructor(private appConfigService: AppConfigService) {}
}

0 comments on commit e4c2a15

Please sign in to comment.