Hot answers tagged

14

Using the Select by Attributes tool, you could enter the following SQL query to select all features with less than 5 characters in the ZIP field: CHAR_LENGTH("ZIP") < 5


13

If your image comes without pre-computed statistics QGIS and ArcGIS will produce a quick estimate of what the ideal min/max for displaying the image is. This does not change the values you are seeing, just the color range. You can easily test this by comparing the pixel values. If you want to see the computed band statistics you can right click on the layer ...


11

Unfortunately, GIS software isn't yet at the point where it natively makes use of GPU memory for processing. ArcGIS just gained the ability to use multiple CPU cores with the release of 10.x. At this stage, your best bet for improving image processing performance is making sure that you have the most optimal I/O possible (i.e. some nice SSD's).


11

I assume you have installed comtypes successfully, according to the following SE Q/A: -How do I access ArcObjects from Python? import arcpy from snippets102 import * from comtypes.client import GetModule, CreateObject import comtypes.gen.esriFramework as esriFramework import comtypes.gen.esriArcMapUI as esriArcMapUI import comtypes.gen.esriCarto as ...


9

To add a custom toolbox, in ArcMap or ArcCatalog, open ArcToolbox and right click in the white space and go to Add Toolbox: To see the script, right click on the tool, and go to Edit or Export Script. If you use Export Script, create a new text file and select it when exporting. You might need to go into the Geoprocessing menu, and go to Geoprocessing ...


9

I agree with @ChrisW in that ArcGIS can work with massive datasets in file geodatabases (1TB), yet shapefiles have size limitations (2GB). A few recommendations: Make sure your vector data are in a file geodatabase. Ensure that 64-bit background geoprocessing is enabled. Simplify your data in any way you can prior to processing. If your objectives allow, ...


9

Use my script here to create points inside your polygons. Each point is a centre of maximum inscribed circle of the parcel. Please note, script tested on shapefiles only and it does not handle polygons with holes, i.e. donut like polygons. Table of centre point contains field theDist, that is the radius of above circle. Select all points with ...


9

They are not supposed to be opened with Arcmap directly (except for dbf, which can be opened independently). They are being used when you are adding the shp file to the Arcmap! description of each file: dbf (database file): contains the attribute table of the shape file prj : a textual file containing the projection system of the shape file sbn, sbx: ...


8

