コード例 #1
0

# Steps

lesson.addStep("Introduction", "01_intro.md", steptype=Step.MANUALSTEP)

lesson.addStep("Make 'Wake_MajorRoads' active", "02_active_layer.md", function=lambda: setActiveLayer("Wake_MajorRoads"),
               endcheck=lambda: layerActive("Wake_MajorRoads"), steptype=Step.MANUALSTEP)

lesson.addMenuClickStep("Layer/Properties...", "03_open_properties.md")

lesson.addStep("Set data-override to Pen Width option", "04_set_overrride_settings.md", steptype=Step.MANUALSTEP)

lesson.addStep("Confirm data-override results", "05_override_results.md", steptype=Step.MANUALSTEP)

lesson.addMenuClickStep("Layer/Properties...", "03_open_properties.md")

lesson.addStep("Set an expression for Pen Width option", "06_set_overrride_expression.md", steptype=Step.MANUALSTEP)

lesson.addStep("Confirm expression results", "07_set_expression_results.md", steptype=Step.MANUALSTEP)

lesson.addMenuClickStep("Layer/Properties...", "03_open_properties.md")

lesson.addStep("Set an expression for color option", "08_intersect_expression.md", steptype=Step.MANUALSTEP)

lesson.addStep("Confirm final results", "09_intersect_expression_results.md", steptype=Step.MANUALSTEP)

# Suggested lessons

lesson.addNextLesson("Layer styling", "11. Labelling vector layers")
コード例 #2
0
# -*- coding: utf-8 -*-
#
# (c) 2016 Boundless, http://boundlessgeo.com
# This code is licensed under the GPL 2.0 license.
#
from lessons.lesson import Lesson, Step
from lessons.utils import setActiveLayer, layerActive
from qgis.utils import iface
from lessons import addLessonModule

lesson = Lesson("Export to geojson", "Basic lessons", "lesson.html")
lesson.addStep("Set 'points' layer as active layer", "activelayer.md",
               function=lambda: setActiveLayer("points"),
               endcheck=lambda:layerActive("points"),
               steptype=Step.MANUALSTEP)
lesson.addMenuClickStep("Layer/Save As...")
lesson.addStep("Save the file as geojson", "saveas.html", steptype=Step.MANUALSTEP)
lesson.addNextLesson("Basic lessons", "Export to geojson (yaml example)")

コード例 #3
0
                "00_lesson.html")

# Steps
lesson.addStep("Copy data", "Copy data", copyTable)

lesson.addStep('Introduction', '01_intro.html', steptype=Step.MANUALSTEP)

lesson.addMenuClickStep('Layer/Add Layer/Add Vector Layer...')

lesson.addStep('Load example dataset',
               '02_select_dataset_file.html',
               steptype=Step.MANUALSTEP)

lesson.addMenuClickStep('Layer/Properties...', '03_open_properties.html')

lesson.addStep('Change layer style',
               '04_change_settings.html',
               steptype=Step.MANUALSTEP)

lesson.addMenuClickStep('Layer/Add Layer/Add Vector Layer...',
                        '05_open_dataset_again.html')

lesson.addStep('Load example dataset',
               '02_select_dataset_file.html',
               steptype=Step.MANUALSTEP)

lesson.addStep('Conclusion', '06_conclusion.html', steptype=Step.MANUALSTEP)

# Suggested lessons
lesson.addNextLesson("Layer styling", "09. Manage multiple styles in a layer")
コード例 #4
0
lesson.addStep("Set the ELSE rule",
               "06_set_else_rule.html",
               steptype=Step.MANUALSTEP)

lesson.addStep("Confirm the results",
               "07_set_else_rule_results.html",
               steptype=Step.MANUALSTEP)

lesson.addMenuClickStep("Layer/Properties...", "03_open_properties.html")

lesson.addStep("Nest existing rules",
               "08_nest_rules.html",
               steptype=Step.MANUALSTEP)

lesson.addStep("Confirm the results",
               "09_nest_rules_results.html",
               steptype=Step.MANUALSTEP)

lesson.addMenuClickStep("Layer/Properties...", "03_open_properties.html")

lesson.addStep("Set update rule",
               "10_set_update_rule.html",
               steptype=Step.MANUALSTEP)

lesson.addStep("Confirm the results",
               "11_set_update_rule_results.html",
               steptype=Step.MANUALSTEP)

