|
POST
|
Ahhh I think I see your problem... It looks like you are trying to run text copied from the interactive python shell as a script. This won't work. You need to delete all the python shell stuff, eg Python 2.7.2 etc... and >>>. and just run the actual commands. import arcpy.mapping as mapping mxd = mapping.MapDocument("c:/GIS/python/Broken.mxd") mxd.findAndReplaceWorkspacePaths("c:/GIS/python/Old/Trucks.gdb","c:/GIS/python/New/Trucks.gdb") mxd.saveACopy("c:/GIS/python/Fixed.mxd")
... View more
04-17-2013
02:03 PM
|
0
|
0
|
1291
|
|
POST
|
Post your code. From what little I can see in the screenshot, your import statement lacks commas between the modules you want to import.
... View more
04-16-2013
11:01 PM
|
0
|
0
|
1291
|
|
POST
|
I don't think there's any way of releasing the license without restarting the IDE's python process. That said... I use an IDE called PyScripter which has a remote debugger. This means it can be restarted (or crashed...) without restarting (or crashing...) the entire IDE. To restart the remote python process and release a license after running an ArcPy script, right click the python interpreter section of the IDE and select Python Engine->Reinitialize Python Engine. See attached screenshot. Or hit Ctrl+F2. [ATTACH=CONFIG]23535[/ATTACH]
... View more
04-15-2013
07:43 PM
|
0
|
0
|
774
|
|
POST
|
You can fill in the gaps with the nearest values using the Nibble (Spatial Analyst) tool. Step 1, create an input for Nibble. Nibble doesn�??t fill NoData, so the input raster needs to have (a) original values to use as the fill value, and b) a valid value (e.g. 0), in areas to be filled. You could use the following raster calculator statement to generate an input: Con(IsNull("your_raster"),0,"your_raster") Step 2, create a Nibble mask. This identifies the areas to be filled (NoData). (You should just be able to use your original raster as the mask) Step 3, run the Nibble tool. Something like the following raster calculator statement: Nibble("nibble_input", "nibble_mask", "DATA_ONLY") Some examples from my own data (black = NoData) below. My steps were a little more complicated as I had to mask the white areas from being filled or being used to fill.
... View more
04-14-2013
03:39 PM
|
0
|
0
|
6025
|
|
POST
|
That's because you're passing just the filename and not the full path of the shapefile to the tool. It works when the shapefile is in c:/test_define as you have set that as your workspace. To fix, change infc = name to infc = os.path.join(path,name)
... View more
04-10-2013
07:44 PM
|
0
|
0
|
939
|
|
POST
|
For some reason its loosing all my formatting.. sorry. Read this: How to post Python code
... View more
04-10-2013
07:35 PM
|
0
|
0
|
939
|