{"id":92,"date":"2021-09-26T17:56:14","date_gmt":"2021-09-26T22:56:14","guid":{"rendered":"https:\/\/sites.owu.edu\/geog-199\/?p=92"},"modified":"2021-09-26T17:56:14","modified_gmt":"2021-09-26T22:56:14","slug":"wade-chapter-5-geoprocessing-using-python","status":"publish","type":"post","link":"https:\/\/sites.owu.edu\/geog-293\/2021\/09\/26\/wade-chapter-5-geoprocessing-using-python\/","title":{"rendered":"Wade: Chapter 5: Geoprocessing Using Python"},"content":{"rendered":"<p><b>Terms<\/b><\/p>\n<p><b>Class: <\/b><span style=\"font-weight: 400\">like an outline for creating a new object<\/span><\/p>\n<p><b>Environment: <\/b><span style=\"font-weight: 400\">a tool that helps to keep dependencies required by different projects separate<\/span><\/p>\n<p><b>Factory Code:<\/b><span style=\"font-weight: 400\">Factory method is <\/span><span style=\"font-weight: 400\">a creational design pattern which solves the problem of creating product objects<\/span><span style=\"font-weight: 400\"> without specifying their concrete classes. Factory Method defines a method, which should be used for creating objects instead of direct constructor call ( new operator).<\/span><\/p>\n<p><b>Function: <\/b><span style=\"font-weight: 400\">a block of code that only runs when it is called<\/span><span style=\"font-weight: 400\">.<\/span><\/p>\n<p><b>Hard-Coded: <\/b><span style=\"font-weight: 400\">A part of a program that has been declared as unchanging<\/span><\/p>\n<p><b>Instance: <\/b><span style=\"font-weight: 400\">An individual object of a certain class<\/span><span style=\"font-weight: 400\">.<\/span><\/p>\n<p><b>Method:<\/b> <span style=\"font-weight: 400\">a function that \u201cbelongs to\u201d an object<\/span><span style=\"font-weight: 400\">.<\/span><\/p>\n<p><b>Namespace: <\/b><span style=\"font-weight: 400\">a system that has a unique name for each and every object in Python<\/span><span style=\"font-weight: 400\">.\u00a0<\/span><\/p>\n<p><b>Object: <\/b><span style=\"font-weight: 400\">Everything is in Python treated as an object, including variable, function, list, tuple, dictionary, set, etc. Every object belongs to its class.<\/span><\/p>\n<p><b>Package:<\/b> <span style=\"font-weight: 400\">A package is basically a directory with Python files and a file with the <\/span><span style=\"font-weight: 400\">name __init__ .<\/span> <span style=\"font-weight: 400\">py<\/span><span style=\"font-weight: 400\">. This means that every directory inside of the Python path, which contains a file named __init__ . py, will be treated as a package by Python.<\/span><\/p>\n<p><b>Property: <\/b><span style=\"font-weight: 400\">t<\/span><span style=\"font-weight: 400\">he main purpose of Property() function is <\/span><span style=\"font-weight: 400\">to create property of a class<\/span><span style=\"font-weight: 400\">.<\/span><\/p>\n<p><b>Well-known ID (WKID): <\/b><span style=\"font-weight: 400\">a unique number assigned to a coordinate system<\/span><span style=\"font-weight: 400\">.<\/span><\/p>\n<p><b>Well-known text (WKT): <\/b><span style=\"font-weight: 400\">an Open Geospatial Consortium (OGC) standard that <\/span><span style=\"font-weight: 400\">is used to represent spatial data in a textual format<\/span><span style=\"font-weight: 400\">.<\/span><\/p>\n<p><b>Workspace: <\/b><span style=\"font-weight: 400\">supports the embedding and running of Python scripts within a workflow<\/span><span style=\"font-weight: 400\">.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><b>Review Questions<\/b><\/p>\n<p>&nbsp;<\/p>\n<ul>\n<li><b>Explain some of the uses of the \u201cResult\u201d object.\u00a0<\/b>\n<ul>\n<li><span style=\"font-weight: 400\">The result object can be used as an input to another function. The result object also has properties and methods.<\/span><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ol>\n<li style=\"list-style-type: none\">\n<ol>\n<li style=\"list-style-type: none\"><\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<ul>\n<li><b>Why are classes used as input parameters for geoprocessing tools?<\/b>\n<ul>\n<li><span style=\"font-size: 1rem\">Classes are often used as shortcuts for tool parameters that would otherwise have a more complicated equivalent.<\/span><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul>\n<li><b>What are some of the typical environments set in a script?<\/b><\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ol>\n<li style=\"list-style-type: none\">\n<ol>\n<li style=\"list-style-type: none\">\n<ol>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">ClearEnvironment.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">ListEnvironments.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">LoadSettings.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">ResetEnvironments.<\/span><\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">SaveSettings<\/span><\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<ul>\n<li><b>Explain how Pro is licensed and how this impacts handling licensing when writing scripts.<\/b>\n<ul>\n<li><span style=\"font-size: 1rem\">You must have a license to run geoprocessing tools, which includes running a stand-alone python script that uses these tools. You will receive an error message if you try to run a tool that you do not have a license for, such as Spatial Analyst tools.<\/span><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Terms Class: like an outline for creating a new object Environment: a tool that helps to keep dependencies required by different projects separate Factory Code:Factory method is a creational design pattern which solves the problem of creating product objects without <span class=\"readmore\"><a href=\"https:\/\/sites.owu.edu\/geog-293\/2021\/09\/26\/wade-chapter-5-geoprocessing-using-python\/\">Continue Reading<\/a><\/span><\/p>\n","protected":false},"author":1413,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-92","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/sites.owu.edu\/geog-293\/wp-json\/wp\/v2\/posts\/92","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sites.owu.edu\/geog-293\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sites.owu.edu\/geog-293\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sites.owu.edu\/geog-293\/wp-json\/wp\/v2\/users\/1413"}],"replies":[{"embeddable":true,"href":"https:\/\/sites.owu.edu\/geog-293\/wp-json\/wp\/v2\/comments?post=92"}],"version-history":[{"count":1,"href":"https:\/\/sites.owu.edu\/geog-293\/wp-json\/wp\/v2\/posts\/92\/revisions"}],"predecessor-version":[{"id":93,"href":"https:\/\/sites.owu.edu\/geog-293\/wp-json\/wp\/v2\/posts\/92\/revisions\/93"}],"wp:attachment":[{"href":"https:\/\/sites.owu.edu\/geog-293\/wp-json\/wp\/v2\/media?parent=92"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sites.owu.edu\/geog-293\/wp-json\/wp\/v2\/categories?post=92"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sites.owu.edu\/geog-293\/wp-json\/wp\/v2\/tags?post=92"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}