# Suggested lessons
lesson.addNextLesson("Layer styling", "05. Create Proportional Symbols")
コード例 #5
0
from lessons import addLessonModule
from lessons.utils import copyLessonData


def copyTable():
    filepath = os.path.join(
        os.path.dirname(os.path.dirname(__file__)),
        "Transform_X_and_Y_CSV_table_into_a_point_vector_layer/data",
        "songs.csv")
    copyLessonData(filepath, os.path.basename(os.path.dirname(__file__)))


lesson = Lesson("07. Transform X and Y CSV table into a point vector layer",
                "General tasks", "lesson.html")

lesson.addStep("Copy data", "Copy data", copyTable)
lesson.addStep('Introduction', 'introduction.html', steptype=Step.MANUALSTEP)
lesson.addMenuClickStep('Layer/Add Layer/Add Delimited Text Layer...')
lesson.addStep('Configure importing settings',
               'delimited_text_settings.html',
               steptype=Step.MANUALSTEP)
lesson.addStep('Set layer as active layer',
               'set_active_layer.html',
               steptype=Step.MANUALSTEP)
lesson.addMenuClickStep('Layer/Save As...')
lesson.addStep('Save the file as GeoPackage',
               'save_as_geopackage.html',
               steptype=Step.MANUALSTEP)

lesson.addNextLesson("General tasks", "08. Group layers")
コード例 #6
0
# -*- coding: utf-8 -*-
#
# (c) 2016 Boundless, http://boundlessgeo.com
# This code is licensed under the GPL 2.0 license.
#
from lessons.lesson import Lesson, Step
from lessons.utils import setActiveLayer, layerActive
from qgis.utils import iface
from lessons import addLessonModule

lesson = Lesson("05. Reproject vector layer", "General tasks", "lesson.html")
lesson.addStep("Introduction", "introduction.html", steptype=Step.MANUALSTEP)
lesson.addStep("Set 'Wake_Fire_Stations' layer as active layer",
               "activelayer.html",
               function=lambda: setActiveLayer("Wake_Fire_Stations"),
               endcheck=lambda: layerActive("Wake_Fire_Stations"),
               steptype=Step.MANUALSTEP)
lesson.addMenuClickStep("Layer/Properties...", "openproperties.html")
lesson.addStep("Confirm layer CRS",
               "confirmcrs.html",
               steptype=Step.MANUALSTEP)
lesson.addMenuClickStep("Layer/Save As...")
lesson.addStep("Save a reprojected copy of the layer",
               "saveas.html",
               steptype=Step.MANUALSTEP)
lesson.addNextLesson("General tasks",
                     "06. Reproject vector layer (using Processing)")
コード例 #7
0
# -*- coding: utf-8 -*-
#
# (c) 2016 Boundless, http://boundlessgeo.com
# This code is licensed under the GPL 2.0 license.
#
from lessons.lesson import Lesson, Step
from lessons.utils import setActiveLayer, layerActive
from qgis.utils import iface
from lessons import addLessonModule

lesson = Lesson("04. Set and define a vector layer CRS", "General tasks", "lesson.html")

lesson.addStep("Introduction", "introduction.html", steptype=Step.MANUALSTEP)
lesson.addStep("Set 'Wake_BlockGroup_2010' layer as active layer", "activelayer.html",
               function=lambda: setActiveLayer("Wake_BlockGroup_2010"),
               endcheck=lambda: layerActive("Wake_BlockGroup_2010"),
               steptype=Step.MANUALSTEP)
lesson.addMenuClickStep("Layer/Set CRS of Layer(s)")
lesson.addStep("Set the layer's correct CRS", "setcrs.html", steptype=Step.MANUALSTEP)
lesson.addMenuClickStep("Vector/Data Management Tools/Define current projection", "gotodefineprojection.html")
lesson.addStep("Define new CRS to file", "defineprojection.html", steptype=Step.MANUALSTEP)
lesson.addNextLesson("General tasks", "05. Reproject vector layer")
コード例 #8
0
# -*- coding: utf-8 -*-
#
# (c) 2016 Boundless, http://boundlessgeo.com
# This code is licensed under the GPL 2.0 license.
#
from lessons.lesson import Lesson, Step
from lessons.utils import setActiveLayer, layerActive
from qgis.utils import iface
from lessons import addLessonModule

