module: ‘’

class gwa.code.extract.Extract(id_area_arg, id_place_arg, id_ap_arg, id_campaign_arg, fichier_arg, main=None)[source]
Purpose to extract campaign data measure in XML or PNG file.
Arguments :
  • id_campaign (type integer)

    Represents the numbre of campaign which we want extract data.

  • fichier (type string)

    Chose the name of extraction


>>> id_campaign = 2
>>> fichier = 'essai_extract'
ex = Extract(id_campaign,fichier)
toPNG(resolution=100, legende=True, amplitude='')[source]

The function ‘toXML’ to extract information from the BDD in a PNG file

Arguments optionels:
resolution (type integer)

You can choose the resolution of the drawing. By default it is 50

legende (type Boolean)

Adds legend drawing, otherwise returns the surface

amplitude (type integer)

Allows you to choose which power ranges are defined colors


. png file created on the current directory

The function ‘toXML’ permit to extract information from an XML file in BDD
The XML file follows the new version of the database
Returns:file .xml created on the current directory
class gwa.code.extract.FloatRgbMulti(mag, cmin, cmax)[source]
The class ‘FloatRgbMulti’ sets the range of colors that will be applied on the graph.
It provided a color depending on mag between cmin et cmax.
Arguments :
mag (type integer)

Choice of the magnitude

cmin (type integer)

Choosing the minimum value that will be represented by a color

cmax (type integer)

Choice of max will be represented by a color

Couleurs :
Warm color for high values(rouge)

Cool color for low values(bleu ciel)


Tuple as (reg, green, blue)


This function retrieves the color code

class gwa.code.extract.FindAmplitude(id_campagnes)[source]

To find the amplitude was applied to a extract.PNG () to one or more campaign!

class gwa.code.extract.DessinBatiment(liste_id_campagne, fichier='DessinBatiment', resolution=100)[source]

Can be extracted into a PNG, the results of a set of campaign

Arguments :
  • liste_id_campagne (type list)

    List with the numbers of campaign we want to show

  • fichier (type string)

    Selecting the name of the file extraction, is extansion. Png is added automatically

  • resolution (type integer)

    Optional parameter to adjust the resolution in pixels per meter. (default = 100)


>>> liste_id_campagne = [1,2,3,4]
>>> file = 'essai_extract'
dessinBatiment(liste_id_campagne,fichier, 100)
class gwa.code.extract.Legende(informations, power_min, power_max, size)[source]

Generates the surface corresponding to the caption of a drawing

Arguments :
  • informations (type list)

    List of tuple, where each tuple contains the name of information and information

  • power_min (type int)

    Min power used for the color of the drawing

  • power_max (type int)

    Max power used for the color of the drawing

  • size

    the pixel size of the largest side of the drawing


>>> amplitude = FindAmplitude(numerodecampagne).get()
>>> leg = Legende([('Batiment','Maison'),('Pièce','Chambre'),('Campagne','Première'),('Date','17/11/85')],amplitudetest[0], amplitudetest[1], 2100).get()

reference surface with the legend


Customize the text and the forms of the legend according to the size of the final image

Previous topic

module: ‘’

Next topic

module: ‘’

This Page