osm-fr / osmose-backend

Part of osmose that runs the analysis, and send the results to the frontend.
GNU General Public License v3.0
93 stars 115 forks source link

New osmosis analysis for location:transition, line_management for power supports #2004

Open flacombe opened 1 year ago

flacombe commented 1 year ago

Following #457, processing opendata to provide a file to qualify existing osm transmission towers gives me ideas. It could be possible to analyze OSM distribution supports against existing osm power lines. Lines are more widely drawn than line_management on supports.

The following processing is applicable on any OSM power line and OSM power support, from osmosis database:

It can be achieved by sequential SQL queries only, no need for a Python script.

Two OSM tagging additions can be deduced:

Line_management values (to be completed continuously):

CASE
WHEN config_circuits_overhead='1' AND config_circuits_underground='1' THEN 'transition'
WHEN config_circuits_overhead='2' AND config_circuits_underground='1-1'  THEN 'transition'
WHEN config_circuits_overhead='1-1' AND config_circuits_underground='1' THEN 'branch'
WHEN config_circuits_overhead='1-1' AND config_circuits_underground='1-1' THEN 'split'
WHEN config_circuits_overhead='2-1-1' AND config_circuits_underground IS NULL THEN 'split'
WHEN config_circuits_overhead='2-2-2' AND config_circuits_underground IS NULL THEN 'split'
WHEN config_circuits_overhead='2-2-1-1' AND config_circuits_underground IS NULL THEN 'split'
WHEN config_circuits_overhead='3-1-1-1' AND config_circuits_underground IS NULL THEN 'split'
WHEN config_circuits_overhead='3-2-1' AND config_circuits_underground IS NULL THEN 'split'
WHEN config_circuits_overhead='4-1-1-1-1' AND config_circuits_underground IS NULL THEN 'split'
WHEN config_circuits_overhead='4-2-1-1' AND config_circuits_underground IS NULL THEN 'split'
WHEN config_circuits_overhead='4-2-2' AND config_circuits_underground IS NULL THEN 'split'
WHEN config_circuits_overhead='4-3-1' AND config_circuits_underground IS NULL THEN 'split'
WHEN config_circuits_overhead='5-2-2-1' AND config_circuits_underground IS NULL THEN 'split'
WHEN config_circuits_overhead='2-2-1' THEN 'straight|branch'
WHEN config_circuits_overhead='2-2' AND config_circuits_underground='1' THEN 'straight|branch'
WHEN config_circuits_overhead='2-1-1-1' AND config_circuits_underground IS NULL THEN 'straight|branch'
WHEN config_circuits_overhead='1-1-1' AND config_circuits_underground IS NULL THEN 'branch'
WHEN config_circuits_overhead='2-1' AND config_circuits_underground='1' THEN 'split|transition'
WHEN config_circuits_overhead='1' AND config_circuits_underground NULL THEN 'termination'
ELSE NULL
END

This will lead to warning on power supports nodes respectively missing location:transition or line_management They will look like Ỳou could add location:transition=yes here or _You may be interested by adding linemanagement=branch on this T-connection node. It may be required to create a supplementary item beside 7040, up to @frodrigo

It is not possible to make the reverse analysis, like removing location:transition=yes or line_management when lines don't match the corresponding situation as those attributes may be used to state the presence of unknown/not drawn features, particularly underground.

flacombe commented 1 year ago

This osmosis analysis is a possible source of inspiration for implementation https://github.com/osm-fr/osmose-backend/blob/dev/analysers/analyser_osmosis_powerline.py