Saturday, July 28, 2012

Module 7 - Listing Tools

This week’s lesson taught us some skills that will prove to be essential to our success in the real world. We learned how to formulate our approach to creating a solution by asking some questions about the problem. 
We learned skills such as path manipulation, DESCRIBE methods, Listing tools, Usage methods, and even learned how to check and toggle license usage.
Notes to Future Self:

  • When struggling with one of the tools try it in different editors to get further hints.   I had problems with the ExtractByMask function in Python Win, and couldn’t figure out why it would work in the Interactive and even in IDLE.    Turns out I needed to have my Scratch workspace defined.   Once I match my code to have the same scratch as my ArcGIS environment variable had, it was much more reliable.
  • Use the Online Help.   When working on a tool it is great to use the online help to grab code from.   No need to reinvent the wheel if they already have a working version of it.
  • When you get frustrated, walk away for a bit…   You’ll be surprised when the idea comes to you (hint: it usually isn’t when you are conveniently near a computer….)
  • Break down tasks to their simplest elements.   When working with the ExtractByMask, I ended up having to create a separate Python script to try to use just the bare minimums to get the function to run to a hard coded file.    I took the lessons learned here back to my assignment.
  • I found this assignment to be great system for using the data that we learned in the exercises.   I struggled at points, but kept at it and was able to finally make the program work.   That is tough to find assignments that are tough, but not impossible and I think this week was a good example of the challenge level that the assignments should present.
  • One problem I had with the lab was on page 3 where it asked us to save a raster out to the GDB with a period in the file name.   I was unable to do this, so just left the .TIF of the file name.

Saturday, July 21, 2012

Urban Planning: Location Descriptions

This week's assignment helped us use criteria provided by a couple to determine the optimal choice of neighborhood to live in when moving to Alachua county, Florida.    We were tasked with providing 3 maps, a basemap, a map showing the 4 criteria (proximity to hospital, proximity to UF, percentage of population between age 40-49, and median house value), and a final map which took these multriple considerations into account.





Process Summary

From the “Step 4: Analysis” major section, include your process for Steps 7 and 8 (weighted analysis).
1) Saved my Location2 as Location3.mxd
2) Removed all data frames (Adding a new frame and importing the Projection information first)
3) Added the 3 feature classes that we created in the previous section to the MXD (hosp, school, rightage, and value)
4) Cleaned up the symbology for these layers
5) Started Model Builder
6) Added the 4 feature classes to Model Builder
7) Added the Weighted Overlay tool to the model
8) Connected the 4 feature classes to the Weighted Overlay box
9) Answered Q13
10) Answered Q14
11) Answered Q15
12) Answered Q16
13) Made sure the scale was set in the correct (reverse) order
14) Note: when reordering the scale you have to be sure that it doesn’t retain the last value rather than replacing it with the first value.
15) Gave each feature class a 25% weight
16) Gave the output the name WEIGHT1 and stored in the GeoDatabase
17) Ran the model
18) Added Weight 1 to the display and closed the model
19) Added Places to the mxd
20) Added Sel_tracts and made hollow
21) Added the school and hospital to the project and symbolized accordingly
22) Selected the three best areas that met the criteria and exported them out as Weight1Best3
23) Set up my model with the revised parameters making sure that my scales were set properly.
24) Set up the map layout
25) Answered Q17


Sunday, July 15, 2012

GIS Programming - Module 6 Assignment

I am still polishing some of the code required for this week's assignment, but wanted to go ahead an make my blog posting about some of the "Lessons Learned"

PART III: Module Summary
Write a summary of what you learned this Module. Try to come up with specifics from each exercise and assignment. List any problems (and fixes) you encountered, and any other notes you feel would be helpful to your ‘future-self’. Post this summary to your blog.

Lessons Learned:
Exercise 6a:
  • It is important to understand the pros and cons of relative and absolute paths (especially in terms of sharing your data with others)
  • Relative paths cannot span multiple drives
  • Absolute paths work best on static data
  • Relative pathnames work best when sharing data (remember you have to provide the data as well!)

Exercise 6b:
  • You can effectively share data with others by proper directory planning and relative paths.

Exercise 6c:
  • It is common to provide users with the tools and scripts in addition to the data
  • A recommended folder structure should have a data, scripts, scratch, and docs subdirectory
  • Getting messages out to the results window can be done with the arcpy.AddMessage() function
  • The ArcGIS tools have a section of their help documentation dedicated to sample code snippets
  • Password protection of embedded code is a great feature to help programmers maintain intellectual property (or keep the so called “power users” from messing up your code then entering a help desk ticket, but I digress….)

