Skip to content

Commit

Permalink
Minor updates
Browse files Browse the repository at this point in the history
  • Loading branch information
ArcGISLocalGov committed Apr 16, 2015
1 parent 61ab91c commit 650e7d0
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 17 deletions.
19 changes: 11 additions & 8 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 16 additions & 9 deletions loadphotopoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
Parcels = arcpy.GetParameterAsText(4)
ParcelPIN = arcpy.GetParameterAsText(5)

arcpy.AddMessage("Step 1: Loading input parameters")
arcpy.AddMessage("Step 1: Loading input parameters")

# ______________________________________________________________________________#
#
Expand All @@ -39,14 +39,14 @@
arcpy.Project_management(PhotoFeatureClass, PhotoFeatureClass2, SRHelper)
arcpy.Delete_management(PhotoFeatureClass)

arcpy.AddMessage("Step 2: Converting Photos to points")
arcpy.AddMessage("Step 2: Converting Photos to points")

# Load up the parcel dataset for the property association (and make a copy)

ParcelsFeatureClass = """{}\\Parcels""".format(Geodatabase)
arcpy.CopyFeatures_management(Parcels, ParcelsFeatureClass)

arcpy.AddMessage("Step 3: Copying Parcels to staging geodatabase")
arcpy.AddMessage("Step 3: Copying Parcels to staging geodatabase")

# Snap Passenger Photos to nearest parcel edge (30ft. default)

Expand Down Expand Up @@ -79,15 +79,15 @@ def shift_photopoints(in_features, x_shift=None, y_shift=None):
arcpy.GenerateNearTable_analysis(PhotoFeatureClass2, ParcelsFeatureClass, NEAR,
"5 Feet", "NO_LOCATION", "NO_ANGLE", "CLOSEST", "0", "GEODESIC")

arcpy.AddMessage("Step 4: Associating passenger photo points to nearest parcel")
arcpy.AddMessage("Step 4: Associating passenger photo points to nearest parcel")

arcpy.JoinField_management(NEAR, "NEAR_FID", ParcelsFeatureClass, "OBJECTID", ParcelPIN)

# Export non-matched Photos to table (no GPS, wrong attributes, etc.)

arcpy.JoinField_management(PhotoFeatureClass2, "OBJECTID", NEAR, "IN_FID")
arcpy.TableToTable_conversion(PhotoFeatureClass2, Geodatabase, "NonMatchedPassengerPhotos", "PIN is Null", "")
arcpy.AddMessage("Step 5: Reporting non-matched passenger photos to table")
arcpy.AddMessage("Step 5: Reporting non-matched passenger photos to table")

# Delete non-matched photo points

Expand Down Expand Up @@ -150,14 +150,14 @@ def shift_photopoints(in_features, x_shift=None, y_shift=None):
NEAR = Nearhelper
arcpy.GenerateNearTable_analysis(PhotoFeatureClass3, ParcelsFeatureClass, NEAR,
"5 Feet", "NO_LOCATION", "NO_ANGLE", "CLOSEST", "0", "GEODESIC")
arcpy.AddMessage("Step 6: Associating driver photo points to nearest parcel")
arcpy.AddMessage("Step 6: Associating driver photo points to nearest parcel")
arcpy.JoinField_management(NEAR, "NEAR_FID", ParcelsFeatureClass, "OBJECTID", ParcelPIN)

# Export non-matched Photos to table (no GPS, wrong attributes, etc.)

arcpy.JoinField_management(PhotoFeatureClass3, "OBJECTID", NEAR, "IN_FID")
arcpy.TableToTable_conversion(PhotoFeatureClass3, Geodatabase, "NonMatchedDriverPhotos", "PIN is Null", "")
arcpy.AddMessage("Step 7: Reporting non-matched driver photos to table")
arcpy.AddMessage("Step 7: Reporting non-matched driver photos to table")

# Delete non-matched photos

Expand Down Expand Up @@ -185,7 +185,7 @@ def shift_photopoints(in_features, x_shift=None, y_shift=None):
arcpy.FeatureToPoint_management(ParcelsFeatureClass, ParcelPointHelper, "INSIDE")
arcpy.EnableAttachments_management(ParcelPointHelper)
arcpy.AddAttachments_management(ParcelPointHelper, "PIN", PhotoFeatureClass3, "PIN", "Path2", "")
arcpy.AddMessage("Step 8: Creating photo attachments")
arcpy.AddMessage("Step 8: Creating photo attachments")

#______________________________________________________________________________#
#
Expand All @@ -195,7 +195,14 @@ def shift_photopoints(in_features, x_shift=None, y_shift=None):
arcpy.Delete_management(PhotoFeatureClass2)
arcpy.Delete_management(PhotoFeatureClass3)
arcpy.Delete_management(ParcelsFeatureClass)
arcpy.AddMessage("Step 9: Cleaning up staging geodatabase")
arcpy.DeleteField_management(ParcelPointHelper, "ORIG_FID")
arcpy.AddMessage("Step 9: Cleaning up staging geodatabase")

#______________________________________________________________________________#
#
# Adding Survey Fields
#______________________________________________________________________________#

arcpy.AddMessage("Step 10: Adding survey questions")
arcpy.CreateDomain_management(Geodatabase, "YesNoMaybe", "YesNoMaybe", "TEXT", "CODED")
DomainDict1 = {"Yes": "Yes", "No": "No", "Maybe": "Maybe"}
Expand Down

0 comments on commit 650e7d0

Please sign in to comment.