Skip to content

Commit

Permalink
New scenario on upload (#1624)
Browse files Browse the repository at this point in the history
Create new scenario from upload
  • Loading branch information
lastminutediorama authored Sep 25, 2024
1 parent 2d2493c commit 3177572
Show file tree
Hide file tree
Showing 14 changed files with 607 additions and 18 deletions.
5 changes: 2 additions & 3 deletions src/interface/src/app/services/plan.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,12 @@ export class PlanService {
planId: string
) {
return this.http.post(
environment.backend_endpoint.concat(
'/v2/planningareas/' + planId + '/upload_shapefiles/'
),
environment.backend_endpoint.concat('/v2/scenarios/upload_shapefiles/'),
{
geometry: shape,
name: scenarioName,
stand_size: standSize,
planning_area: planId,
},
{
withCredentials: true,
Expand Down
20 changes: 20 additions & 0 deletions src/planscape/planning/fixtures/around_LA.geojson
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"coordinates": [
[
[-118.339233, 34.402377],
[-118.602905, 34.261757],
[-118.443604, 34.043557],
[-118.339233, 33.870416],
[-117.971191, 33.756315],
[-117.734985, 33.582591],
[-117.504272, 33.449777],
[-117.04834, 33.674069],
[-116.878052, 33.906896],
[-116.92749, 34.284453],
[-117.471313, 34.492975],
[-117.943726, 34.533712],
[-118.339233, 34.402377]
]
],
"type": "Polygon"
}
53 changes: 53 additions & 0 deletions src/planscape/planning/fixtures/near_pasadena_pomona.geojson
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"features": [
{
"geometry": {
"bbox": [
-118.19263501773341, 34.08278210579428, -118.08128135438794,
34.15177868615852
],
"coordinates": [
[
[-118.1604194924888, 34.15177868615852],
[-118.08898506694642, 34.13554926129836],
[-118.08128135438794, 34.095542017058484],
[-118.1436113923612, 34.08278210579428],
[-118.19263501773341, 34.115258096703165],
[-118.1604194924888, 34.15177868615852]
]
],
"type": "Polygon"
},
"properties": {
"id": 1
},
"type": "Feature"
},
{
"geometry": {
"bbox": [
-117.90479630304802, 33.9846986886452, -117.75632475192076,
34.06479896698317
],
"coordinates": [
[
[-117.78713960215471, 34.052614671849355],
[-117.75632475192076, 34.00560170150721],
[-117.79694432722913, 33.9846986886452],
[-117.79694432722913, 33.9846986886452],
[-117.90479630304802, 34.03810727503426],
[-117.84876930262259, 34.06479896698317],
[-117.78713960215471, 34.052614671849355]
]
],
"type": "Polygon"
},
"properties": {
"id": 2
},
"type": "Feature"
}
],
"fileName": "near_pasadena_pomona/near_pasadena_pomona",
"type": "FeatureCollection"
}
120 changes: 120 additions & 0 deletions src/planscape/planning/fixtures/palmsprings_sanbernardino.geojson
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"geometry": {
"bbox": [
-116.59000730822105,
33.76094007811721,
-116.46372359000742,
33.86288159982813
],
"type": "Polygon",
"coordinates": [
[
[
-116.5301572048023,
33.86139064872427
],
[
-116.53075570583647,
33.85840866841697
],
[
-116.53195270790485,
33.86288159982813
],
[
-116.52955870376809,
33.86089365923777
],
[
-116.46551909311,
33.83454907768415
],
[
-116.46372359000742,
33.792281376404524
],
[
-116.52058118825529,
33.76094007811721
],
[
-116.58521929994758,
33.776860900708314
],
[
-116.59000730822105,
33.82709158924555
],
[
-116.57624178443476,
33.84449138356989
],
[
-116.5301572048023,
33.86139064872427
]
]
]
},
"properties": {
"id": null
}
},
{
"type": "Feature",
"geometry": {
"bbox": [
-117.36393144521908,
34.03950544279183,
-117.19620895578856,
34.14367901861189
],
"type": "Polygon",
"coordinates": [
[
[
-117.30765613626542,
34.14367901861189
],
[
-117.28117363793427,
34.14093925150775
],
[
-117.22048457925877,
34.13363277157728
],
[
-117.19620895578856,
34.08886680080183
],
[
-117.22158801668924,
34.03950544279183
],
[
-117.34517300890116,
34.07058816903606
],
[
-117.36393144521908,
34.10074579569706
],
[
-117.30765613626542,
34.14367901861189
]
]
]
},
"properties": {
"id": null
}
}
],
"fileName": "palmsprings_sanbernardino/palm_springs_san_bernardino"
}
21 changes: 21 additions & 0 deletions src/planscape/planning/fixtures/riverside.geojson
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"bbox": [
-117.43427169179705, 33.92100451310846, -117.27748946309077,
34.02786815076917
],
"type": "Polygon",
"coordinates": [
[
[-117.34263641657144, 34.017484525813835],
[-117.30039828189717, 34.01273730273981],
[-117.27748946309077, 33.97564048618635],
[-117.27748946309077, 33.97564048618635],
[-117.34048871480834, 33.92100451310846],
[-117.34084666510222, 33.92100451310846],
[-117.43427169179705, 33.98038978258641],
[-117.4052777179952, 34.018374600587144],
[-117.36984063890402, 34.02786815076917],
[-117.34263641657144, 34.017484525813835]
]
]
}
18 changes: 18 additions & 0 deletions src/planscape/planning/fixtures/sandiego.geojson
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"coordinates": [
[
[-117.117792, 32.695041],
[-117.156318, 32.719002],
[-117.208244, 32.752818],
[-117.214944, 32.821819],
[-117.137892, 32.847153],
[-117.010589, 32.816188],
[-116.953638, 32.726048],
[-117.064191, 32.649921],
[-117.104392, 32.661204],
[-117.147943, 32.695041],
[-117.117792, 32.695041]
]
],
"type": "Polygon"
}
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ class Migration(migrations.Migration):
migrations.AlterField(
model_name="projectarea",
name="data",
field=models.JSONField(help_text="Project Area data from Forsys.", null=True),
field=models.JSONField(
help_text="Project Area data from Forsys.", null=True
),
),
migrations.AlterField(
model_name="projectarea",
Expand Down
Loading

0 comments on commit 3177572

Please sign in to comment.