Conversation
…ted points with values)
… "sum", "mean" and "stddev"
…() depending on compatibility with PostGIS version
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Extends the
valuesAtPointendpoint of the GeospatialAnalyzer to accept LineString and Polygon input geometries in addition to Points.Previously only the value at a single point was returned. Now the values of the underlying raster topics (e.g. ´hoehe_r` of DGM/DOM) can be queried along a line or within an area.
Changes
ValuesAtPointService.handleLogicalRequestnow branches by geometry type:LINE_SEGMENT_LENGTH_METERS, currently 10 m) usingST_LineInterpolatePoint. The first and last point of the line are always included, so the last interval can be shorter than the segment length.candidate_tiles).heights: { min, max, mean, points: [{ index, height }, ...] }.indexis the position of the sample point along the line (not a distance in meters).meanis rounded to 2 decimal places.heightStats.ST_Union) and clipped to the polygon (ST_Clip, cropped to its bounding box). Pixels outside the polygon have no value and are not part of the statistics.heightStats: { count, min, max, sum, mean, stddev }(viaST_SummaryStats).sumandmeanare rounded to 2,stddevto 3 decimal places.null) instead of causing an error.As before, one result feature is returned per raster source of the topic (DGM and DOM for
hoehe_r).The segment length (query of LineString) is not an API parameter. It can be changed in one place, the constant
LINE_SEGMENT_LENGTH_METERSingeneral.constants.ts.Testing
The implementation was tested locally with the PostGIS database.
values-at-point.service.spec.ts): the generated SQL for Point, LineString and Polygon, one sub-query per raster source, rejection of unsupported geometry types.values-at-point.e2e-spec.ts):min <= mean <= max, points sorted byindex, rounding ofmean.sum/mean/stddev, only pixels inside the polygon are counted (a triangle covers about half the pixels of its bounding rectangle), polygon outside the raster coverage, unsupported geometry type.heightsnorheightStats.Impact
The existing Point functionality remains unchanged.