|
POST
|
Update, the issue seems to be on machines having the Background 64-bit GeoProcessing patch installed.
... View more
08-10-2018
01:52 PM
|
0
|
0
|
1129
|
|
POST
|
I am trying to implement a Python routine to update a Map Tile Package that will be used for offline map downloads with Lattitude Geographics GeoCortex product. The code snippet below was an output from Model Builder. The model ran successfully and updated the TPK. When running in Python, the generic error code appears (which isn't helpful): ERROR 999999: Error executing function. Failed to execute (CreateMapTilePackage). Looking for insight to see if anyone else has had this problem. Some troubleshooting I have done without different results: - Run the model from within Python calling the model from a toolbox - Change file paths for invalid characters - Tried another machine I am on ArcGIS Desktop 10.3.1 on a Windows 8.1 system and Python version is 2.7.8. import arcpy, os
arcpy.env.overwriteOutput = True
# Process: Create Map Tile Package
arcpy.CreateMapTilePackage_management("C:\\Path\\To\\MXDtoBeUsed.mxd", "ONLINE", "C:\\Path\\To\\TPKtobeUsed.tpk", "PNG", "4", "", "TPKforGMAF", "Basemap")
... View more
08-09-2018
12:00 PM
|
0
|
1
|
1343
|
|
POST
|
I have several features that I have queried out in my RBJ files that are returned from an invalid geometry data reviewer check. These features do have invalid geometry, but it is intentional and I want them filtered out of the reviewer results table. When I run the RBJ files inside of a review session in ArcMap 10.3.1, 0 results are returned which is expected. This is after I turn off the Invalid Geometry Check in the Default Checks tab in the Reviewer Session Manager. I cannot find any documentation on how to turn this off when creating a python file from it, as the same RBJ file is referenced in my script but it still returns invalid geometry that I do not want to be returned. # Comments
arcpy.AddMessage("Checkout DR Extension..." +'\n')
txtFile.write("Checkout DR Extension..." +'\n')
# Process: Checkout DR Extension
arcpy.CheckOutExtension("datareviewer")
# Comments
arcpy.AddMessage("Checkout DR Extension Complete..." +'\n')
txtFile.write("Checkout DR Extension Complete..." +'\n')
txtFile.write("..." + '\n')
# Comments
arcpy.AddMessage("Enable Data Reviewer in GDB..." +'\n')
txtFile.write("Enable Data Reviewer in GDB..." +'\n')
# Process: Enable Data Reviewer
arcpy.EnableDataReviewer_Reviewer("Z:\\GIS_Maintenance\\DataReviewer\\Data\\Server\\DataReviewerParks.gdb", "PROJCS['NAD_1983_HARN_StatePlane_Oregon_North_FIPS_3601',GEOGCS['GCS_North_American_1983_HARN',DATUM['D_North_American_1983_HARN',SPHEROID['GRS_1980',6378137.0,298.257222101]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]],PROJECTION['Lambert_Conformal_Conic'],PARAMETER['False_Easting',8202099.737532808],PARAMETER['False_Northing',0.0],PARAMETER['Central_Meridian',-120.5],PARAMETER['Standard_Parallel_1',44.33333333333334],PARAMETER['Standard_Parallel_2',46.0],PARAMETER['Latitude_Of_Origin',43.66666666666666],UNIT['Foot',0.3048]];-111333600 -98152500 3048;-100000 10000;-100000 10000;3.28083989501312E-03;0.001;0.001;IsHighPrecision", "", "")
# Comments
arcpy.AddMessage("Enable Data Reviewer in GDB complete..." +'\n')
txtFile.write("Enable Data Reviewer in GDB complete..." +'\n')
txtFile.write("..." + '\n')
# Comments
arcpy.AddMessage("Creating Reviewer Session..." +'\n')
txtFile.write("Creating Reviewer Session..." +'\n')
# Process: Create Reviewer Session
arcpy.CreateReviewerSession_Reviewer("Z:\\GIS_Maintenance\\DataReviewer\\Data\\Server\\DataReviewerParks.gdb", "ParksReviewChecks", "")
# Comments
arcpy.AddMessage("Creating Reviewer Session Complete..." +'\n')
txtFile.write("Creating Reviewer Session Complete..." +'\n')
txtFile.write("..." + '\n')
# Comments
arcpy.AddMessage("Executing Parks Reviewer Batch Job Files..." +'\n')
txtFile.write("Executing Parks Reviewer Batch Job Files..." +'\n')
# Process: Execute Reviewer Batch Job
arcpy.AddMessage("Executing Parks Review Checks.rbj..." +'\n')
txtFile.write("Executing Parks Review Checks.rbj..." +'\n')
arcpy.ExecuteReviewerBatchJob_Reviewer("Z:\\GIS_Maintenance\\DataReviewer\\Data\\Server\\DataReviewerParks.gdb", "Session 1 : ParksReviewChecks", "Z:\\GIS_Maintenance\\DataReviewer\\RBJ\\Parks Review Checks\\Parks Review Checks.rbj", "Database Connections\\Server Production gis_reader.sde", "", "ALL_FEATURES", "")
# Comments
arcpy.AddMessage("Executing Parks Reviewer Batch Job Files Complete..." +'\n')
txtFile.write("Executing Parks Reviewer Batch Job Files Complete..." +'\n')
txtFile.write("..." + '\n')
... View more
07-03-2018
02:57 PM
|
0
|
0
|
732
|
|
POST
|
I have about 30 feature classes in an FGDB. I am looking for a script to remove all attribute indexes, as I will need to do this for multiple FGDBs eventually. My file path is: "M:\\GIS_Data\\FileGeoDBs\Parks.gdb" I started with this article Remove all attribute indexes using arcpy But got stuck at line 02 dsc = arcpy.Describe("sap")
... View more
06-29-2018
11:59 AM
|
0
|
2
|
1283
|
|
POST
|
I have referenced this article Writing conditional (if/then) statements into Field Calculator of ArcGIS for Desktop using Python parser? - Geographic I… I am trying to update values in a field using 'elif' statements in Field Calculator with the Python radio button selected. The set is as: Code Block: def Reclass(Density_18):
if (Density_18 <= .8493):
return 1
elif (Density_18 >.8493 and Density_18 <=1.761):
return 2
elif (Density_18 >1.761 and Density_18 <=2.345):
return 3
elif (Density_18 >2.345 and Density_18 <=3.399):
return 4
elif (Density_18 >3.399):
return 5 Expression: Reclass( !Index_18!) When this expression is performed, it calculates all the values as '1', then the next time it is run all values are '2', so on until it maxes out and repeats at '5' in the Index_18 field.
... View more
06-11-2018
03:43 PM
|
0
|
1
|
2647
|
|
POST
|
Researching to see if there is a way to use Python to export multiple tables in a File Geodatabase to a single Excel file. I would like for each sheet name to have the same name as the table. My current situation is that I ran a Python script to take all the domains a GDB and create a table within the GDB. The article referenced from: https://community.esri.com/thread/163889 def main():
import arcpy, os
gdb = r"Z:\GIS_Projects\zUpdatesBrian\Scripts\ListDomains\ListDomains.gdb"
arcpy.env.overwriteOutput = True
for dom in arcpy.da.ListDomains(gdb):
if dom.domainType == 'CodedValue':
arcpy.DomainToTable_management(in_workspace=gdb,
domain_name=dom.name,
out_table=os.path.join(gdb, dom.name),
code_field="item",
description_field="descrip",
configuration_keyword="")
print " - domain '{0}' of type '{1}' exported to table".format(dom.name, dom.domainType)
else:
print " - domain '{0}' of type '{1}' skipped".format(dom.name, dom.domainType)
if __name__ == '__main__':
main()
... View more
05-16-2018
09:05 AM
|
0
|
11
|
7479
|
|
POST
|
I received a table of data, and in that table is a field with latitude and longitude coordinates in one field. An example is: 45.4000/-122.700 I added two fields, latitude and longitude. Using field calculator I can successfully extract values after the '/' into the longitude field so that it is populated only with -122.700. The expression is: !Latitude_Longitude![!Latitude_Longitude!.rindex('/')+1:] I am not able to extract the values for latitude so that the latitude field will be populated just with 45.4000. I can also not perform this by using an exact number of characters, as the table of coordinates can have anywhere from 2 to 5 decimal places. Any help on how to extract all values to the left of the '/' would be appreciated.
... View more
05-09-2018
03:49 PM
|
0
|
1
|
1401
|
|
POST
|
This was not resolved as our project decided to export PDFs manually instead of via Python. This is because the number of pages per each location relates to the number of stories at a building, which involves exporting PDF for floor 1, checking off floor 1 and checking on floor 2, exporting, so on.
... View more
04-19-2018
02:17 PM
|
0
|
0
|
1584
|
|
POST
|
In several MXDs, I have symbology displayed based on a rotation field. In each MXD, I rotate the data frame based on the site plan. When I export to a PDF within ArcMap, the symbols stay rotated as they should. I have already gone into ArcMap Advanced Settings Utility and checked off Rotate marker symbols with dataframe. Sample when exporting to PDF from ArcMap: When I use arcpy.mapping.ExportToPDF, the PDF exports correctly, but it will not honor the rotation. I would like to use Python because I have several dozen MXDs that will be updated on a monthly basis. Sample when using arcpy.mapping.ExportToPDF Sample Code: import arcpy, os
folderPath = r"J:\GIS\PrePlans"
for filename in os.listdir(folderPath):
fullpath = os.path.join(folderPath, filename)
if os.path.isfile(fullpath):
basename, extension = os.path.splitext(fullpath)
if extension.lower() == ".mxd":
mxd = arcpy.mapping.MapDocument(fullpath)
mapPath = mxd.filePath
fileName = os.path.basename(mapPath)
print "Exporting " + fileName
txtFile.write("Exported " + fileName +'\n')
arcpy.mapping.ExportToPDF(mxd, basename + '.pdf')
... View more
01-12-2018
02:32 PM
|
0
|
5
|
1985
|
|
POST
|
From a prior posting here, I was looking for a solution on how to turn the relative path on in batch. The solution generated will grab any MXD in a root folder and enable the relative paths to be turned on in any sub folder using this code: import os
from glob import glob
import arcpy
PATH = r'C:\Users\mclbr\Desktop\GIS_Maintenance'
arcpy.env.workspace = PATH
result = [y for x in os.walk(PATH) for y in glob(os.path.join(x[0], '*.mxd'))]
for map in result: # map will be complete path to map file
print "Processing: {}".format(map) # keep track of what's happening
mxd = arcpy.mapping.MapDocument(map)
#set relative paths property
mxd.relativePaths = True
#save map document change
mxd.save() One issue that I have come across is that we have users on 10.2.2 and users on 10.3.1. The code above works on 10.3.1, but when run it updates all 10.2.2 MXDs to 10.3.1. The other issue is that when run on a 10.2.2 machine, the script will fail once it reaches an MXD that was last saved in 10.3.1. I am taking a shot in the dark, but would anyone know of a way to create code that will only select versions of ArcGIS Desktop for version 10.2.x, then one for 10.3.x? If that is possible, I would run the routine on a 10.3.1 machine and insert the code to only update MXDs that are a 10.3.1 document, and do the same for the 10.2.2 machine and documents.
... View more
12-01-2017
11:48 AM
|
0
|
3
|
1659
|
|
POST
|
So combined code would be: import os
import arcpy, os
from glob import glob
PATH = r'C:\Users\mclbr\Desktop\GIS_Maintenance'
result = [y for x in os.walk(PATH) for y in glob(os.path.join(x[0], '*.mxd'))]
for mxd in result:
print mxd # continue here with processing your files
import arcpy, os
#workspace to search for MXDs
Workspace = r"C:\Users\mclbr\Desktop\GIS_Maintenance"
arcpy.env.workspace = Workspace
#list map documents in folder
mxdList = arcpy.ListFiles("*.mxd")
#set relative path setting for each MXD in list.
for file in mxdList:
#set map document to change
result = os.path.join(Workspace, file)
mxd = arcpy.mapping.MapDocument(filePath)
#set relative paths property
mxd.relativePaths = True
#save map doucment change
mxd.save()
... View more
11-29-2017
03:22 PM
|
0
|
2
|
1920
|
|
POST
|
I have a series of strings that I need to eliminate a series of text. The text can be variable in length, so doing any trim or strip functions will not work. The string is: <img src="X:\UB_Routing\images\ServiceOrders\150 E MAIN ST.png"><br>150 E MAIN ST or <img src="X:\UB_Routing\images\ServiceOrders\3207 SE ROSESPRING DR.png"><br>3207 SE ROSESPRING DR As a few examples, but they can be any address. I am looking for a Python field calculator solution to remove everything before and including the value of <br> From the examples above, the only values left would be: 150 E MAIN ST 3207 SE ROSESPRING DR
... View more
11-29-2017
01:13 PM
|
0
|
5
|
20918
|
|
POST
|
I am trying to find a way to set relative paths in MXDs using Python for several sub folders within a main folder. Using this Tech Support article, it allows it to be done on MXDs in the folder listed as the workspace. What I am looking for is not only the folder listed in the workspace, but MXDs that exist in subfolders. The goal would be for the Python to open all MXDs under the parent folder and subfolder, check on Set Relative Path Name, Save and Close MXD.
... View more
11-29-2017
10:57 AM
|
0
|
4
|
2513
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | Wednesday | |
| 1 | a month ago | |
| 1 | Monday | |
| 1 | a week ago | |
| 1 | a week ago |
| Online Status |
Online
|
| Date Last Visited |
3 hours ago
|