More

QGIS Line End Caps

QGIS Line End Caps


When styling a road network where all sections of the network between junctions are separate paths, I style the ends of the lines to rounded to remove any gaps that might appear where the joins are at angles. The only problem is that you then have rounded ends to cul-de-sacs or dead end side roads.

ArcGIS has a tool that allows you to specify the end caps to either square or butt, which removes the rounded ends.

Is there a method of doing this in QGIS?


QGIS lines have a join style and a cap style. If I understand you correctly, you are looking for a feature to have different cap styles depending on whether the cap is at a line end which meets another line or if it's a dead end. That is not implemented yet as far as I know.


If it's acceptable for the entire line for the dead end street to be drawn using a square cap, then you could use QGIS' "data defined symbology" to achieve this.

In your line style properties, click the "data defined properties" button. Check the "cap style" option, then click the expression button. Your expression will need to look something like this:

Case when "dead_end_street" then 'flat' else 'round' end

You'll just need to modify the criteria ( the "dead_end_street" part) to suit whatever attributes you have present in your data to identify these dead end streets.


12.3. Setting a label¶

Labels are textual information you can display on vector features or maps. They add details you could not necessarily represent using symbols. Two types of text-related items are available in QGIS:

Text Format : defines the appearance of the text, including font, size, colors , shadow , background , buffer , …

They can be used to render texts over the map (layout/map title, decorations, scale bar, …), usually through the font widget.

To create a Text Format item:

Open the Style Manager dialog

Activate the Text format tab

Fig. 12.13 Text formats in Style Manager dialog ¶

Press the Add item button. The Text Format dialog opens for configuration . As usual, these properties are data-definable .

Label Settings : extend the text format settings with properties related to the location or the interaction with other texts or features ( callouts , placement , overlay, scale visibility , mask …).

They are used to configure smart labelling for vector layers through the /> Labels tab of the vector Layer Properties dialog or Layer Styling panel or using the /> Layer Labeling Options button of the Label toolbar .

To create a Label Settings item:

Open the Style Manager dialog

Activate the Label Settings tab

Fig. 12.14 Label Settings in Style Manager dialog ¶

Press the Add item menu and select the entry corresponding to the geometry type of the features you want to label.

The Label Settings dialog opens with the following properties. As usual, these properties are data-definable .


Several separate answers OR One answer with several nested answers?

I am wondering about an approach(a manner of answering) which can be used when I possess several solutions to a single question. How shall I tackle it? Shall I put each solution as a new answer or it is better to keep them merged?

Here are several examples of mine:

Case 1. One answer with several nested answers
Question: Summing data from column in Attribute table
Number of solutions: Seven (7)

Case 2. Several separate answers
A Question: Creating point at line end using QGIS
Number of solutions: Three (3)

My logic behind: Simply saying in the Case 1, solutions are tiny and required roughly equal amount of efforts, therefore I decided to merge them. Albeit in the Case 2, I splitted answers because each required different efforts and each intended to solve a different purpose of the same task using alternative technology provided in QGIS.

Hopefully, I am thinking correct when I wanted to answer several times. Perhaps, there are some other better suggestions in handling several answers to a single question.


6 Answers 6

As @steeldriver mentionned, the problem is likely to be caused by a different line ending style than what grep is expecting.

To check the line endings

You can use hexdump to check exactly how your line endings are formatted. I suggest you use my favorite format :

With the output, check the line endings : 0a -> LF , 0d -> CR . A very quick example would give something like this :

Note the line endings in dos format : 0d 0a .

To change the line endings

You can see here or here for various methods of changing line endings using various tools, but for a one-time thing, you could always use vi/vim :

To grep without changing anything

If you just want grep to match no matter the line ending, you could always specify line endings like this :

If a blank line is shown, you can check that you indeed matched something by using the -v option of cat :


Can i make my map look better and how to make my map look better.

Make the scale a nice even number that ends with a zero. Maybe bump it to 1:19000. It shouldn’t change the map too much.

I generally advise people to put on a scale bar, title and a date when it was created. If it is for corporate use, it would be advisable to also put on a copyright message.

Thanks for helping. I wanted to know if it is visually nice to look at. Example maps in qgis website are very very nice. I will just use it to show in clg for mini project not for corporation.i intentionally removed title for posting in reddit. I just dont want to get embarassed(when compared to those in qgis web mine are like child drawings)

