For our last assignment of the semester, we worked with toolboxes and previously created scripts. We used a new expression known as sys.argv[]. With this expression, the number 1 will be used as the first parameter instead of 0, as with the arcpy.GetParameter function. Just like the arcpy.GetParameterAsText() function, the sys.argv[] always returns string objects. However, the sys.argv[] expressions have a character limit, which might cause your parameters to get cut short if they're very long. Therefore, it is usually recommended that you use arcpy.GetParameter or arcpy.GetParameterAsText().
As shown in the image below, the number of sample sites has a dialog description. An explanation was created for all of the parameters in the Syntax section of the Item Description box. With the explanations set, the tool is more user friendly.
Finally, we embedded and protected the script tool. This allows you to share the tool more easily and prevent anyone without the password from editing or even seeing the script. You only have the option to password protect the script once it has been embedded into the tool. If the script has not been imported, the option will not be available. Shown in the image below, you'll see the results from running the tool with the correct script, as well as a description of one of the parameters in the tool dialog box.
Overall, I really enjoyed the class this semester. There were a few bumpy roads, but I managed to do a lot better than I originally thought I would. I hope that someday I'll have the chance to use all of the knowledge I have gained throughout this course.
Tuesday, July 26, 2016
GIS 4102/5103: Week 10 - Creating Custom Tools
This past week was all about creating tools using PythonWin and ArcMap. We took script files that were previously created and created tools from them. In doing so, we created a new toolbox in ArcMap which then allowed us to add a script. In creating the script tool, we filled out all of the required information - such as the name, alias, description, etc. When we were finished with that, we opened up the Properties dialog box for the newly created script tool. There, we were able to complete the Parameters as instructed. In the first image shown below, it shows the result of setting the Input and Output file locations under the Parameters tab, within the the Properties dialog box. We then were ask to make some changes to the original script. One of those changes being to replace the print statements with the arcpy.AddMessage() function. This allowed the statements to be printed, and seen, in the Results box (as shown below).
I thought this assignment was fairly easy, compared to previous modules. I didn't have any real complications throughout this lab.
Thursday, July 21, 2016
GIS 4102/5103 - Week 9: Working with Rasters
Raster files are images that are used in ArcMap. They can come from a variety of sources and formats including .img, .tif and .jpg formats to name a few. Python can be used to describe components of a raster file, to remap and reclassify landcover, and to calculate slope and aspect. The most commonly used extension in working with raster files is the Spatial Analyst extension. Within Python, the arcpy.sa module is most used and all functions should be imported.
Our lab this week had us use a number of arcpy.sa functions to remap and reclassify landcover as well as calculate a desired slope and aspect of the elevation raster file. My final result is shown below.
Our lab this week had us use a number of arcpy.sa functions to remap and reclassify landcover as well as calculate a desired slope and aspect of the elevation raster file. My final result is shown below.
Sunday, July 17, 2016
GIS 4048: Week 9 - GIS for Local Government
Luckily, I was able to finish this assignment in time after encountering some technical difficulties with the online desktop. This past week, we were asked to provide information regarding a specific parcel for a client. The client, Mr. Zuko, provided us with three specific requests. His requests are as follows: Utilize Marion County Appraiser's website and online map to view the property and to obtain data for adjacent land parcels; create a site map showing all adjacent parcels, zoning, and property owner data within ArcMap; create a series of PDF maps displaying results.
The image shown below displays only one of the 16 pages containing the parcels. In the map, you'll notice that the different zones are broken down by color, making it easier to read. The surrounding parcels of interest are outlined in purple. You can also see Mr. Zuko's parcel which contains the red diagonal lines.
The image shown below displays only one of the 16 pages containing the parcels. In the map, you'll notice that the different zones are broken down by color, making it easier to read. The surrounding parcels of interest are outlined in purple. You can also see Mr. Zuko's parcel which contains the red diagonal lines.
Wednesday, July 13, 2016
GIS 4102/5105: Week 8 - Geometrics
Over the past couple of weeks, I learned how to write a text file using PythonWin. During the assignment, we were asked to create multiple for loops to create the text file shown below. We first created a search cursor for the rivers shapefile provided. The cursor called on the following three things: the OID field, the SHAPE geometry object, and the NAME field. The first for loop created iterated through each row/feature in the shapefile's attribute table. Within the row for loop, I then created another loop which iterated through each point in the array of the row/feature. I used the .write() method to add a line to the text file shown below. The file includes the feature/row OID, the vertex ID, the X coordinate followed by the Y coordinate, and the name of the river feature.
Sunday, July 10, 2016
GIS 4048: Week 8 - Urban Planning: Location Decisions
Unfortunately, we we finished up the crime analysis section, but now we get to take a look at urban planning and location decisions. This week's assignment focused on finding a home for a couple within Alachua County, Florida. She has accepted a position at North Florida Regional Medical Center (NFRMC) and he plans to teach at the University of Florida. They want to live somewhere that's close to both NFRMC and UF, as well as within a neighborhood with a high percentage of people aged 40-49 years old, and in a neighborhood with high house values.
Using the data from the previous map, I was able to create two weighted overlays to help the couple determine where they should start looking to buy their new home. Upon landing jobs in the county, it became more important for them to be closer to NFRMC and UF. For the overlay shown on the left, I set the equal influence so each criterion is weighed the same. As for the overlay on the right, I increased the influence on the distance criteria for each to produce the second overlay.
The map above displays Alachua County, Florida with all of the public lands within the county. This map was compiled in ArcMap then all of the layers were placed into a basemap layer. Once placed into a basemap layer, ArcMap will draw the layer using optimized map display logic.
This map is a compilation of four data frames. The two on the left were created using the Euclidean Distance tool centered on NFRMC (top) and UF (bottom). This criteria is important to a couple who are looking to buy a house located near NFRMC and UF. The two data frames displayed on the right are showing U.S. Census Bureau Census Tracts by the percentage of people aged 40-49, and the percentage of homeowners. This criteria is important for those looking to buy a home within a neighborhood that has a high percentage of that particular age range, and in a neighborhood with high house values.
Using the data from the previous map, I was able to create two weighted overlays to help the couple determine where they should start looking to buy their new home. Upon landing jobs in the county, it became more important for them to be closer to NFRMC and UF. For the overlay shown on the left, I set the equal influence so each criterion is weighed the same. As for the overlay on the right, I increased the influence on the distance criteria for each to produce the second overlay.
Saturday, July 2, 2016
GIS 4048: Week 7 - MEDS Protect
This week revolves around taking the data sets and layers generated last week and applying them with some additional data, particularly some LiDAR derived rasters, and looking at a real world situation. The situation in question is the Boston Marathon bombing of 2013. Here we are taking the MEDS Boston data and looking more so to prevention through establishment of surveillance, security, and observation points within view of the finish line and surrounding area. With these points, I am utilizing specific analysis tools available through ArcMap. The overall objectives for this week were to explore the LiDAR data using it to generate Hillshading, perform a Viewshed analysis, and create a Line of Sight analysis utilizing our created observation points.
This is an overview map of the event area. This shows a three-mile buffer zone around the marathon finish line. Identified around the finish line are the 10 closest hospitals and medical centers. All of these have been identified as needing increased security during the event. A 500-ft buffer has been placed around each of these critical infrastructure facilities. This is a fairly simplistic view of the area showing the various levels of road features throughout. The primary, secondary, and local roads are all symbolized appropriately for easy acquisition and understanding. The lower inset highlights the six counties that are a part of the Boston Metropolitan Statistical Area.
This is an overview map of the event area. This shows a three-mile buffer zone around the marathon finish line. Identified around the finish line are the 10 closest hospitals and medical centers. All of these have been identified as needing increased security during the event. A 500-ft buffer has been placed around each of these critical infrastructure facilities. This is a fairly simplistic view of the area showing the various levels of road features throughout. The primary, secondary, and local roads are all symbolized appropriately for easy acquisition and understanding. The lower inset highlights the six counties that are a part of the Boston Metropolitan Statistical Area.
This map shows an up close look at the finish line highlights additional security locations by placing checkpoints at each road intersecting with the 500-ft buffer from the finish line.
There is much more deliberate analysis in this final map. The first section at the top is a straightforward look at 15 identified observation points around the block within view of the finish line. The second frame down combines a multitude of analysis. Most clearly visible is the Viewshed analysis. This is the pink and green layer symbolized by pink meaning an area is not visible from the closest associated observation point, and green meaning the view is unobstructed. This layer is generated by a Hillshade layer which provides the gray shadowing underlying the Viewshed. Over top of this layer is a line of sight look from each point to the finish line. The red areas indicate some form of obstruction and the green areas are clear. This view is further broken down by the most obstructive point and shown in the graph just under the line of sight look. The lower inset shows the area much closer than in the basemap above.
With this type of planning and technical ability, we can hope that we can better plan and prevent such acts in the future. This is an excellent look at some of the analysis that goes into such large events drawing tens to hundreds of thousands of people.
Subscribe to:
Posts (Atom)