exposure export tool: distinguish the licence from the header

Bug #1198975 reported by Michele Simionato
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenQuake Platform
Fix Committed
High
Paolo Tormene

Bug Description

At the moment the .csv exported from the exposure tool has a form such as:

# Version 1.0 released on 31.01.2013
#
# Copyright (C) 2013 GEM Foundation
# ...
# More information on licensing: http://www.globalquakemodel.org/licensing
#
#ISO, population_value, pop_cell_ID, lon, lat
OMN,0.232825,435619923,55.3958333324,17.7624999997
OMN,0.232814,435619924,55.3958333324,17.770833333
OMN,0.232803,435619925,55.3958333324,17.7791666664

My request is to change the line #ISO, population_value, pop_cell_ID, lon, lat by removing the # in front of it: then the
QGIS visualization tool can simply skip all the lines starting with a comment char and read the header from the first line
without a comment char. At the moment instead the visualization tool rely on the number of lines in the licence: if we
add or remove a line from the licence it will break.

Changed in oq-platform:
importance: Undecided → High
Revision history for this message
Daniele Viganò (daniele-vigano) wrote :
Changed in oq-platform:
assignee: nobody → Paolo Tormene (paolo-tormene)
status: New → In Progress
Revision history for this message
Paolo Tormene (paolo-tormene) wrote :

The exposure export tool has been rewritten. The CSV produced by the new version contains license lines starting with '#', whereas the actual header line of the data does not have the '#' (see https://github.com/gem/oq-platform/pull/296).
In the QGIS SVIR plugin, when reading the CSV produced by the exposure tool to build a QGIS layer, before building the URI to pass to QgsVectorLayer, we count the leading lines of the CSV which start with '#', and use that count in the URI where the parameter 'skipLines' is needed. In this way, even in case the license produced by the export tool changes its number of lines, the client QGIS application is robust enough and it doesn't need to know in advance the length of the license in the CSV. See https://github.com/gem/qt-experiments/commit/7eaedcdb0872750163d5ff8c7adfb4bca047e94e)

Changed in oq-platform:
status: In Progress → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.