Bug report #17940

Project file blows up with Metadata

Added by Tim Sutton about 6 years ago. Updated about 6 years ago.

Status:Closed
Priority:High
Assignee:-
Category:Metadata
Affected QGIS version:master Regression?:Yes
Operating System:MacOS (probably all) Easy fix?:No
Pull Request or Patch supplied:No Resolution:fixed/implemented
Crashes QGIS or corrupts data:Yes Copied to github as #:25836

Description

My favourite project has been gradualy getting slower and slower to open and use. I opened the project today in VIM and see that it has thousands of repeated address blocks in the metadata:

         <address> 
            <type></type>
            <address></address>
            <city></city>
            <administrativearea></administrativearea>
            <postalcode></postalcode>
            <country></country>
          </address>

My project file now has grown to 3.9 GB:

-rwxr-xr-x@ 1 timlinux  staff   3.9G Jan 23 10:52 Swellendam-QGIS3.qgs

Associated revisions

Revision 36bf093b
Added by Nyall Dawson about 6 years ago

Fix metadata address element doubles with each project write

elementsByTagName can be dangerous, because it returns children
recursively. In this case the contact "address" element contained
a child element for the street address, also named "address".

So when restoring a project with contact addresses in the metadata,
each address was created twice...

Fixes #17940

History

#1 Updated by Tim Sutton about 6 years ago

Here is the preceding snippet:

  <resourceMetadata>
        <identifier></identifier>
        <parentidentifier></parentidentifier>
        <language></language>
        <type></type>
        <title></title>
        <abstract></abstract>
        <fees></fees>
        <encoding></encoding>
        <crs>     
          <spatialrefsys>
            <proj4>+proj=longlat +datum=WGS84 +no_defs</proj4>
            <srsid>3452</srsid>
            <srid>4326</srid>
            <authid>EPSG:4326</authid>
            <description>WGS 84</description>
            <projectionacronym>longlat</projectionacronym>
            <ellipsoidacronym>WGS84</ellipsoidacronym>
            <geographicflag>true</geographicflag>
          </spatialrefsys>
        </crs>    
        <extent>  
          <spatial dimensions="2" maxz="0" minx="440611.25531954586040229" minz="0" maxx="454667.28530003415653482" maxy="6244256.02663078531622887" crs="EPSG:32734" miny="6237711.73648276180028915”/>
          <temporal>
            <instant>2017-12-15T12:50:38Z</instant>
          </temporal>
        </extent>
        <contact>
            <address>

#2 Updated by Nyall Dawson about 6 years ago

  • Regression? changed from No to Yes
  • Crashes QGIS or corrupts data changed from No to Yes

#3 Updated by Nyall Dawson about 6 years ago

  • % Done changed from 0 to 100
  • Status changed from Open to Closed

#4 Updated by Giovanni Manghi about 6 years ago

  • Resolution set to fixed/implemented

Also available in: Atom PDF