4

I have a layer that I have processed heavily in FME before using it in QGIS. In the future I will have to reprocess it periodically when the source data is updated. It's a municipal street layer, which gets updated regularly.

The problem is that I require every street to be labelled in a destined-for-print map, which means a lot of manual editing of the labels to make it pretty. Since the label changes are stored within the table they will be overwritten when they table gets updated.

I'm looking for suggestions on how to avoid the problem.

I can think of 3 right off the bat, but don't know how to implement..

  1. Don't store the label changes in the table. I have no clue how to approach this, but maybe it's possible in QGIS to use a table join and save the x,y, rotation channels in an external file?
  2. With enough effort you can accomplish anything in FME, so presumably it's possible to update the table rather than overwrite it. My workspace is already fairly complicated though, and includes 2 linejoiners and 3 python scripts, so I can't imagine (yet) how to implement that.
  3. Use a more sophisticated labelling tool that won't require so many edits. Labelling for print is a weakness in lots of GIS tools.

Option 1 seems simpler, but may not be possible.

  • What format are you storing your data in? – Mapperz Jun 24 '16 at 19:36
  • Spatialite, But I could change on a dime, if there was a better format – marcp Jun 24 '16 at 20:23
1

You should be able to make use of the Insert/Delete/Update options in FME database writers. For example, here's the dialog for PostGRES database (didn't see it for Spatialite).

enter image description here

Note in that dialog there is also an attribute called fme_db_operation which you can populate somewhere in your workflow. I'm not sure if it is supported for Spatialite, however.

You could probably also use the SQLExecutor which I believe supports Spatialite.

As far as actually detecting if a label needs to be changed, I suggest using a transformer like a ChangeDetector. You can pass the changed ones to the writer with the UPDATE parameter.

Finally, there are a few labelling transformers in FME. Noteably, the MapTextLabeller (also here). It's a paid transformer but from the looks of it, it's pretty powerful in what it can do. I imagine it's like ArcGIS MapLex for FME. From Safe's page on the transformer:

The MapTextLabeller plugin has been specifically tuned to help you quickly and easily produce quality cartographic labels for the following mapping applications:

  • Esri® ArcGIS®
  • Autodesk® AutoCAD®
  • Intergraph® GeoMedia®
  • Pitney Bowes MapInfo®
  • Bentley® Microstation®
  • Rasters of all kinds via FME’s TextStroker and Rasterizer transformers

It doesn't mention QGIS, but I bet you could get it to work.

  • I don't think there are update options in Spatialite - it's just overwrite the database or drop the table. – Mark Ireland Jun 27 '16 at 15:14
1

Can you store your labels in a separate table? Then just filter them out in FME (maybe a GeometryFilter transformer) and don't write to that table.

You would need to ensure Overwrite Existing Database is set to No, but that all the tables have Drop Table set to Yes.

As long as you don't write any features to the label table, it won't get dropped or overwritten. The help says:

If Yes is specified [to Drop Table] and no features are written to a feature type, then the corresponding table is not deleted

Then you can review the existing labels in QGIS and decide whether to edit/recreate them or not.

  • Rather than split them into a separate table, I can maybe use the existing table as an input and merge those fields back in at the end based on the unique id. There's a transformer for that, I'm sure. – marcp Jun 27 '16 at 19:03
  • I think the relevant transformer here is the ListBasedFeatureMerger – marcp Jun 27 '16 at 19:32

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.