1

In 2007, when I was young and foolish and before I knew about OpenStreetMap, I started an urban historical map project. I was working in Illustrator, it was going to be an interactive Flash piece, and my process was to draw the maps first, with the thought that I'd label some, but not all, of the street later on.

As we know Flash was began to die about 2010 and I put the project away for a number of years. I picked it up again a couple years ago and continued my earlier practice of just drawing streets and water features, this time with the intention of making it a conventional web map. Now I'm pretty close to finishing the drawing of a five-layer (1871, 1903, 1932, 1952 and 2016) historical map of a medium-sized city, though it still lacks labels.

My problem now is how to add large numbers of labels, many of them duplicates. There could be as many as 10,000 for all five layers, though as a practical matter I may have to settle for a smallish fraction of that number. Based on web searches I gather my workflow is unusual and that mine is therefore an unusual problem.

I've exported my maps and brought them into QGIS and played with the software a little. The process of adding labels to objects doesn't seem terribly efficient or user-friendly, but that's probably due to my unfamiliarity with the program.

Are there any tricks to speed up the painful process of adding large numbers of duplicate labels in QGIS?

Since so many of the streets exist in all five layers, functionality like the ability to select multiple objects in different layers and edit their attributes simultaneously in the Attribute Table would be a godsend. (Doesn't seem possible.) So would the ability to copy the attributes from one object and paste them onto other objects. Or the ability to do either of these things in Illustrator via a plugin and then export the data along with the shapes to a GIS program.

  • 1
    If you wish to ask about ArcGIS Desktop too, then please do that using a separate question. – PolyGeo Jan 24 at 2:32
  • @PolyGeo why would that be beneficial? – DPSSpatial Jan 24 at 3:09
  • @DPSSpatial Original scope of question also asked about how to do that - see gis.stackexchange.com/revisions/348468/1 – PolyGeo Jan 24 at 3:20
  • @PolyGeo why would you edit the question to be software specific and force the user to ask a 2nd question? It's just a 'geographic information systems question'. – DPSSpatial Jan 24 at 3:31
  • 1
    @DPSSpatial Because the user asked a broad question about how to meet several requirements using one or other desktop GIS product. I suspect the community may start to vote that even asking that for one product may need more focus. I hope to have avoided some of those votes by halving the scope of the question near its outset. – PolyGeo Jan 24 at 3:38
1

The formulation of your question sounds like you're assuming you need to manually go through and put in all labels that you need. The normal use case of e.g. QGIS would be to have labels entered as attributes to a (vector) layer of roads, buildings, whatnot. Then QGIS would show them automatically, with styling you specify. You could move and/or edit their appearance manually in the specific instances you want.

In your instance, if your historical layers have a similar structure, then you may be able to link them via joins, and then use filters in the attribute table view to select classes of features where then using the field calculator you copy over the label from the joined layer.

If your historical map digitization was done prior to your discovering GIS software, and so you've imported layers whose "features" are actually CAD drawing objects (e.g. lines representing both sides of an old street rather than the street itself and its attributes), then you need a kluge. What I would do is create a point layer for your labels with a text field for the actual label text, then add the points where you want the labels to be. The attribute form will come up, and you can type the text there. Then you can hide the layer symbology when you are done and just keep the label.

Finally, the Attribute Painter plugin may be useful for copying things around.

| improve this answer | |
  • I 2nd this, and emphasize the concept of treating this as a data management problem... Feel the same about the 'Flash' conundrum and workflow. I spent too much time doing similar work for nothing...!!! – DPSSpatial Jan 24 at 3:11
  • No, I'm not assuming that I'd be manually adding text objects as in a design program. I'm fully on board with the whole database thing, and note that I mention the Attribute Table in the last paragraph. What I didn't elaborate on is how painfully slow the process of adding labels seems to be. Correlating a row in the Attribute Table with a map object has been difficult because selecting a row doesn't select an object and vice-versa but, again, this may be due to my lack of software knowledge. My other problem is the number of duplicate labels, and I'll look into Attribute Painter. – Bill Gregg Jan 25 at 1:08
  • @BillGregg, I've added a 2nd answer on mechanical speedups of working with the attribute table and the canvas. (Made it separate since too long for a comment and in different direction than this 1st answer, which is still valid) – Houska Jan 25 at 13:06
1

(Comments to my previous answer -- still valid -- have made clear user is most looking for ways to speed up the workflow of choosing features one by one in existing vector layers to fill in the label text field appropriately)

I'll assume your layer already has a field FID which is a unique identifier, and you've added a field LabelText that you're now filling in with the appropriate name to be used to label each feature.

Use QGIS' ability to link selection in the canvas and in the attribute table. So open up an attribute table for the layer in question, and dock it below or to the side of the canvas, so you're not having to switch between windows.

If you feel like systematically working through the table, use the Filter icon at its top to choose a subset via attributes, then choose Filter features to limit the features in the attribute table to that list.

When you select a row in the attribute table, it should show in yellow as selected on the canvas. The Pan map to selected rows and Zoom map to selected rows icons on top might help to change the canvas to make them visible. You can then edit LabelText in the attribute table for those features.

Alternately, pan and zoom the map canvas to where you want to be, and use one of the Select feature commands to point to one or more features you want to focus on (Select features by radius may be particularly helpful). In the attribute table, in the bottom right change from Show all features to Show selected features or even Show features visible on map to keep it in sync.

Finally, I'd suggest during this process temporarily setting the layer's label value to not just be the (desired) field LabelText, but the expression coalesce("LabelText","FID") (or similar) so that as yet unlabelled features are displayed with their FID, helping you find them in the (unfiltered) attribute table. The function coalesce() returns the first non-null value in its arguments, so it will return LabelText if not null and otherwise FID.

Finally, I'd explore changing the symbology of the layer in some way to make a distinction between labelled and unlabelled features. For instance, setting the color to the expression (the data-driven icon to the right of the color entry field):

if("LabelText" IS NULL,color_rgb(255,0,0),@symbol_color)

will make unlabelled features be drawn in red so they are highly visible.

Finally, if the selection of features and/or redrawing of canvas is itself being slow, try under Layer properties / source creating a spatial index of the layer(s).

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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