Tag Info

Hot answers tagged

20

You can use basemap layers to solve this. Once you are happy with the symbology of your layers you can right click the data frame and select New Basemap Layer (see below) which is similar to a group layer. You can then drop the layers into this group, it will redraw them once and then 'store' this view rather than redrawing every time you make a change. If ...


6

You can put this as the label expression for the feature: def FindLabel(yourField): if yourField is not None: split_field = yourField.split(" ")[0] return str(split_field) else: return None Using Python as the parser and checking the Advanced box. Replace yourField with whatever field you are using to label.


6

The only way I know of to do this without creating many feature layers (one for each level of transparency) is to create a raster with an alpha channel. Here is one possible workflow you can try: Use Polygon to Raster to convert your polygon features to a raster. Reclassify the data as desired (using 8-bit unsigned integer with values from 0-255 works ...


6

Many thanks to @Erica for the reply, which for some reason didn't work for me. But it did put me on the right track to finding a solution, which was to use the Minimum/Maximum Stretch, in combination with the Edit High/Low Values option: Importing this symbology into the other rasters caused the correct stretch to be applied to all images.


6

The following example shows how to integrate the built-in python method .upper() with the arcpy update cursor. This example first tests if a field is of type String then checks each row within that string for lowercase values. If there are lower case values, the row is updated with all upper case. import arcpy fc = r'C:\temp\test.gdb\yourFC' desc = ...


5

One way would be to convert the polygon into series of points (using feature vertices to points) and save it as a new shapefile.In the attribute table you can 'add' a new lat and long 'field' and populate it with the lat/long values using 'calculate geometry' option. The attribute table information is available in the .dbf file associated with the shapefile. ...


5

You can put this as the label expression for the feature: def FindLabel([yourField]): if [yourField] is not None: if int([yourField]) > 0: return [yourField] else: return None else: return None Using Python as the parser and checking the Advanced box. Replace [yourField] with whatever field you ...


4

Put the code below as the label expression for your feature in ArcMap. Set the parser to Python and check the Advanced box. Change [yourField] to the field containing the values you want to label. def FindLabel([yourField]): if [yourField] is not None: value = float([yourField]) if value < 1: return round(value, 3) ...


4

I deal with this from time to time. You should use the Expression button in the Label tab. There you use the Advanced parser (checkbox), and write something like this (Python): def FindLabel ( [Name], [V5] ): if [V5] == "0": return "<BOL>"+ [Name]+"</BOL>" else: return "<BOL>"+ [Name]+"</BOL>" + "\n" +"<FNT size = '6'>"+ ...


4

This probably should have been a comment, but got too long. How does ArcMap do what? It can display data without a spatial reference / coordinate system (SR / CS), but try to add other data that's really in a different CS. They're not going to overlay unless you happen to set the data frame's coordinate system to the unknown data's CS. ArcMap does not ...


4

An alterntive to ian's suggestion, you can change your label expression to something like the following. By importing the regular expression module, you can create function to only display numbers at the beginning of a string. def NumberLabel(addressField): import re return re.search('^\d*', addressField).group() As per Ian's example, use python ...


4

The Production TOC Manager toolbar is a part of the Aeronautical solutions extension or possibly some other specialized extensions which can be purchased separately. I believe this extension also requires a Standard (formerly ArcEditor) or Advanced (formerly ArcInfo) level extension. If you have purchased these extensions, make sure to enable them in ...


3

I would make two changes: Make sure your indentation is correct Use len() to count the characters. Make sure you are writing to a text field. def reclass(f1): if len(f1) >= 4: return "Yes" else: return "No" Label = reclass( !HUB! )


3

I would use random.choice() to make a random selection from the .csv file and insert that into your FC rows using an Update Cursor. import arcpy, csv, random # Read csv file with names file = r'C:\path\to\your\file.csv' reader = csv.reader(open(file, "rb"), delimiter = ",", skipinitialspace=True) listofnames = [name for line in reader for name in line] # ...


3

I'm not by a computer where I can try this within ArcMap, but try: wf_expression = '"AGE_18_64"' + " >= " + str(wf_value) or, using str.format(): wf_expression = '"AGE_18_64" >= {0}'.format(wf_value) Try that if wf_value is supposed to be a number in the sql query (you don't generally need to enclose numeric values in quotes). If however it ...


3

In Layer Properties - Labels- Method click the drop down to select Define Classes, then use the SQL Query to limit the label to only those features. Alternately you could use a selection query for those features, save the selection as a new layer in your TOC using the create features option, and then label those features.


