Tag Info

Hot answers tagged

3

It is not possible to change the properties of a layer directly. The properties of a layer can be changed, but only by importing properties from another layer in the map or a layer file. Even the layer name cannot be changed without an existing layer or layer file. "UpdateLayer" in the ArcGIS Help can give you more details and some examples.


3

You can do this sort of renaming by utilizing enumerate. The general idea is to add an index with each raster name and then call that index to reference the specific item in the text file list. import arcpy arcpy.env.workspace = r'C:\path\to\input\rasters' txtfile = r'C:\path\to\textfile.txt' # Generate a list of items from text file with open(txtfile, ...


2

You can't really change the symbology of a layer in arcpy with the level of customization you have when just right clicking a layer and using the symbology menu. However, you can make a "template" layer that contains the symbology you want and then use ApplySymbologyFromLayer_management (in_layer, in_symbology_layer). This will allow you to apply the ...


2

If you are running the tool outside of ArcGIS session, in Python (or when in the Python window and the extension has not already been enabled), you will need to check out an ArcGIS Spatial Analyst extension license before running a tool. You do it with: arcpy.CheckOutExtension("Spatial")


2

The Correct form of your code is : def FindLabel ( [amenity], [osm_english_32_name], [osm_name_58_en] ): if not ([osm_name_58_en] is None): return [osm_name_58_en] elif not([osm_english_32_name] is None): return [osm_english_32_name] + '\n' + [amenity] else: return [amenity] The semicolon in the last line is removed. ...


1

You need to read the help file of the Mosaic to new raster tool. If you look at the Syntax section it lists the parameters of the tool and what they are. You need to be following the same order. Looking at your code you have a mysterious 1 after output name and before coordinate system. This is not the order of parameters as dictated in the syntax section. ...


1

The code presented in your question doesn't match what is asked for in the question. "I'm trying to label certain features using a specific field (osm_name_58_en). However, when this field is null, I want to label the feature with (som_english_32_name). If both are null then I want to label with the (amenity) field." This sentence implies that you only ...


1

Assuming your project is setup correctly, with all references added and compiles without errors. Using Visual Studio Express 2013, ArcGIS 10.3 and targeting .Net framework 3.5 Also ensure you add ArcObjects Library References to: DataSourcesGDB GeoDatabase Carto Public Sub New() On Error GoTo Trap Dim sPathFGDB As String Dim sFCName As String ...


1

using Arcmap 10.1 you can use an alternative option: 1. add your all geo-refed raster in a new arcmap 2. define the projection properly in the data frame properties 3. Go to windows menu and click on image analysis. 4. In image analysis tool select all your rasters and click on mosaic button present in a window below named "processing". 5. A temporary raster ...


1

I would avoid using ArcGIS (arcpy) in this case and do this using a pure Python solution. This will be faster and much cleaner. Since you are renaming tif files you do not need to use ListRasters() or arcpy.Rename()...see this example: import os import glob def rename_files(new_names_file, file_folder): files_list = glob.glob(os.path.join(file_folder, ...


1

The above answer is missing a few crucial details that might frustrate people, as Dre pointed out. I've tried to work out why copy gets greyed out - I read it had something to do with some aspect of the feature class not agreeing with the data frame, but I couldn't resolve it. To duplicate annotation in an annotation feature class when "Copy" is greyed out: ...


1

I would recommend to build a simple model to iterate through all rasters in your workspace and then convert each of them to Polygon. To add an iterator, In model builder go to: Insert > Iterators > Rasters You final model should look like this: and your Calculate Value Should look like this: The code block: def t(s): return ...


1

As far i can recall, you can select all table from this batch tool and copy into microsoft excel and modify input parameters of the tool in excel (apply some excel formula to change the output to lessen manual labor). After that you can select all in the tool and paste this excel rows back into the tool.


1

Arcpy geoprocessing fails with file names that contain special characters like spaces or periods. I ran into this recently when I was able to use os.walk to read file names that contained periods, but arcpy.da.walk failed. I learned more about this problem in the help topic "Validating table and field names in Python". Please try your script again with no ...



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