예제 #1
0
def species_range(filename=None, exporter=generic_species_exporter,
                  dataset_id=None):
    header = COMMON_HEADER + (
        'Areal favorabil referinta',
        'Operator - areal',
        'Necunoscut',
        'U1',
        'U2',
    )

    def format_row(sp, sr):
        name = None
        if sp.lu:
            name = sp.lu.display_name
        name = name or ''
        return [
            sp.code,
            name,
            sr.region,
            unicode(sr.complementary_favourable_range)
            if sr.complementary_favourable_range else '',
            unicode(sr.complementary_favourable_range_op)
            if sr.complementary_favourable_range_unknown else '',
            'x' if sr.complementary_favourable_range_unknown else '',
            '',
            '',
        ]

    columns = exporter(format_row, dataset_id=dataset_id)
    do_csv_export(header, columns, filename)
예제 #2
0
def habitat_coverage_magnitude(filename=None, dataset_id=None):
    header = COMMON_HEADER + (
        'Magn. min scurt', 'Magn. max scurt', 'Interval incredere scurt',
        'Magn. min lung', 'Magn. max lung', 'Interval incredere lung',
    )

    def format_row(sp, sr):
        name = None
        if sp.lu:
            name = sp.lu.display_name
        name = name or ''
        return [
            sp.code,
            name,
            sr.region,
            unicode(sr.coverage_trend_magnitude_min or ''),
            unicode(sr.coverage_trend_magnitude_max or ''),
            unicode(sr.coverage_trend_magnitude_ci or ''),
            unicode(sr.coverage_trend_long_magnitude_min or ''),
            unicode(sr.coverage_trend_long_magnitude_max or ''),
            unicode(sr.coverage_trend_long_magnitude_ci or ''),
        ]

    columns = generic_habitat_exporter(format_row, dataset_id=dataset_id)
    do_csv_export(header, columns, filename)
예제 #3
0
def species_magnitude(filename=None, exporter=generic_species_exporter,
                      dataset_id=None):
    header = COMMON_HEADER + (
        'Magn. min scurt', 'Magn. max scurt', 'Magn. min lung',
        'Magn. max lung',
    )

    def format_row(sp, sr):
        name = None
        if sp.lu:
            name = sp.lu.display_name
        name = name or ''

        row = [
            sp.code,
            name,
            sr.region,
            unicode(sr.range_trend_magnitude_min or ''),
            unicode(sr.range_trend_magnitude_max or ''),
            unicode(sr.range_trend_long_magnitude_min or ''),
            unicode(sr.range_trend_long_magnitude_max or ''),
        ]
        return row

    columns = exporter(format_row, dataset_id=dataset_id)

    do_csv_export(header, columns, filename)
예제 #4
0
def species_population_units(filename=None, dataset_id=None):
    header = COMMON_HEADER + (
        u'Unit. de măsură',
        u'Metoda conversie',
        u'Definiția localității',
        u'Dificultăți întâmpinate',
    )

    def format_row(sp, sr):
        name = sp.lu.display_name if sp.lu else None
        name = name or ''
        units = [sr.population_size_unit, sr.population_alt_size_unit]
        units = [str(unit) for unit in units if unit]
        return [
            sp.code,
            name,
            sr.region,
            ';'.join(units),
            sr.population_additional_method or '',
            sr.population_additional_locality or '',
            sr.population_additional_problems or '',
        ]

    columns = generic_species_exporter(format_row, dataset_id=dataset_id)
    do_csv_export(header, columns, filename)
예제 #5
0
def habitat_coverage_range(filename=None, dataset_id=None):
    header = COMMON_HEADER + (
        'Suprafata favorabila referinta',
        'Operator',
        'Necunoscut',
        'U1',
        'U2',
    )

    def format_row(sp, sr):
        name = None
        if sp.lu:
            name = sp.lu.display_name
        name = name or ''
        return [
            sp.code,
            name,
            sr.region,
            unicode(sr.complementary_favourable_area)
            if sr.complementary_favourable_area else '',
            unicode(sr.complementary_favourable_area_op)
            if sr.complementary_favourable_area_unknown else '',
            'x' if sr.complementary_favourable_area_unknown else '',
            '',
            '',
        ]

    columns = generic_habitat_exporter(format_row, dataset_id=dataset_id)
    do_csv_export(header, columns, filename)
예제 #6
0
def species_range(filename=None,
                  exporter=generic_species_exporter,
                  dataset_id=None):
    header = COMMON_HEADER + (
        'Areal favorabil referinta',
        'Operator - areal',
        'Necunoscut',
        'U1',
        'U2',
    )

    def format_row(sp, sr):
        name = None
        if sp.lu:
            name = sp.lu.display_name
        name = name or ''
        return [
            sp.code,
            name,
            sr.region,
            unicode(sr.complementary_favourable_range)
            if sr.complementary_favourable_range else '',
            unicode(sr.complementary_favourable_range_op)
            if sr.complementary_favourable_range_unknown else '',
            'x' if sr.complementary_favourable_range_unknown else '',
            '',
            '',
        ]

    columns = exporter(format_row, dataset_id=dataset_id)
    do_csv_export(header, columns, filename)