3

Attachments can be enabled only on feature classes stored within a geodatabase (this can be any type of geodatabase - personal, file, or enterprise). You cannot attach your files to a shapefile because there is no container the data can be stored in. To convert your shapefile to a geodatabase, you can use a GP tool Feature Class To Feature Class ...


3

When you bring in a csv, Arc does its best to determine the appropriate field types and as you have found it doesn't always get it right. One solution is to use a schema.ini file (see bottom of page) to explicitly set the field types for your columns. There are several related (duplicate?) questions here on the GIS SE if you search for 'schema.ini'. More ...


3

Previously I have saved as a layer file and then imported the symbology from the layer. To save as a layer file right click on the layer in the table of contents and select 'save as layer file'. To import the symbology click on the open folder in the raster properties dialog. then browse to the layer file saved to disc Note: if the layer symbology is ...


2

Right click on the raster layer in the TOC and select "Save As Layer File". Add your other raster to map, go to Layer Properties - Symbology tab, click import, find the saved layer file. Alternatively, you can apply the symbology of any raster in your map document to any other raster in your document by also clicking import but selecting the source raster ...


2

Great question -- I needed to do something similar recently, and it is well-hidden! In the Symbology dialog that you show above, you need to scroll down. That will bring you to the "Stretch" dialog. T By default, ArcMap will analyze the histogram and come up with its own best fit based on the statistics of a specific image. This optimizes the color ramp ...


2

I know that your question is ArcGIS\ArcMap specific, but, maybe you are in the mood to try something different. QGIS can do what you wan't. Style your layer with singleband pseudocolor. Create a new color ramp using gradient color. For one of the colors use 0 for the alpha chanel And press classify. The result will be something like this: Note ...


2

There is a workaround to do graduated transparency in the Esri Knowledge Base as a Technical Article entitled HowTo: Create graduated or proportional symbol transparency. However, I have not tested it. It dates from ArcGIS 8.3 and uses Convert Features to Graphics and Convert Graphics to Features (which was then only a Developer Sample). Even if it ...


2

I found this good discussion at http://www.cartotalk.com/index.php?showtopic=7109 and thought it would be useful to add to GIS.stackexchange for posterity. in ArcMap 10.2, choose > Windows > Image Analysis in the top panel, select the input image in the Processing section, choose the first tool (Clip) this adds a new temporary raster to the TOC right-click ...


2

If you leave the cell size blank you are telling ArcMap to choose its own, by your admission you've indicated that the data is dense so a small cell size would be suitable. e-006 means 6th decimal place (so 1e-006 is 0.000001). Is your source data in geographic coordinates (lat/lon)? this would explain the difference in cell dimensions i.e. stored in ...


2

I'm not sure how familiar you are with ArcMap, but do you have a scale range set on the feature? In the TOC right click on the feature and go to properties and view the General tab: But I'm assuming this is not the case. In ArcMap, go to the Customize --> ArcMap Options --> Display Cache and clear the cache. This ESRI Knowledge Base article says to ...


2

This might help you out: fc = "C:/myfc.shp" csv = open("C:/Vertices.csv", "w") csv.write("X,Y\n") with arcpy.da.SearchCursor(fc, ("SHAPE@")) as cursor: for row in cursor: for part in row[0]: for pnt in part: csv.write("{0},{1}\n".format(pnt.X, pnt.Y)) csv.close() If you have more than one polygon you would want to ...


2

I can see your syntax is off in the clip command. I would take the following approach: import arcpy, os outws = r'C:\temp' poly_single = r'C:\temp\poly_single.shp' # The polygon to be clipped poly_multi = r'C:\temp\poly_multi.shp' # The clip features rows = arcpy.SearchCursor(poly_multi) count = 0 # Start a counter to name output polygons for ...


2

import arcpy import random import csv fc = "C:/stuff.shp" csv_rows = [] with open("C:/some.csv", "rb") as csvfile: reader = csv.reader(csvfile) for line in reader: csv_rows.append(line) with arcpy.da.UpdateCursor(fc, ("FIELD2UPDATE")) as update: for row in update: random = random.randint(0, 49) value = csv_rows[random] ...


2

In order to add another map view over another area you would use another data frame (Insert > Data Frame). Learn here how to work with multiple data frames in page layout. You can switch between data frames in Table of Contents and zoom as required. In Layout view, you can move data frames as needed.



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