New answers tagged

1

Upgrade to 2.14.2. It's been fixed already.


0

Try unmatching the address first, it could already be matched. I've attached two screen grabs to show what I mean.


0

To sum up, this code works, as Michael helped: >>> arcpy.env.overwriteOutput = True fdList = ["Dataset_A", "Dataset_B", "Dataset_C"] folList = ["D:\\GIS_Temp\Folder A", "D:\\GIS_Temp\\Folder B", "D:\\GIS_Temp\\Folder C"] workRange = range(len(fdList)) for thisIndex in workRange: fd = fdList[thisIndex] arcpy.env.workspace = ...


1

This could work, based on answer Michael wrote, but there are still some problems: >>> fdList = ["Datase_A", "Dataset_B", "Dataset_C"] folList = ["D:\\GIS_Temp\Folder A", "D:\\GIS_Temp\\Folder B", "D:\\GIS_Temp\\Folder C"] workRange = range(len(fdList)) for thisIndex in workRange: fd = fdList[thisIndex] arcpy.env.workspace = ...


1

I suspect that your script is failing because the output already exists, to avoid this set overwrite to True, which is easier than check and delete, but may not be what you need in the long run. Putting together your scraps into a contiguous codeblock: # set overwrite = True so it won't crash if # the output already exists arcpy.env.overwriteOutput = True ...


0

Thanks and 1up for your idea, Ben S Nadler. Using the following function to import an blank metadata file does the trick for me. arcpy.ImportMetadata_conversion()


6

Use a dedicated FTP client (Filezilla, for example), and not your web browser (your screenshot looks like you're using a browser). Connecting to the FTP server with an actual FTP program will allow you to download the entire folder structure. As everyone points out in the comments, a geodatabase is just a folder with files inside, if you grab the entire .gdb ...


1

If you're interested in the current date, then the Calculate Value tool could be of use, along with some python. Below is the code that would return the current date as a string. In the Expression box, put this: getdate() In the code block, put the following: def getdate(): import datetime now = datetime.datetime.now() current_date = ...


0

I recently ran into this problem and was able to solve it by deleting the spatial index on the feature I was trying to edit. For reference I'm working with features in WGS84 (EPSG:4326).


0

The number of cores would not cause the crash (it would only make the process slower - also dependent on how good the processors are respectively), the amount of RAM usually causes the crash. I would think that your 4 core computer would also have more RAM on it. You also cannot estimate the exact amount of time it will take, but if you really want to, it ...


1

Consider testing against the workspace type property. In your calculate value tool (you only need one for this step), modify your code to look something like this: import os, arcpy def workspace_type(wkspace,fc_name): wt = arcpy.Describe(wkspace) if wt.workspaceType == "FileSystem": #folder return ...


0

The oid of the features in the feature layer generally match the 'rowid' so can be used incrementally. Long lenLayer = gvOC.geodatabaseFeatureTable.getNumberOfFeatures(); Long featureid; Geometry g; for (long i = 1; i <= lenLayer; i++) { Feature selectedFeature = gvOC.featureLayer.getFeature(i); featureid = selectedFeature.getId(); ...


4

The behaviour you describe is correct. All because you give a field a domain and set field to not allow NULLS does not mean that ArcMap will capture the fact they the user may not touch that field during editing. So when they save edits they can insert a nothing even though you have a domain. There are 2 routes here: Accept this odd behaviour then do some ...


2

I have slightly modified another script I had laying around which should do what you want, using Insert Cursors and Update Cursors. It does require you to specify the name of your unique ID field (can't be ObjectID). It also has no error checking (I didn't need it for what I was doing but as you're modifying SDE feature classes it may be wise to add some!) ...


1

Esri now has a tool for this in 10.4 (hooray): Recalculate Feature Class Extent. I was running into this issue when I was creating a feature class and writing geometry into it with arcpy. Apparently those tools do not update the extent (probably a good idea for performance reasons). I have been successful resetting the extent in 10.2.2 with @Lou 's ...


4

You cannot save a table in a geodatabase with an extension like ".dbf". Remove the extension and the tool should run.


4

Check for the file you don't want, and delete it. Something like: arcpy.env.workspace = r"c:\temp\mydb.gdb" if arcpy.Exists("fcToOverwrite"): arcpy.Delete_management("fcToOverwrite") # your convert shapefile code here See Exists - ArcGIS Desktop Help.


2

As commented by @KHibma: Unless you've created a package to reference the data, it'll make a copy of that data for each package you made. Thus one edit/change won't impact another package. When you open the package, check the source of that data. A key thing to understand with map packaging is that the map package contains a copy of the source ...


0

Using arcy.da.Walk it works and even faster than using the Describe object. So in case it is useful to anyone, this is how my code is now: import arcpy, os def ListFeatureDatasets(geodb): arcpy.env.workspace = geodb for dirpath, dirnames, filenames in arcpy.da.Walk(workspace,datatype="FeatureDataset"): return dirnames def ...


1

An alternative option to get your fc and fd paths is to use arcpy.da.walk. This code snippet will provide the path of empty fd: walk = arcpy.da.Walk(workspace, datatype="FeatureDataset") for dirpath, dirnames, filenames in walk: print dirpath


0

As commented by @johns you could try using the Recover File Geodatabase tool which: Recovers data from a file geodatabase that has become corrupt. but be aware that it: can only recover simple feature classes and tables. Complex data and relationships will not be recovered.


3

I can't find any ArcObjects interface that can ask the question has a GeoDatabase been compacted. There is an interface that can ask if a File GeoDatabase has been compressed and this is ICompressionInfo Thinking about it once a GeoDatabase has been compacted, you can't "un-compact" it so from the first time it ever gets compacted then it is always ...



Top 50 recent answers are included