Skip to content

ADD: sumarize() method

Rémi Cresson requested to merge 43-serialize_objects into master

Closes #43 (closed)

Example

import json
import pyotb

def pretty_print(dic):
    print(json.dumps(dic, sort_keys=True, indent=4))

app1 = pyotb.BandMath({'il':'image.tif', 'exp':'im1b1'})
app2 = pyotb.OrthoRectification({'io.in':app1})

pretty_print(app1.summarize())
pretty_print(app2.summarize())

Result

{
    "name": "BandMath",
    "parameters": {
        "exp": "im1b1",
        "il": [
            "image.tif"
        ]
    }
}
{
    "name": "OrthoRectification",
    "parameters": {
        "io.in": {
            "name": "BandMath",
            "parameters": {
                "exp": "im1b1",
                "il": [
                    "image.tif"
                ]
            }
        },
        "map": "utm",
        "map.utm.northhem": true,
        "map.utm.zone": 31,
        "opt.gridspacing": 4.0,
        "outputs.isotropic": true,
        "outputs.lrx": 561506.125,
        "outputs.lry": 5493909.5,
        "outputs.sizex": 251,
        "outputs.sizey": 304,
        "outputs.spacingx": 5.997312068939209,
        "outputs.spacingy": -5.997312068939209,
        "outputs.ulx": 560000.8125,
        "outputs.uly": 5495732.5
    }
}

Changes

Nouvelle hiérarchie de classes:

Avant

classDiagram
otbObject <|-- Output
otbObject <|-- App
otbObject <|-- Input
otbObject <|-- Operation
otbObject <|-- Slicer

Après

classDiagram
otbObject <|-- Output
otbObject <|-- App
App <|-- Input
App <|-- Operation
App <|-- Slicer
Edited by Rémi Cresson

Merge request reports

Loading