{"id":175,"date":"2021-12-09T20:10:47","date_gmt":"2021-12-10T01:10:47","guid":{"rendered":"https:\/\/sites.owu.edu\/geog-199\/?p=175"},"modified":"2021-12-09T20:10:47","modified_gmt":"2021-12-10T01:10:47","slug":"arcpy-final-assignment","status":"publish","type":"post","link":"https:\/\/sites.owu.edu\/geog-293\/2021\/12\/09\/arcpy-final-assignment\/","title":{"rendered":"ArcPy Final Assignment"},"content":{"rendered":"<p><span style=\"font-weight: 400\">Mack Wade<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><b>Get Started with Python in ArcGIS Pro<\/b><\/p>\n<p><span style=\"font-weight: 400\">In this course I learned how to write code to determine the number of features for all the feature classes in a workspace. This course also introduced some of the basics of Python syntax as I wrote code into the Python window in ArcGIS Pro.\u00a0\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400\">In order to begin this project I had to download data from ESRI\u2019s website. I really enjoyed this course and chose to do it because of the downloadable data that I could use as I followed along, unlike the book which did not provide downloadable datasets for it\u2019s walkthroughs.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400\">The course provided a few shapefiles to work out of, but for this exercise I used the Ambulances.shp.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400\">First, I ran a tool using Python. In Arc there are many ways and routes to complete one task. This task was to find the count of the items in the shapefile. You can do this in the attribute table or by using the Get Count tool in the Toolbox. You can also find the count by running a script in the Python window.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400\">To do this you take go to the toolbox history &gt; right click the Get Count tool &gt; Send to Python Window. After sending the window, I manually entered \u201cAmbulances\u201d since that\u2019s the shapefile I want to be working out of. The script looked like this:<\/span><\/p>\n<p><span style=\"font-weight: 400\">arcpy.management.GetCount(&#8220;ambulances&#8221;)<\/span><\/p>\n<p><span style=\"font-weight: 400\">After completing this task, I learned that when completing a script in the Python window, the history is updated to include the task.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400\">The next task that I practiced was inputing an assignment statement.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400\">y = 73\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400\">Then,\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400\">x = 37<\/span><\/p>\n<p><span style=\"font-weight: 400\">Then,<\/span><\/p>\n<p><span style=\"font-weight: 400\">x * y\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400\">Then, after pressing enter, the Python window answered with 2701<\/span><\/p>\n<p><span style=\"font-weight: 400\">Next, I did a similar thing but with Temperature.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400\">temp_c = 17<\/span><\/p>\n<p><span style=\"font-weight: 400\">temp_f = temp_c * 9 \/ 5 + 32<\/span><\/p>\n<p><span style=\"font-weight: 400\">print(temp_f)<\/span><\/p>\n<p><span style=\"font-weight: 400\">The Python window responded with 62.6<\/span><\/p>\n<p><span style=\"font-weight: 400\">The next assignment was learning how to use the Python window as a tool to help you when writing code. You can do this by hovering over the prompt and reading the information that the window provides.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400\">There is also a system of code completion. For example, if you want the \u201cGet Count\u201d tool, you can typer \u201cGet\u201d in the Python Window and suggestions will pop up to help you finish the prompt easier.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400\">I really enjoyed this tutorial. I thought that it was very easy to follow and was helpful. I see myself using more of ESRI\u2019s resources in the future if or when needed when writing scripts. I think that if any student was interested in this course in the future these tutorials would be a better resource than the book we used. <\/span><\/p>\n<p>I had some screen shots from this assignment but they did not get added into the blog format. If you would like me to send those over to you. let me know.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Mack Wade &nbsp; Get Started with Python in ArcGIS Pro In this course I learned how to write code to determine the number of features for all the feature classes in a workspace. This course also introduced some of the <span class=\"readmore\"><a href=\"https:\/\/sites.owu.edu\/geog-293\/2021\/12\/09\/arcpy-final-assignment\/\">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-175","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/sites.owu.edu\/geog-293\/wp-json\/wp\/v2\/posts\/175","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=175"}],"version-history":[{"count":1,"href":"https:\/\/sites.owu.edu\/geog-293\/wp-json\/wp\/v2\/posts\/175\/revisions"}],"predecessor-version":[{"id":176,"href":"https:\/\/sites.owu.edu\/geog-293\/wp-json\/wp\/v2\/posts\/175\/revisions\/176"}],"wp:attachment":[{"href":"https:\/\/sites.owu.edu\/geog-293\/wp-json\/wp\/v2\/media?parent=175"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sites.owu.edu\/geog-293\/wp-json\/wp\/v2\/categories?post=175"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sites.owu.edu\/geog-293\/wp-json\/wp\/v2\/tags?post=175"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}