Hot answers tagged

3

It appears you're mixing the syntax of the old arcpy.UpdateCursor() with the newer arcpy.da.UpdateCursor(). Try changing your cursor to be something like: updateFields = ["R_value", "G_value", "B_value", "C_value", "M_value", "Y_value", "K_value"] with arcpy.da.UpdateCursor(newtable, updateFields, query) as rows: for row in rows: row[0] = r ...


3

If you're on 10.1 or greater, I would go with KHibma's comment. If you're pre-10.0 (btw, please put the version you're using in your tags), simply add these two lines: import os scratchGDB = os.path.join(scratchWorkspace, 'scratchGDB.gdb') instead of your current scratchGDB assignment. This assigns the full path that you want, so that you don't have to ...


3

Python/ArcPy for ArcGIS Pro 1.3 is now installed in C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\ So your IDE needs to be pointed at that environment to pick up the link to arcpy. In Visual Studio open the Python Environments window, click "+ Custom..." and select "Configure". Give the new environment a name e.g. Python 64-bit 3.5 ArcPy and ...


2

Because you have 42 tiles of 800,000 point you have more data than a TIN can hold-you will need to build and populate a Terrain. Using the tools available in the 3D Analyst toolbox-construct an ESRI Terrain dataset , populate the Terrain with your point data, then use the contour tool to construct 1 ft contours. Here is a link to working with Terrains in 10....


2

As @ahmadhanb said in a comment, you need to replace the hyphen - with an underscore _ for the shapefile. # Get shapefile name and replace hyphen with underscore shpfile = os.path.splitext(csvfile)[0].replace('-','_') arcpy.CopyFeatures_management(outlayer,shpfile) In your updated question you have re-added your code which has an ...


1

1) You could try to convert your ascii files to rasters: import arcpy,os,re from arcpy import env from arcpy.sa import * arcpy.CheckOutExtension("Spatial") arcpy.env.workspace = (r"<where ascii files are">) out_dir = (r"<Where you want them to go>") asciilist = arcpy.ListDatasets("*","ASCII") count = 1 for ascii in asciilist: ...


1

You're going to want to log into the ArcGIS Server manager -> Site -> Data Store -> Register Folder. Register the folder where your data is contained, publisher path is the location on your box, server path is the location on the server.


1

ERROR 001487: Failed to update the published service with the server-side data location. Please see the server's log for more details. It looks like the map data you are trying to publish is in a location where the server cannot access it. Check with your GIS admin to see if you have a data store set up, or if the map data needs to be in a special ...


1

You should concatenate newpath and newfeatureclass with os.path.join(): ... mxd.findAndReplaceWorkspacePaths(oldpath, os.path.join(newpath, newfeatureclass)) ...


1

Gets a list of all layers and selects the features in them that intersect the building layer. Skips the building layer so it doesn't select itself. import arcpy mxd = arcpy.mapping.MapDocument("CURRENT") bldgLayer = "building layer" # Enter the name of your building layer here layers = arcpy.mapping.ListLayers(mxd) for layer in layers: if layer.name != ...


1

Looks like you want to use the first value in a field to rename the output feature class. I would use the feature class as an input rather than whatever C_parameters is. You can just make the input a user defined parameter and they can choose which input to use. Also set Field as a parameter to allow the user to choose which field this will work on. Copy ...


1

I managed to get the insert cursor to work using arcpy.insertcursor... import arcpy arcpy.env.workspace = r"D:\Zahir\AIS\Raw_AIS_Data\2013\Test\\" gdblist = arcpy.ListWorkspaces() table = arcpy.CreateTable_management("D:\Zahir\AIS\Raw_AIS_Data\Test\\", "Table.dbf") arcpy.AddField_management(table, "Name", "TEXT") arcpy.AddField_management(table, "PosCount", ...



Only top voted, non community-wiki answers of a minimum length are eligible