Sunday, September 3, 2023

GIS Internship 1

     This semester I am tasked with finding an internship in the GIS community to further develop my skills and abilities in GIS. As of writing this the teacher advisor for the course Ms. Bloechle is helping me find an internship by emailing people, she knows around the area that might have an available spot for me. Two places she said might be available are the Escambia County GIS Manager and SRC. I have also on my end tried to reach out or find connections to get myself an internship but have had no luck with either no response or they have no positions open/available. As a backup plan in case, I cannot find or acquire and internship, I will join group 2 and work through the virtual campus on ESRI to complete my internship requirements. The GIS user group I was invited to join was the Northwest Florida GIS User Group. I am excited to learn and maybe get involved in the group to further my knowledge in GIS and learn more about the Northwest Florida area.

Monday, June 26, 2023

Module 6: Working with Geometries

 Module 6: Working with Geometries

For this weeks lab we were assigned to write a script that creates a TXT file and write to it the coordinates and object IDs for vertices in a shapefile. My script created a new TXT file called rivers_bat33.txt. The script I wrote writes to the txt file, point data for all vertices (0-25 features, total of 247 vertices). Each point has the following information: Feature OID, Vertex ID, X coordinate, Y coordinate, Name of the river feature.

Below are screen shots of the txt file showing all the requirements for the lab showing: Feature OID, Vertex ID, X coordinate, Y coordinate, Name of the river feature.








The flow chart for the script I created is shown below. I don't know if my nested for loop is correct as I didn't know how to correctly show the other outcome.

Notes:
  •  Points, polylines, and polygons are geometry objects. Working with geometry objects and their properties by setting a cursor on shape field of a feature class. You can work with the full geometry object including all its properties such as length area, but you can also use geometry tokens (SHAPE@XY) as shortcuts to specific properties.

  •  Reading geometries can be accomplished using search cursor. Specific approaches are necessary to read the properties of multipart features and polygons with holes.

  •  The spatial reference can be set on cursors to work with geometries in a coordinate system that is different from that of the feature class.





Wednesday, June 21, 2023

Module 5 Assignment: Exploring & Manipulating Data

Module 5: Exploring and Manipulating Data

At the top of image 1 it displays that my code to create the new fGDB file was successful.
The lines after "Iterating over list" is copying the data files to the new fGDB to be used their. The next lines after that begin the cursor search to find cities that have a county seat and their population in 2000. The first 3 cities are listed in image 1 and continue to the bottom of image 3.



I currently do not have a flowchart and plan to finish the last step of lab later this week with Dr. Morgan. (Will update when I have completed.)

Notes:
-Del row needs to be under the loop.
-CreateFileGDB_management creates a new geodatabase
-Search cursors are used to search records and carry out SQL expressions.
-Update cursors are used to make changes to existing records, while insert cursors are used to add new records, delete cursors delete records.


 

Tuesday, June 6, 2023

Module 4: Geoprocessing

 Module 4: Geoprocessing


The image above displays that my script Mod4_BTims.py is working. The first step the code does is print out the "Adding XY coordinates to the shapefile...", it adds the XY points for the hospitals shapefile. It also prints the messages out from interpreter from when the code started and finishes, using GetMessages(). 
The next line of code executes a buffer analysis on the shapefile hospitalsXYpts.shp. The buffer extends to 1000 meters around the hospitals XY coordinates and also dissolves the hospital buffers into a single-feature layer. This line of code also uses the GetMessages() to get the start and end time of the code from the interpreter.

Process Summary Notes:

-It is recommended to use arcpy.env.workspace instead of from arcpy import env followed by  env.workspace.

-arcpy.<class>.<property>

-arcpy.<toolname>_<toolboxalias>(<parameters>)

-You can use the "\n" character to add a space after each message, making messages easier to read.


Monday, June 5, 2023

Module 3: Debugging and Error Handling


Module 3 Debugging and Error Handling


This image is showing that for the first template of code I have found the two errors in the code and now the code is running. The code prints out the names of each field in the park.shp file.

