Skip to content

Instantly share code, notes, and snippets.

@pigreco
Last active October 12, 2017 16:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pigreco/78dbe36583f958ea19cb9fe8d2102395 to your computer and use it in GitHub Desktop.
Save pigreco/78dbe36583f958ea19cb9fe8d2102395 to your computer and use it in GitHub Desktop.
questo gist segue il gist 'dove mi trovo'; è da utilizzare nel posizionamento delle etichette - metodo cartographic- position priority - vettore di copertura generico
CASE
WHEN
length( shortest_line( $geometry, boundary( bounds( @atlas_geometry ) ) ) ) < @dist_bordo
and
angle_at_vertex( shortest_line( $geometry, boundary( bounds( @atlas_geometry ) ) ) ,0) =180
THEN 'TSL'
WHEN
length( shortest_line( $geometry, boundary( bounds( @atlas_geometry ) ))) <@dist_bordo
and
angle_at_vertex( shortest_line( $geometry, boundary( bounds( @atlas_geometry ) ) ),0 ) =0
THEN 'BSR'
WHEN
length( shortest_line( $geometry, boundary( bounds( @atlas_geometry) ) ) ) <@dist_bordo
and
angle_at_vertex( shortest_line( $geometry, boundary( bounds( @atlas_geometry ) ) ),0 ) =270
THEN 'R'
WHEN
length( shortest_line( $geometry, boundary( bounds( @atlas_geometry ) )) ) <@dist_bordo
and
angle_at_vertex( shortest_line( $geometry, boundary( bounds( @atlas_geometry ) ) ),0 )=90
THEN 'L'
END
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment