2

I have got a series of mastermap layers, each displaying data relating to a 5km square of land. The layers contain data on things like roads, water, buildings etc. In total there are around 30 different 5km squares. I am trying to merge each of the layers to provide one, easy to use layer.

I am working on QGis. Each grid square contains multiple vector layers (Roads, water, buildings etc).

Using the merge function on all the layers throws back a series of errors, I am assuming because the data is much for my computer to handle. Errors include:

  • Feature could not be written to Merged_34d2ddf9_05a3_4e61_b7b7_6c67a3e01b21
  • Could not store attribute "changeDate"
  • Could not store attribute "theme"
  • Could not convert value "" to target type Feature could not be written to Merged_34d2ddf9_05a3_4e61_b7b7_6c67a3e01b21:

At the moment what I'm trying is, for example say for the Roads layers, exporting just the roads from one of the 5km squares and saving it as a new layer. I am then merging that with the roads of another 5km square. I will have to repeat this for each of the 30 5km squares.... I am not sure this is a very time effective method so was wondering what else I can try?

If it isn't obvious I am a beginner!!

sample of the data in one square

Example of error message when trying to merge

enter image description here

Tom
  • 21
  • 2
  • What output file type are you using? Dont use shapefile, try geopackage – BERA Jan 06 '22 at 10:15
  • Thanks BERA, I've just tried using geopackage and the following error comes up:
    Could not create layer ogr:dbname='C:/Users/Tom/Downloads/roads/merger.gpkg' table="output" (geom): Creation of field fid failed (OGR error: Wrong field type for fid) Execution failed after 0.06 seconds
    – Tom Jan 06 '22 at 10:22
  • Have you tried the "Merge vector layers" processing algorithm of QGIS processing toolbox ? It will at list allow you to merge all 30 layers of the same 'type' at the same time. – Kalak Jan 06 '22 at 10:30
  • Thanks Louis, yes that is what I have been using. Really not sure why it's not working – Tom Jan 06 '22 at 10:32
  • Without more info concerning the input data or a sample it will be complicated to help you. What is your input layers type (shapefile, geopackage, ...) ? what is the types, length, ... of your fields ? are there empty/null/incorrect geometries ? Maybe try "check validity" algorithm on your layers which have issues. – Kalak Jan 06 '22 at 10:49
  • Thanks Louis, it's all polygon shapefiles. I've added some screenshots which are hopefully helpful. – Tom Jan 06 '22 at 11:05
  • If saving Geopackage, fid must be of fieldtype integer. Maybe this can help: https://gis.stackexchange.com/a/400741/88814 – Babel Jan 06 '22 at 11:12
  • I think that might be it! Thank you Babel, my hero! – Tom Jan 06 '22 at 11:49

0 Answers0