예제 #7
0
def species_habitat(filename=None, dataset_id=None):
    header = COMMON_HEADER + (
        u'Suprafața habitat',
        u'Suprafața adecvata',
        u'U1',
        u'U2',
    )

    def format_row(sp, sr):
        name = None
        if sp.lu:
            name = sp.lu.display_name
        name = name or ''

        return [
            sp.code,
            name,
            sr.region,
            unicode(sr.habitat_surface_area or ''),
            unicode(sr.habitat_area_suitable or ''),
            '', ''
        ]

    columns = generic_species_exporter(format_row, dataset_id=dataset_id)
    do_csv_export(header, columns, filename)
예제 #8
0
def species_magnitude(filename=None,
                      exporter=generic_species_exporter,
                      dataset_id=None):
    header = COMMON_HEADER + (
        'Magn. min scurt',
        'Magn. max scurt',
        'Magn. min lung',
        'Magn. max lung',
    )

    def format_row(sp, sr):
        name = None
        if sp.lu:
            name = sp.lu.display_name
        name = name or ''

        row = [
            sp.code,
            name,
            sr.region,
            unicode(sr.range_trend_magnitude_min or ''),
            unicode(sr.range_trend_magnitude_max or ''),
            unicode(sr.range_trend_long_magnitude_min or ''),
            unicode(sr.range_trend_long_magnitude_max or ''),
        ]
        return row

    columns = exporter(format_row, dataset_id=dataset_id)

    do_csv_export(header, columns, filename)
예제 #9
0
def habitat_coverage_magnitude(filename=None, dataset_id=None):
    header = COMMON_HEADER + (
        'Magn. min scurt',
        'Magn. max scurt',
        'Interval incredere scurt',
        'Magn. min lung',
        'Magn. max lung',
        'Interval incredere lung',
    )

    def format_row(sp, sr):
        name = None
        if sp.lu:
            name = sp.lu.display_name
        name = name or ''
        return [
            sp.code,
            name,
            sr.region,
            unicode(sr.coverage_trend_magnitude_min or ''),
            unicode(sr.coverage_trend_magnitude_max or ''),
            unicode(sr.coverage_trend_magnitude_ci or ''),
            unicode(sr.coverage_trend_long_magnitude_min or ''),
            unicode(sr.coverage_trend_long_magnitude_max or ''),
            unicode(sr.coverage_trend_long_magnitude_ci or ''),
        ]

    columns = generic_habitat_exporter(format_row, dataset_id=dataset_id)
    do_csv_export(header, columns, filename)
예제 #10
0
def habitat_coverage_range(filename=None, dataset_id=None):
    header = COMMON_HEADER + (
        'Suprafata favorabila referinta',
        'Operator',
        'Necunoscut',
        'U1',
        'U2',
    )

    def format_row(sp, sr):
        name = None
        if sp.lu:
            name = sp.lu.display_name
        name = name or ''
        return [
            sp.code,
            name,
            sr.region,
            unicode(sr.complementary_favourable_area)
            if sr.complementary_favourable_area else '',
            unicode(sr.complementary_favourable_area_op)
            if sr.complementary_favourable_area_unknown else '',
            'x' if sr.complementary_favourable_area_unknown else '',
            '',
            '',
        ]

    columns = generic_habitat_exporter(format_row, dataset_id=dataset_id)
    do_csv_export(header, columns, filename)
예제 #11
0
def species_population_units(filename=None, dataset_id=None):
    header = COMMON_HEADER + (
        u'Unit. de măsură',
        u'Metoda conversie',
        u'Definiția localității',
        u'Dificultăți întâmpinate',
    )

    def format_row(sp, sr):
        name = sp.lu.display_name if sp.lu else None
        name = name or ''
        units = [sr.population_size_unit, sr.population_alt_size_unit]
        units = [str(unit) for unit in units if unit]
        return [
            sp.code,
            name,
            sr.region,
            ';'.join(units),
            sr.population_additional_method or '',
            sr.population_additional_locality or '',
            sr.population_additional_problems or '',
        ]

    columns = generic_species_exporter(format_row, dataset_id=dataset_id)
    do_csv_export(header, columns, filename)
예제 #12
0
def species_habitat(filename=None, dataset_id=None):
    header = COMMON_HEADER + (
        u'Suprafața habitat',
        u'Suprafața adecvata',
        u'U1',
        u'U2',
    )

    def format_row(sp, sr):
        name = None
        if sp.lu:
            name = sp.lu.display_name
        name = name or ''

        return [
            sp.code, name, sr.region,
            unicode(sr.habitat_surface_area or ''),
            unicode(sr.habitat_area_suitable or ''), '', ''
        ]

    columns = generic_species_exporter(format_row, dataset_id=dataset_id)
    do_csv_export(header, columns, filename)