feat: biodiversity impact#14
Conversation
28151a4 to
f697ec2
Compare
f697ec2 to
f6abd70
Compare
5467864 to
b420abe
Compare
b420abe to
544013d
Compare
| SELECT | ||
| r.location, | ||
| r.area_m2 / 10_000 AS area_ha, | ||
| -- TODO: or union first over all intersections? |
There was a problem hiding this comment.
does it really make sense to sum the intersections? if sensitive areas overlap they would be counted multiple times
maybe it would make sense to have for each location a list of all intersections with individual sensitive areas.
There was a problem hiding this comment.
But if I have one entry per Nature 2000 area, there is no good one overview entry per company site.
There was a problem hiding this comment.
true. but it is not really very readable if I get a text that concatenates all matching biodiversity areas after each other either. A list would be better. I mean, you have the info in a structured manner and then put it all in a string, giving up the structure.
I guess best would be to have for each site some global info like number and total area of all intersections, and then a list of all indiviual intersections. But that's just my opinion. We can leave it like it is.
| @@ -0,0 +1,55 @@ | |||
| WITH reference AS ( | |||
There was a problem hiding this comment.
does this file need to be commited?
| site_inputs.push(SiteInput { | ||
| location, | ||
| was_point: was_point(feature), | ||
| buffer_size_km: site_specification.buffer_distance(), |
There was a problem hiding this comment.
name the field also distance maybe
| /// Process execution (Biodiversity Sensitive Areas – ESRS E4 B5) | ||
| #[allow(unused, reason = "Placeholder for spec only")] | ||
| #[derive(Deserialize, ToSchema, Debug)] | ||
| pub struct ImpactMetricsProcessParams { |
There was a problem hiding this comment.
maybe more consistent naming ImpactMetrics vs BiodiviersitySesnsitieAreas? can we just use one?
| /** | ||
| * The following constraints are supported for `geojson` fields. | ||
| */ | ||
| export class Constraints11 { |
There was a problem hiding this comment.
maybe check naming, there are lots of constraints here with no apparent meaning
There was a problem hiding this comment.
I generate the schema by just inputting https://datapackage.org/profiles/2.0/dataresource.json. Thus, I don't have much influence on that :-/.
| import { TableSchemaForeignKeyOneOfReference } from '../models/TableSchemaForeignKeyOneOfReference'; | ||
| import { HttpFile } from '../http/http'; | ||
|
|
||
| export class TableSchemaForeignKeyOneOf { |
There was a problem hiding this comment.
maybe try to avoid OneOf types names?
There was a problem hiding this comment.
I generate the schema by just inputting https://datapackage.org/profiles/2.0/dataresource.json. Thus, I don't have much influence on that :-/.
| @@ -1,28 +1,12 @@ | |||
| <div> | |||
| <h1 class="mat-h1">Result {{ processId() }}</h1> | |||
| <h1 class="mat-h1">Result {{ resultId() }}</h1> | |||
There was a problem hiding this comment.
maybe hide Errors if there aren't any
There was a problem hiding this comment.
How? Errors are just an output.
| <mat-card-header> | ||
| <mat-card-title> | ||
| Results | ||
| @for (result of results(); track result.key) { |
There was a problem hiding this comment.
maybe show result first and then documentation and inputs last
There was a problem hiding this comment.
How? I don't have an order.
| COALESCE(ST_AREA(ST_INTERSECTION(s_in.geom, r.geom)), 0) > 0 AS site_in_biodiversity_sensitive_area, | ||
| ST_AREA(ST_INTERSECTION(s_out.geom, r.buffered_geom)) > 0 AS site_near_biodiversity_sensitive_area, | ||
| ST_AREA(ST_INTERSECTION(s_out.geom, r.buffered_geom)) AS biodiversity_sensitive_area_m2, | ||
| 'Type: ' || r.specification || E'\n' |
There was a problem hiding this comment.
is the type not part of the input rather than of the output? For Marburger Unistation it will always be office on any intersecting area
There was a problem hiding this comment.
Well, it is part of the description why the results are how they are. What would you propose?
| <mat-nav-list> | ||
| <a mat-list-item [routerLink]="['/app/results']"><mat-icon>assessment</mat-icon>Results</a> | ||
| <a mat-list-item [routerLink]="['/app/create']"><mat-icon>add</mat-icon>Create new</a> | ||
| <a mat-list-item [routerLink]="['/app/results']"> |
There was a problem hiding this comment.
not related to this line: the text in the BioIS logo is so small that it cannot be read
| <fieldset> | ||
| <legend>Inputs</legend> | ||
|
|
||
| @for (input of inputs(); track input.key) { |
There was a problem hiding this comment.
the order of the inputs appears to be random. the orders is different each time for me. maybe make it alphabetically or specify a fixed order.
There was a problem hiding this comment.
JSON object order is not fixed unforunately. I have not a real idea how to solve this. I can make this alphabetical by now.
| } | ||
|
|
||
| let site_table: Vec<SiteRow> = sql_query(formatdoc! {r#" | ||
| WITH reference AS ( |
There was a problem hiding this comment.
unrelated to this line:
I took your example json with the Marbuger [sic!] Unistation and duplciated the feature and changed the properties to
"properties": {
"location": "Marbuger Mine",
"siteType": "mining"
}
I get this error:
2026-05-22T15:41:34.850820Z ERROR biois::processes::biodiversity_sensitive_areas: error: Failed to query Natura2000.naturasite_polygon
Caused by:
lwgeom_intersection_prec: GEOS Error: TopologyException: side location conflict at 4196987.1835999992 3037753.4884000057. This can occur if the input geometry is invalid.
at src/processes/biodiversity_sensitive_areas/mod.rs:772
in biois::processes::biodiversity_sensitive_areas::compute_biodiversity_sensitive_areas with natura2000_schema: "Natura2000", sites: FeatureCollectionGeoJsonInput { value: GeoJsonFeatureCollection(FeatureCollection { bbox: None, features: [Feature { bbox: None, geometry: Some(Geometry { bbox: None, value: Polygon { coordinates: [[Position([8.77366548049784, 50.803270291022386]), Position([8.773649409958182, 50.8024374636156]), Position([8.774613642351255, 50.80241207230304]), Position([8.774597571811597, 50.803255056507936]), Position([8.77366548049784, 50.803270291022386])]] }, foreign_members: None }), id: None, properties: Some({"location": String("Marbuger Unistadion"), "siteType": String("office")}), foreign_members: None }, Feature { bbox: None, geometry: Some(Geometry { bbox: None, value: Polygon { coordinates: [[Position([8.77366548049784, 50.803270291022386]), Position([8.773649409958182, 50.8024374636156]), Position([8.774613642351255, 50.80241207230304]), Position([8.774597571811597, 50.803255056507936]), Position([8.77366548049784, 50.803270291022386])]] }, foreign_members: None }), id: None, properties: Some({"location": String("Marbuger Mine"), "siteType": String("mining")}), foreign_members: None }], foreign_members: None }), media_type: GeoJson }, location_property: "location", site_type_property: "siteType", unit_for_area: Hectare
There was a problem hiding this comment.
Cannot reproduce this. Can you give me the whole input?
… and improved data handling
No description provided.