1

I have a GeoJSON file that describes the outline of an ice shelf; I hand-digitized the geometry from satellite imagery and DEMs. The data consists of a MultiLineString, but some of the constituent LineStrings begin or end very close to each other. I have to edit some of the data manually, but QGIS will only display the entire geometry in one color. I'd like to visualize more easily where one LineString begins and the other ends. Is there a way to show each LineString as a different color, either in QGIS or another program?

My temporary workaround is to write a Python script that will split the MultiLineString into separate LineStrings, write each one out to a separate file, and read those into QGIS. The annoying part is that I'll then need to recombine them into a MultiLineString again, as this is the accepted schema for a whole other processing workflow that I've developed to generate triangular meshes for finite element modeling. I found this answer which might have helped me split the MultiLineString into several LineStrings with less typing, but I'd rather just be able to see the different segments of this MultiLineString and edit it in place than go through these intermediate steps.

1 Answer 1

4

You can use the geometrygenerator to display parts of your multilinestring in different colors. With the expression:

geometry_n($geometry,2)

you will get the second part of the multilinestring. Then you can choose a color or special linestyle for that. see image below. It is one Multilinestring with 3 parts in different colors.

enter image description here

1
  • Exactly what I needed, thanks so much! Commented Feb 19, 2021 at 18:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.