lesson = Lesson("01. Export vector layer", "General tasks", "lesson.html")
lesson.addStep("Introduction", "introduction.html", steptype=Step.MANUALSTEP)
lesson.addStep("Set 'Wake_Fire_Stations' layer as active layer",
               "activelayer.html",
               function=lambda: setActiveLayer("Wake_Fire_Stations"),
               endcheck=lambda: layerActive("Wake_Fire_Stations"),
               steptype=Step.MANUALSTEP)
lesson.addMenuClickStep("Layer/Save As...",
                        name="Click on 'Layer > Save As...' menu item.")
lesson.addStep("Save layer to new format",
               "saveas.html",
               steptype=Step.MANUALSTEP)
lesson.addNextLesson("General tasks", "02. Export raster layer")
コード例 #9
0
lesson.addStep("Change categories symbol",
               "05_change_style.html",
               steptype=Step.MANUALSTEP)

lesson.addStep("Confirm results",
               "06_change_style_results.html",
               steptype=Step.MANUALSTEP)

lesson.addMenuClickStep("Layer/Properties...", "02_open_properties.html")

lesson.addStep("Combine two fields in categorized Symbol",
               "07_add_oneway.html",
               steptype=Step.MANUALSTEP)

lesson.addStep("Confirm results",
               "08_add_oneway_results.html",
               steptype=Step.MANUALSTEP)

lesson.addMenuClickStep("Layer/Properties...", "02_open_properties.html")

lesson.addStep("Pre-process values to use in categories",
               "09_reduce_classes.html",
               steptype=Step.MANUALSTEP)

lesson.addStep("Confirm results",
               "10_reduce_classes_results.html",
               steptype=Step.MANUALSTEP)

# Suggested lessons
lesson.addNextLesson("Layer styling", "03. Vector graduated symbols")
コード例 #10
0
# Steps
lesson.addStep("Set 'Wake_Public_Schools' layer as active layer",
               "01_activelayer.html",
               function=lambda: setActiveLayer("Wake_Public_Schools"),
               endcheck=lambda: layerActive("Wake_Public_Schools"),
               steptype=Step.MANUALSTEP)

lesson.addMenuClickStep("Layer/Properties...", "02_open_properties.html")

lesson.addStep("Use size assistant to set symbols",
               "03_set_proportional_symbols.html",
               steptype=Step.MANUALSTEP)

lesson.addStep("Confirm results",
               "04_proportional_size_results.html",
               steptype=Step.MANUALSTEP)

lesson.addMenuClickStep("Layer/Properties...", "02_open_properties.html")

lesson.addStep("Change size expression",
               "05_view_expression.html",
               steptype=Step.MANUALSTEP)

lesson.addStep("Confirm final results",
               "06_view_expression_results.html",
               steptype=Step.MANUALSTEP)

# Suggested lessons
lesson.addNextLesson("Layer styling", "06. Raster singleband styling")
コード例 #11
0
# -*- coding: utf-8 -*-
#
# (c) 2016 Boundless, http://boundlessgeo.com
# This code is licensed under the GPL 2.0 license.
#
from lessons.lesson import Lesson, Step
from lessons.utils import setActiveLayer, layerActive
from qgis.utils import iface
from lessons import addLessonModule

lesson = Lesson("Export to geojson", "Basic lessons", "lesson.html")
lesson.addStep("Set 'points' layer as active layer", "activelayer.md",
               function=lambda: setActiveLayer("points"),
               endcheck=lambda: layerActive("points"),
               steptype=Step.MANUALSTEP)
lesson.addMenuClickStep("Layer/Save As...")
lesson.addStep("Save the file as geojson", "saveas.html", steptype=Step.MANUALSTEP)
lesson.addNextLesson("Basic lessons", "Export to geojson (yaml example)")

コード例 #12
0
lesson.addStep("Set active layer",
               "02_active_layer.md",
               function=lambda: setActiveLayer("Raleigh_Downtown"),
               endcheck=lambda: layerActive("Raleigh_Downtown"),
               steptype=Step.MANUALSTEP)

lesson.addStep("Open Styling panel",
               "03_open_styling_panel.md",
               steptype=Step.MANUALSTEP)

lesson.addStep("Change layer's symbol",
               "04_change_simple_fill_settings.md",
               steptype=Step.MANUALSTEP)

lesson.addStep("Confirm symbol's changes",
               "05_simple_fill_results.md",
               steptype=Step.MANUALSTEP)

lesson.addStep("Add Line pattern fill",
               "06_add_line_pattern.md",
               steptype=Step.MANUALSTEP)