In addition to @DWynne's answer, I'll add that there is a built-in python function that does exactly this (located a little bit further down the page on DWynne's link). It's called zfill and according to the documentation: Returns the numeric string left filled with zeros in a string of length width. A sign prefix is handled correctly. The original ...


8

you need to pass the fields you're using in your codeblock as arguments to the function, rather than the field that you're calculating. So your code might look something like this: def cal(House_Num, FROM_ADDR, TO_ADDR): if ((House_Num >= FROM_ADDR) and (House_Num <= TO_ADDR)) : return 88 else: return 1 Expression: ...


7

You cannot rename fields in an attribute table. However, you can add a new field and copy the values from the old field to the new one. Finally, delete the old field if you wish. In sum: Add Field Calculate Field Delete Field (optional)


7

Here is the arcpy version of zoom to next feature. You may run this in your ArcMap python window: mxd = arcpy.mapping.MapDocument("CURRENT") # currently opened map doc df = arcpy.mapping.ListDataFrames(mxd, "Layers") [0] # define layer you want to iterate and zoom on for lyr in arcpy.mapping.ListLayers(mxd): if lyr.name == 'myTOCLayerNameHere': ...


7

Your python syntax is not correct, try: def myFunc(typ, oby): if typ == 'D': return 'Z' else: return '25' function call: myFunc(!TYP!, !obyy!)


7

One solution is a combination of data driven pages and dynamic text. In your case, you'd set the "Name Field" as your street names (e.g. STREET_NAME). Then, insert dynamic text that refers to that property in your map layout. <dyn type="page" property="name"/> This will also enable you to automatically cycle through dozens or hundreds of street ...


7

You can follow the instruction in the image below, if this is what you have been asking for: Also, you can find many in Font ESRI Geometric Symbols (filled symbols and unfilled symbols). you can adjust the angle, size, and color as you like.


6

The format of your 2 fields is probably double. Turn them to integer first (with or without the string.format() method, but the latter is more elegant): vakkrt_name = str(int(row[0])) + "_" + str(int(row[1])) or vakkrt_name = "{}_{}".format(int(row[0]), int(row[1]))


6

in provides a quick logical test for determining if a value is contained in a list, dict, or string. if from_g in dct_max: either from_g is found in dct_max (true) or it's not (false). The rest of your questions would be resolved by researching how dict objects work (lots of good examples on Stack Overflow).


6

Here's a handy list of keyboard shortcuts: http://www.esri.com/library/brochures/pdfs/arcgis-desktop-tips.pdf In an attribute table, Ctrl + Enter will move to the next row and select it. Then Ctrl + Shift + = (the equal key) will zoom to that feature in the map.


6

First part is the AddIn, the real work is done on a form: Inherits ESRI.ArcGIS.Desktop.AddIns.Button Private pForm As fFeatureInspector Public Shared IsFormLoaded As Boolean = False Public Sub New() End Sub Protected Overrides Sub OnClick() 'My.ArcMap.Application.CurrentTool = Nothing If Not IsFormLoaded Then pForm = New fFeatureInspector ...


6

Label expressions are similar to field calculator: you don't need to use a for loop as the expression is already applied to every feature. Also, you'll get an error with your code as per the help: Field values are automatically cast to text strings. Therefore, if you wish to use a numeric value in an arithmetic operation, or when making a ...


6

It is my understanding that you cannot directly perform spatial queries in the Defintion Query tab. However because ESRI offers a calculate geometry option for common shapefile geometry calculations and automatically calculates area for feature classes, you can do a psuedo spatial query on a field containing the value of area for each polygon. For shapefiles ...


6

Geoprocessing tools will return a result object. If you store the result in a variable you can examine it afterwards. result = arcpy.mymodel_mytool(r"D:\temp\this", r"D:\temp\that") # The following will print all the messages associated with the result print result.getMessages() The ArcGIS resource page on Results objects lists the properties and methods ...


6

Database permissions would be my first check. After that, look closely at the data source. Is it a UNC path or does it link to a lettered share drive? If a lettered drive, make sure that the user has the same exact path set up for their X drive, for example, than you do. If the above checks out, try to access the database path from the users machine to ...


6

In the Data Frame properties, click the Frame tab and change the background color:


6

Just use the field calculator, goto attribute table and right click on the table header, and choose field calculator [ONEWAY] = "B" obviously our fields are a little different, just make sure you select the field you want to calcuate to


6

Network Analyst uses a network of roads, because straight-line distance does not accurately represent the roads that a fire truck must drive on. This is especially true if there are geographic barriers (rivers or streams) or in a rural area with fewer roads. In contrast, flight time analysis would not use a network because planes or helicopters can travel ...


6

Use the Spatial Join tool in the Analysis toolbox->Overlay toolset with these settings to generate statistics for all of your concentric buffers at once. Target Features: Concentric Ring buffer feature class Join Features: Population points Output feature class: Specify the name and location you want Join Operation: Join_One_To_One Join Type: Keep All ...


6

You can use the "con" tool for reclassifying values in rasters. The conditional statement is the bread-and-butter of raster analysis and is a good thing to be familiar with. The con tool can be found in the ArcToolbox: Spatial Analyst Tools > Conditional > Con You can also do this via the raster calculator which, is my suggestion because you can define ...


6

Here is how you can use Python to automate your task. It evaluates your line at each point location (determined by 'point_spacing'), offset by 'tolerance', then creates rectangles to fit those angles & distances. line_fc = 'line' # line feature class sr = arcpy.Describe(line_fc).spatialReference # spatial ref point_spacing = 200 # how far apart to draw ...


6

If you're always only changing the fourth digit to a 4 - In field calculator on the New_Field select Python parser, and input the following: int('{}4{}'.format(str( !Current_ID! )[:3], str( !Current_ID! )[4:])) This will replace the fourth digit with a 4 (whatever that fourth digit may be). If it needs to be a number other than 4, change the number in ...



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