This image shows the code working for the code template 2. This code had several errors and exceptions that I had to find and adjust the code. One example of the errors I encountered was that the file path that the original code had was looking for the file in the wrong file location and I had to locate where the file was in my files and correct that. This code prints out a list of layers for each data frame in the TravisCountyAustinTx.aprx.


This image shows the code running and working for the code template 3. This code we were told not to fix the errors, rather, we were supposed to use a try-except statement to trap the error and print out the error so that way the code wouldn't crash. The flowchart for how I setup the try-except statement is below to illustrate how the code would work if it encountered an exception or if there were no errors found it would print "Part A Successfully Completed". The code for template 3 prints out an error message in part A stating what the error is, part b prints the name, spatial reference, and scale for three data frames in the TravisCountyAustinTX.aprx.
Notes from this Module:
  • The try-except statement is like the if statement but can be more useful working over errors and handling them.
  • Error messages you receive in python can be very useful in figuring out where your code crashed, as well as, what the error type is. 
  • Using the ArcGIS website to see what useful features are already in python can be used in your code or even see if the feature is spelled wrong or if a letter is case sensitive. 




 

Wednesday, May 31, 2023

Module 2: Python Fundamentals


Module 2: Python Fundamentals

In the picture above, it shows the code I wrote for this module running and working. The first line displays my last name. The lines under that is a dice game from pre-written code that I had to figure out the two errors in the code in order for the game to work properly. It rolls some dice and lets you know if you win, lose, or tie. 

The list underneath the dice game in the first picture is a randomized list the spits out 20 random numbers between 0 and 10. The flow chart for this code is located in the picture above. The code for this only goes to the first instance of print(luckyList). The rest of the flow chart displays the rest of the code for the last list in the first picture. This code removes a chosen integer (I choose 7) and will print out how many times the chosen number will be removed from the list. It then prints out the new list with the chosen integer removed from the list.

Notes:

1         Import math and random should be at the top of code to work correctly.

2         Indexing is very useful to find certain words or letters in a statement.

3         Breaks can end loops when they reach certain conditions designated in your code.

4         Str(var)+, +str(var)+ is how to add strings to statements that hold variables.


Wednesday, May 24, 2023

Module 1


 The output for 3 radians to degrees is 171.9745222929936 degrees.

My interpretation of Zen python by Tim Peters:
These are the principles of python by Tim Peters. Code needs to be easy to read. Your code needs to be understandable to someone who knows nothing about your program. Don’t overcomplicate your code. Keep your code as simple and readable as possible, even when working with complex problems. Stick to a flat code structure with minimal nesting. It’s preferable to have several easy-to-follow lines of code than a dense one-liner. In Python, there are lots of best practices that make your code more readable for other programmers follow these practices instead of doing it your way. If it’s more practical to solve a problem “your way” and it keeps code readable and easy-to-follow, you may sometimes deviate from established best practices. Deal with errors when they occur rather than letting them silently pass by, not dealing with errors could lead to bigger issues (unless you explicitly silenced the error). Apply critical thinking to understand the problem and then find an appropriate solution. If you can’t explain the implementation of your code to friends or coworkers it’s a bad code and probably over complicated the code. If you can easily explain the implementation of your code to friends and coworkers the code might be good. In Python, you can have isolated namespaces or a collection of names that allow each and every object in your program to have a unique name. Namespaces create a system where names in one of your modules are not conflicting with names in another making them very useful.

Process Summary Notes:
  • CreateModFolders.py script creates 6 module folders each containing sub folders data, script, and results for this class to keep folders organized. (I ran it accidentally before starting the lab and noticed the folders before I started and just figured UWF added them to my folder somehow, but after reading through the lab I realized that it was me.)
  • Print(“hello world”)- to print words you need “__” . 
  • Print (sum)- variables do not need “__”
  •  Flowcharts use certain symbols for each process of your code. 
  • Pi is not known by computer so you must assign its value first before assuming the program knows pi.

Module 7 Google Earth

 Google Earth For this week's lab we were tasked with creating a dot density map of south Florida in Google Earth. The map also includes...