lesson.addStep("Confirm final result",
               "07_final_results.md",
               steptype=Step.MANUALSTEP)

# Suggested lessons

lesson.addNextLesson("Layer styling", "02. Vector categorized symbols")
コード例 #13
0
from qgis.utils import iface
from lessons import addLessonModule

# Lesson description
lesson = Lesson("09. Manage multiple styles in a layer", "Layer styling",
                "00_lesson.html")

# Steps
lesson.addStep("Introduction", "01_intro.html", steptype=Step.MANUALSTEP)

lesson.addStep("Rename current style",
               "02_rename_existing_style.html",
               steptype=Step.MANUALSTEP)

lesson.addStep("Create new style",
               "03_create_new_style.html",
               steptype=Step.MANUALSTEP)

lesson.addMenuClickStep("Layer/Properties...", "04_open_properties.html")

lesson.addStep("Change new style settings",
               "05_create_occupied_ratio_style.html",
               steptype=Step.MANUALSTEP)

lesson.addStep("Go back to previous style",
               "06_revert_to_population_density.html",
               steptype=Step.MANUALSTEP)

# Suggested lessons
lesson.addNextLesson("Layer styling", "10. Using data-defined properties")
コード例 #14
0
# Steps
lesson.addStep("Set 'landsat_8_sample' layer as active layer",
               "01_activelayer.html",
               function=lambda: setActiveLayer("landsat_8_sample"),
               endcheck=lambda: layerActive("landsat_8_sample"),
               steptype=Step.MANUALSTEP)

lesson.addMenuClickStep("Layer/Properties...", "02_open_properties.html")

lesson.addStep("Set layer style to Singleband pseudocolor",
               "03_set_432_natural_color.html",
               steptype=Step.MANUALSTEP)

lesson.addStep("Confirm results",
               "04_set_432_natural_color_results.html",
               steptype=Step.MANUALSTEP)

lesson.addMenuClickStep("Layer/Properties...", "02_open_properties.html")

lesson.addStep("Set better legend values",
               "05_set_543_infrared_color.html",
               steptype=Step.MANUALSTEP)

lesson.addStep("Confirm results",
               "06_set_543_infrared_color_results.html",
               steptype=Step.MANUALSTEP)

# Suggested lessons
lesson.addNextLesson("Layer styling", "08. Setting layer's default style")
コード例 #15
0
lesson.addStep("Set layer style to Singleband pseudocolor",
               "03_set_singleband_pseudocolor.html",
               steptype=Step.MANUALSTEP)

lesson.addStep("Confirm results",
               "04_set_singleband_pseudocolor_results.html",
               steptype=Step.MANUALSTEP)

lesson.addMenuClickStep("Layer/Properties...", "02_open_properties.html")

lesson.addStep("Set better legend values",
               "05_set_better_legend_values.html",
               steptype=Step.MANUALSTEP)

lesson.addStep("Confirm results",
               "06_set_better_legend_values_results.html",
               steptype=Step.MANUALSTEP)

lesson.addMenuClickStep("Layer/Properties...", "02_open_properties.html")

lesson.addStep("Set discrete color interpolation mode",
               "07_set_discrete_mode.html",
               steptype=Step.MANUALSTEP)

lesson.addStep("Confirm results",
               "08_set_discrete_mode_results.html",
               steptype=Step.MANUALSTEP)

# Suggested lessons
lesson.addNextLesson("Layer styling", "07. Raster multiband styling")
コード例 #16
0
lesson.addStep("Convert sq ft to sq miles",
               "07_convert_to_miles.html",
               steptype=Step.MANUALSTEP)

lesson.addStep("Confirm results",
               "08_convert_to_miles_results.html",
               steptype=Step.MANUALSTEP)

lesson.addMenuClickStep("Layer/Properties...", "02_open_properties.html")

lesson.addStep("Change classification method",
               "09_change_method.html",
               steptype=Step.MANUALSTEP)

lesson.addStep("Confirm results",
               "10_change_method_results.html",
               steptype=Step.MANUALSTEP)

lesson.addMenuClickStep("Layer/Properties...", "02_open_properties.html")

lesson.addStep("Convert population to thousands",
               "11_to_thousands.html",
               steptype=Step.MANUALSTEP)

lesson.addStep("Confirm results",
               "12_to_thousands_results.html",
               steptype=Step.MANUALSTEP)

# Suggested lessons
lesson.addNextLesson("Layer styling", "04. Vector rule-based symbols")