[GIS] Generating KML with arrow styling

directiongoogle earthkmlqgis

I have a Network GIS which I have made in QGIS and has direction arrow,
QGIS with Arrow (Direction of Travel / Start and End points)

but as soon as I export it to KML file I can just see the polylines without the direction.

KML without Arrow in Google Earth

Is there a way to get the direction / Start and End points of travel in KML to open in Google Earth ?

Best Answer

The arrows you see in QGIS are a layer styling option in QGIS. As far as I can tell (not being an expert with Google Earth), Google Earth doesn't have a way to style a line as an arrow. Instead, you can export the start and end points as separate layers, then add them to Google Earth and display them with square and triangle icons.

Step 1: Add start and end point coordinates to line layer attributes

Add 4 new fields using the

Field Calculator > Create a new field > type: Decimal Number

  • field name: start_point_x , formula: x( start_point( $geometry))
  • field name: start_point_y , formula: y( start_point( $geometry))
  • field name: end_point_x , formula: x( end_point( $geometry))
  • field name: end_point_y , formula: y( end_point( $geometry))

enter image description here

Step 2: Export point coordinates as csv files

Right click on line layer in Layer panel > Save vector layer as... > CSV

  • Name the file Start_point.csv.
  • Select the fields start_point_x and start_point_y, and any additional fields that you want associated with your start points.
  • Under geometry, select No geometry.

Repeat for end points

  • file name: End_points.csv
  • fields: end_point_x and end_point_y, and any additional fields
  • geometry: No geometry

    Step 3: Convert CSV files to KML files

Import each csv file created in step 2, using ..._point_x as the X field and ..._point_y as the Y field.

enter image description here

Right click on point layer in Layer panel > Save vector layer as... > KML

Step 4: Import KML files into Google Earth and select appropriate icon

enter image description here