Skip to main content
added 66 characters in body; edited tags; edited title
Source Link
Taras
  • 34k
  • 4
  • 73
  • 148

Virtual layer: Group Grouping lines by name and determinedetermining their proportions using Virtual Layer

I have a line layer with hiking trails. The hiking trails are divided into their surfaces. So one hiking trail consist of parts with different surfaces.

I would like to use a virtual layer to group the trails by their name and determine the proportions of the path surfaces (in distance and percentage).

Example: Trail A 20km/100%: 5km/25% Gravel, 10km/50% Asphalt, 5km/25% Path

The very simple SQL-Query for grouping and summing the parts for every trail is:

SELECT name, sum(length) AS Length, ST_Union(geometry) geom FROM Trails GROUP BY name;
SELECT
    name,
    sum(length) AS Length,
    ST_Union(geometry) AS geom
FROM
    Trails
GROUP BY
    name;

enter image description here

Virtual layer: Group lines by name and determine their proportions

I have a line layer with hiking trails. The hiking trails are divided into their surfaces. So one hiking trail consist of parts with different surfaces.

I would like to use a virtual layer to group the trails by their name and determine the proportions of the path surfaces (in distance and percentage).

Example: Trail A 20km/100%: 5km/25% Gravel, 10km/50% Asphalt, 5km/25% Path

The very simple SQL-Query for grouping and summing the parts for every trail is:

SELECT name, sum(length) AS Length, ST_Union(geometry) geom FROM Trails GROUP BY name;

enter image description here

Grouping lines by name and determining their proportions using Virtual Layer

I have a line layer with hiking trails. The hiking trails are divided into their surfaces. So one hiking trail consist of parts with different surfaces.

I would like to use a virtual layer to group the trails by their name and determine the proportions of the path surfaces (in distance and percentage).

Example: Trail A 20km/100%: 5km/25% Gravel, 10km/50% Asphalt, 5km/25% Path

The very simple SQL-Query for grouping and summing the parts for every trail is:

SELECT
    name,
    sum(length) AS Length,
    ST_Union(geometry) AS geom
FROM
    Trails
GROUP BY
    name;

enter image description here

Tweeted twitter.com/StackGIS/status/1506012784219222024
added 79 characters in body
Source Link
MartinMap
  • 8.4k
  • 7
  • 53
  • 119

I have a line layer with hiking trails. The hiking trails are divided into their surfaces. So one hiking trail consist of parts with different surfaces.

I would like to use a virtual layer to group the trails by their name and determine the proportions of the path surfaces (in distance and percentage).

Example: RouteTrail A 20km/100%: 5km/25% grade-AGravel, 10km/50% grade-BAsphalt, 5km/25% grade-CPath

The very simple SQL-Query for grouping and summing the parts for every trail is:

SELECT name, sum(length) AS Length, ST_Union(geometry) geom FROM Trails GROUP BY name;

enter image description here

I have a line layer with hiking trails. The hiking trails are divided into their surfaces. So one hiking trail consist of parts with different surfaces.

I would like to use a virtual layer to group the trails by their name and determine the proportions of the path surfaces (in distance and percentage).

Example: Route A 20km/100%: 5km/25% grade-A, 10km/50% grade-B, 5km/25% grade-C

The very simple SQL-Query for grouping and summing the parts for every trail is:

SELECT name, sum(length) AS Length, ST_Union(geometry) geom FROM Trails GROUP BY name;

I have a line layer with hiking trails. The hiking trails are divided into their surfaces. So one hiking trail consist of parts with different surfaces.

I would like to use a virtual layer to group the trails by their name and determine the proportions of the path surfaces (in distance and percentage).

Example: Trail A 20km/100%: 5km/25% Gravel, 10km/50% Asphalt, 5km/25% Path

The very simple SQL-Query for grouping and summing the parts for every trail is:

SELECT name, sum(length) AS Length, ST_Union(geometry) geom FROM Trails GROUP BY name;

enter image description here

fixed typo
Source Link
Matt
  • 17.9k
  • 4
  • 23
  • 59

I have a line layer with hiking trails. The hiking trails are divided into their surfaces. So one hiking trail consist of parts with different surfaces.

I would like to use a virtual layer to group the trails by their name and determine the proportions of the path surfaces (in distance and percentage).

Example: Route A 20km/100%: 5km/25% grade-A, 10km/50% grade-B, 5km/25% grade-C

The very simple SQL-QuerryQuery for grouping and summing the parts for every trail is:

SELECT name, sum(length) AS Length, ST_Union(geometry) geom FROM Trails GROUP BY name;

I have a line layer with hiking trails. The hiking trails are divided into their surfaces. So one hiking trail consist of parts with different surfaces.

I would like to use a virtual layer to group the trails by their name and determine the proportions of the path surfaces (in distance and percentage).

Example: Route A 20km/100%: 5km/25% grade-A, 10km/50% grade-B, 5km/25% grade-C

The very simple SQL-Querry for grouping and summing the parts for every trail is:

SELECT name, sum(length) AS Length, ST_Union(geometry) geom FROM Trails GROUP BY name;

I have a line layer with hiking trails. The hiking trails are divided into their surfaces. So one hiking trail consist of parts with different surfaces.

I would like to use a virtual layer to group the trails by their name and determine the proportions of the path surfaces (in distance and percentage).

Example: Route A 20km/100%: 5km/25% grade-A, 10km/50% grade-B, 5km/25% grade-C

The very simple SQL-Query for grouping and summing the parts for every trail is:

SELECT name, sum(length) AS Length, ST_Union(geometry) geom FROM Trails GROUP BY name;
Source Link
MartinMap
  • 8.4k
  • 7
  • 53
  • 119
Loading