I would play around with transparency/opacity/different shades. Perhaps add in a background color like tan or gray as well? I usually just don't care for white backgrounds but it's personal preference.

Also, your legend needs to be formatted better. Get rid of weird capitalization and misspellings.

Definitely agree on the background idea. You always need a background color.

FIXED most of the things, how would you add backround color

It usually looks better when Capitalization is the same throughout your legend- unless there is a reason why "ROADS" and "WATER" need to be all caps while the other labels are not. Also, there is a random label "1" in the middle of your map and it isn't clear what that is labeling- perhaps omit it?

Yes! You can make your map look so much better just from editing the colors. There are already a lot of good comments on here, so I will just add a few broad guidelines. But either way, please post an update!

Greenery, Land Use and Water should all be pale/desaturated colors. These are the "background" of the graphic. They don't need outlines either. Just a solid fill. Youɽ be surprised how pale/ muted the colors can be and still be distinguishable from each other.

Highways, Roads and Total Area are all lines. Use darker colors (ochre yellow, a deep orange, maroon, etc.) Highway looks good. Total area can be a dashed line and should sit on top of all the others. Roads probably don't need a black and white stroke. Just use one simple color.

There's some typos text formatting that will be easy to take care of too.

You'll really get a lot out of a few small graphic tweaks. Worth trying them out and please post an update for us.


5 Answers 5

You could do this as an outside corner, with just a little piece of rail.

I did this with some baseboard right beside a closet (that I didn't want to put trim around), and it turned out well. (Taking this picture also reminds me, I never did quite finish cleaning this all up).

The hardest part of doing this is cutting the edge piece so you get a perfect corner.

  1. Cut the piece (usually there's a scarp piece around that will work). Go longer rather than shorter.
  2. Use wood glue or a construction adhesive (like No More Nails) and a clamp to attach it, with the edges meeting. Let it sit overnight to dry.
  3. Sand off any excess glue that came out.
  4. If needed, sand down the back side so it's flat (if you cut it a bit too long). A couple seconds on a belt sander is perfect.

That's really all there is to it. In your case, you may want to also sand down the front corner a bit so it's smoother, rather than sharp and likely to poke someone.


Revert and Restore tools¶

During the layout process, it is possible to revert and restore changes. This can be done with the revert and restore tools:

This can also be done by mouse click within the Command history tab (see figure_composer_29).

Figure Composer 29:

Command history in the Print Composer


1 Answer 1

You're right about the line endings being important both OSes expect the line to end with " ", but Windows also adds a " " before that that unix doesn't expect, so unix programs will output the " " in their own way.

The file doesn't actually end with the two characters "^" and "M", that's just a common way to represent unprintable characters. Programs will output "^" and a letter corresponding to the byte's value, starting with A for 1. M is the 13th letter, and ' ' is ASCII code 13 (or 0xD, as you said), so you see "^M"


Shorter transmission lines or nearer high frequency bypass caps

I have an application where I have a sensor which communicates with an FPGA with about 15 differential pairs of data clocking around 300 Mhz. Due to constraints, the board can't be taller than 35mm and the surface mount header which receives all this high speed data has to go horizontal smack dab right in the middle of the back of the board. This leaves no room on the front of the board for the FPGA not to overlap the sensor header on the back. Now technically they are both surface mounts so you could say it isn't a problem, however the FPGA (Artix7 200T) has high frequency bypass caps requirements which are supposed to be put on the opposite side of it right where the header has placed itself. I am wanting to know if anyone has design horse sense from experience as to know if it is less risky to

  • shift the FPGA 2 to 3 cm off to the side to get it off from behind the headers which would lengthen the differential pairs or
  • Make exceptions for the proximity of the high frequency caps on the back of the FPGA?

I will eventually have more experts looking at this but need initial decision just to get keep things going until I can get to that point.


Changing Stroke Cap Angle

I'm trying to animate a logo I made using trim path. I'm having trouble with the circle. I'm trying to recreate the logo's filled circle outline with a single stroke path. The issue is that the end caps are not at the same angle as the circle due to the cut out. The normal circle is like the letter 'C' and is cut at 45 degrees with some buffer due to the width of the cut. When I make a stroke and cut it to the same position the cap of the stroke wants to lay at a default angle and not the one like the logo. Here is an example:

How can I made it so the cap's angle is correct?