Exercise 6d:
  • Packaging data to deliver to clients is pretty straightforward in ArcGIS 10.x
  • You can use the Consolidate Map tool (which stores the references to data)
  • You can use the Package Map tool (which stores the data itself).   Think of the benefits of this when you are in the field with a laptop 20 miles from the nearest cell phone tower….

Assignment
The assignment felt like the real world kinds of things I need to do every day which is:
  • Understand the assignment
  • Research the tools
  • Struggle through a couple of false starts
  • Have that “a ha” moment where things start clicking

Saturday, July 14, 2012

Urban Planning - GIS for Local Government

This week's multipart exercise had a lot of interesting aspects to it.   Having been around offices that have dealings with parcel information, I can vouch for the usefulness of this type of knowledge.

Without further delay, here are some of my maps from this week's assignment:



Process Summary:
OBJECTIVE 2:
1) Created a new blank MXD and saved as Parcels.mxd
2) Added the Parcels Feature Class from the results.gdb
3) Looked at the attributes and noticed the owner names are missing.
4) Opened the CSV in Excel and deleted the last column since it is unsupported.
5) Saved and closed the CSV
6) Added the CSV to the map
7) I had some problems on my join until I renamed the PARCEL field in Excel to PARCELID.  Then my join seemed to work properly.
8) Exported my join out to the Results.gdb as Parcels_Join
9) Selected the key parcel by attribute and exported it as Zuko_Parcel to the Results.gdb
10) Did a select by location to choose all the parcels that intersected our parcel.  Answered Q10
11) Exported these out as ADJ_Parcels
12) Added the zoning feature class
13) Clipped the zoning feature class to the adjacent parcels
14) Created the Parcels_Zone feature class by using the Intersect tool
15) Anseered Q11
16) Added a MAPKEY Field to the table and set it to be the same value as the OBJECTID_1 field
17) Having a problem because when I intersect the Adjacent Parcels and the Zoning, I end up with 25 features instead of 9.   Most of the excess are small slivers where the polygons don’t quite match up.
18) I was able to get around this in an unusual way.   I created a JOIN on my Adjacent Parcels with the Parcels_Zone feature class using the MAPKEY field.   This gave me the ZONING info I needed.   Not sure if this was the best approach overall, but it worked in this case.
19) Update, it didn’t work in this case.   The zoning appears to be wrong
20) I finally had to move past this problem by setting a tolerance of 5 feet which returned 10 records (Two for parcel 9)    I deleted the smaller of these parcels to get down to my count of 9.    Still not sure why this was the case, but needed to move on.
21) Added all my required map elements to prepare for deliverable
OBJECTIVE 3:
1) Saved the MXD as Zoning_DDP to start next section
2) Ran the Grid Index Features from the Data Driven Pages part of the Cartography Tools and got my 24 results
3) Ran the Select by location to weed these indexes down to 12
4) Exported these records out to a Zoning_Index table
5) Added my zone descriptions to the table
6) Created a new Data Frame to separate the index from the content
7) Added the Data Driven Pages toolbar
8) Ran the Data Driven Pages Setup wizard
9) Added the Page number Dynamic Text
10) Added the locator map and set the properties to see which section we are currently working on.
11) Added dynamic text for a few fields
12) Added my Required Map Elements
13) Exported out to a PDF for all 24 pages.
14) I noticed that it changed the settings on my scale bare from .1 to .11 which I don’t like.   Not sure how to fix this problem unfortunately.   I look at my original document and it still shows .1

Sunday, July 8, 2012

Urban Planning - GIS for Local Government: Participation Assignment

Part I - Research Local Property Appraisal Services

Q1:  Suwannee County Florida has a Property appraiser site at:  http://www.suwanneepa.com/

Q2: Due to the recent flooding and the limitations of a smaller staff, they most recent historical data seems to be March 2012 (For the month of February) rather than June.    The highest selling point of a property was $ 756,000.    The previous sales price was for $1,000,000 in 2005

Q3: The assessed land value is $201,480   You can click on the Tax estimator to see that the taxes are all paid up (and pretty reasonable)


Q4: It is interesting to see the decline in price since 2005.   I also don’t understand enough about how the Taxable values work.   Even though the property still sold for over 3 quarters of a million dollars, the “Land Value” s only at $201,480 and the “Taxable” value is at $24,039.


Part II - Mapping Assessment Values

Here is my map for this participation assignment:


Question 1:

