Skip to main content

Working with Geometries

 This week I learned about working with geometries in Arcpy; how to read, write, and work with multipart features. We began by setting our workspace and utilizing a cursor in order to create a new txt file, and write data into it from the rivers.shp. Below is a short summary of the steps I took: 

  1. Import arcpy
  2. from arcpy import env
    1. set workspace
    2. set overwrite
    3. set outpath
  3. define variable for river.shp
  4. create txt (rivers_ESG.txt)
  5. create search cursor
  6. set variables for OID, NAME, and vID to be able to call upon them
  7. set first for loop in cursor
    1. vID + = 1
    2. set second loop in row[1]
      1. set third for point in part
        1. print OID, vID, coordinates x,y, NAME
        2. output.write (same as above) to add to text file
I encountered one main issue, and that was how to print everything. Looking back at the past lessons, I saw that I had to call upon the .format( ). However,  this function did not work for printing the names. After connecting with my peers, they suggested using simply row[2].  This worked but did not make sense to me until they explained that it represeted the field 2 in the search cursor! Genius! :) 

Below are the script outputs for the final script and a snip of the newly created txt file. 










Comments

Popular posts from this blog

Positional Accuracy: NSSDA

 In this analysis, I compared the street and road intersect data collected for Alburquerque, NM by the City of Alburquerque and the application StreetMaps. I used an orthophoto base layer as the reference for this analysis, to compare and determine the accuracy of both the City and Streetmap layers using NSSDA procedures. The most difficult part of this analysis for me was how to determine what 20% per quadrant looks like. Because the reference map was divided into 208 quadrants, I had to determine how to subdivide all the quadrant's equality into 20%. After multiple trials and error, I decided to subdivide the entire area (208 sub-quadrants) into 4 equal-area subsections. In this way, I could do 5 random right intersection points per subsection or 20% per subsection.  Map 1: City of Albuquerque city map data.  Map 2: City of Alburquerque SteetMap data When selecting a random intersection to place the points within each quadrant, I choose a location that had data f...

Isarithmic Mapping

  Map 1: Annual Precipitation, Washington State Map 1 is an Isarithmic map that follows the continuous phenomenon of rainfall in Washington state over a 30 year period. The data was created by the PRISM group at the Oregon State University in 2006, and then downloaded and amended by the U.S. Department of Agriculture, Natural Resources Conservation Service, National Geospatial Management Center in 2012. Eden Santiago Gomez, analyzed the data on 5/2/2021, to create the map above. Santiago Gomez created continuous tones for the data, also adding a hillshade effect. She then converted the floating raster data into Integer data via the geoprocessing tool Int (Spatial Analyst Tool) to bring out hypsometric tinting. Lastly, she added contours of the data via the Contour List tool.   How the precipitation data was derived and interpolated? The PRISM system has been continually developed over the past couple decades, utilizing physiographical maps and climate fingerprints as its ...

Supervised Classification

 This week we learned how to perform supervised and unsupervised classification on ERDAS Imagine. On the figure 1 map below, you can see my attempt at classifying land use/cover of Germantown, Maryland. This week my map falls short of the assignment goals, as I was not able to get ArcGIS pro to replicate the recoded feature classification outputs I performed in ERDAS. I am not sure what I did wrong, but in the future, I will make sure to analyze signature points more carefully via their histograms and mean plots to identify potential errors.  Figure 1: Supervised classification of Germantown, Maryland with a smaller distance map of the main feature map.