The beauty of this method of showing parcels is that you can see several parcels that stand out from the rest.    If I had this data in front of me, my first wuestion would be about the blue and green parcels.   You mentioned in the assignment that these are lands that are not available for development.    After ruling those out, by next question would be on :
  • Yellow Parcel: Ref No 071S312000001001  - Whis is the land value only $24,700 ?
  • Red Parcel: Ref No 071S312000013001 – Why is ths land value $33,250 ?
  • Shouldn’t they match the majority of the other parcels which value at $27,075 ?
  • After I answered the question on these, I would look at all the parcels that were light orange (5 of them).  Why is their value $24,983 vs the $27,075 of the majority of the neighborhood.
There may be a very good answer for these questions, but the point of the exercise is to show how it makes the review process much easier.

Saturday, July 7, 2012

Module 05 - Debugging and Troubleshooting Python Scripts 

Summary:
I found this week’s assignment to have a lot of relevance in the “real world”.    The majority of the code you write will not work properly the first time you run it.   This is where your ability to debug and correct the course of the program is your most valuable asset.  
This week we learned several valuable skills towards that goal:
·         Benefits of using IDLE or PythonWin in different situations to improve debugging.
·         Identifying some of the most common errors and how to troubleshoot them.
·         The importance of indentation (and the difficulty in tracking down bugs related to indentation)
·         How to use the Alt-G command to jump to a specific line number to debug (very useful!!!)
·         How to use PDB to see behind the scenes.
·         How to use breakpoints and watches to better understand what is going on in your program.
·         How to understand the error messages that ArcGIS will display.
·         The use of some arcpy funtions like GetMessageCount() and GetMessages()
·         How to use Python to Programmatically buffer a point using the Geoprocessing tools.
I think you could attend an entire semester on this phase of the programming process and still not know all there is to know.   I have found that the ability to debug code is one of the most important skills you have as a programming professional.   It gets even more difficult when you have to debug code that someone else wrote.  
I picked up a couple of good books that might help the people in this class learn a bit more about ModelBuilder and Python.
They are :
Getting to Know ArcGIS ModelBuilder – by David W. Allen  ISBN-10: 1589482557

And
A Python Primer for ArcGIS by Nathan Jennings -  ISBN-10: 146627459X

In particular, I really like the David W. Allen Book.

Wednesday, July 4, 2012

Homeland Security: Protect

Our assignment this week was to make several maps concerning the security of the NORAD facility.  We were also asked to post one of our maps here with a brief description:

This is my map for the Heliport location near the facility.

Here are some key steps from the Process Summary:

III. Site surveillance Locations around Critical Infrastructure
i. Generate Hillshade
1. Created a new MXD
2. Turned on the 3D Analyst Extension
3. Turned on the 3D Analyst Toolbar
4. Added the Elevation DEM
5. Ran the Hillshade 3d tool with Azimuth 270 and Altitude 39
6. Added the Orthoimagery data layer and set the transparency to 60%
7. Saved the MXD
8. Launched ArcCatalog
9. Created the DJ_Surveil_pts shapefile
10. Added to my MXD
11. Change symbology to a 12 point red triangle
12. Restored the Orthoimagery transparency to 0
13. Started editing the DJ_Surveil_pts shapefile
14. Added about 13 points to the MXD and saved edits
15. Saved the Map
ii. Generate Viewshed
1. Selected Elevation in the 3D Analyst Toolbar
2. Zoomed to the extent of the DEM and turned off the Orthoimagery
3. Set the input raster to the DEM, and the DJ_Surveil_pts shapefile as the observer features
4. After the viewshed ran, set the transparency level on it to 50%
5. Turned on the Orthoimagery and zoomed to its extent
6. Mode of my imagery was covered by a green area which meant line of site was good.
7. Added a field to the shapefile called OFFSETA
8. Edited the shapefile and used the calc tool to set this new value to 10 for all 13 points.
9. Ran the new viewshed to DJ_viewshed10
10. You can see with this new viewshed that more area is available to see.
iii. Create line of sight
1. Turned off all layers except viewshed10, Surveil points, and Orthoimagery
2. Created several line of site points
3. Saved my map
4. Selected one of my lines of sight elements and used the “Create Profile Graph” to show the line of sight
5. Changed my titles on my graph
6. Exported graph and added it to the layout to produce my next deliverable.

v. View 3D line of sight
1. Started ArcScene
2. Added the elevation data
3. Added the Orthoimagery data
4. Opened the Base Heights tab
5. Set to “Floating on a custom surface” and chose the DEM
6. Zoomed to the extent of the OrthoImagery.    A little slow give the remote connection but VERY cool !
7. Went back to ArcMap without closing ArcScene
8. Copied and pasted my line of sight to get a 3D view of the visibility data that we generated.
9. Exported out to JPG
10. Started cleaning up my deliverables for submittal