Tag Info

Hot answers tagged

4

The problem is that the dataset you are currently trying to use as the input feature layer is technically not a feature layer, it's a shapefile. What you need to do is use the Make Feature Layer tool on the shapefile, and then use the resulting feature layer for the selection process. It's a little confusing, but realize that when you add a shapefile into ...


4

I would take a different approach and use Delete Identical (Data Management). The following script creates a copy of your table or FC and then removes the duplicate rows in that copy. import arcpy table = r'C:\test\temp.gdb\table' copy = r'C:\test\temp.gdb\table2' # Create a copy of your table arcpy.CopyFeatures_management(table, copy) # Delete ...


3

PerfQAnalyzer does just that. From that page: In the Spring of 2012 we released the PerfQAnalyzer tool, which assists users in capturing render and edit times within ArcGIS for Desktop. This tool is a free, unsupported, downloadable tool offered to the Esri user community which can be run from within ArcMap (as an add-in) or as a stand-alone ArcGIS ...


3

Vamping on PolyGeo's comment, I believe that the Summary Statistics tool would work easily. If I understand correctly you just need a list of unique values for the "Units" field. You can set up the tool like this (see the screenshot) except instead of using the "Name" field, you would use "Units". [Be sure to add Wellbore_Name w/ stat type "FIRST" as one of ...


3

Both variables are zonal means. The average distance to the nearest facility is the zonal mean of the Euclidean distance grid (based on the facilities). The average number of facilities is the zonal mean of a one-kilometer radius focal sum of the facilities grid. (This is merely a grid whose cell values count the number of facilities within each cell. ...


3

Here is a block of code to get you started. This should change dependent on whether you are performing an append or merge. You will also have to create separate lists and loops/appends for your line data and point data. # import modules to use import arcpy, os # input folder containing your new shapefiles inputFolder = arcpy.GetParameterAsText(0) # ...


3

Using Field Calculator, you are able to create an expression for the calculation of each row in a given field. There are two languages that you can use to write the expression: VB and Python. At the top of the calculator, you'll see where you can choose which language should be used to interpret the code you have entered. If you select VB, you need to ...


3

Instead of if self.params[0].altered: try if self.params[0].value: I just tested and that seemed to work as you are hoping for. The .altered and .hasBeenValidated properties are super useful, but are still a little mysterious to me sometimes, even after reading the documentation... UPDATE: Thanks for the feedback, I misinterpreted what you were ...


3

Your function is not returning anything. I've modified your code to return the value of aspect_m60. # Calculate Field import arcpy # Set environment settings arcpy.env.workspace = "c:/W/Sik" # Set local variables inTable = "Point" fieldName = "aspect_m60" expression = "getCalc(!aspect!)" codeblock = """def getCalc(aspect): if (aspect < 60): ...


3

It is much more intuitive, in my opinion, to work with Cursors (rather than trying to emulate the field calculator in a script) for this type of problem. This is how you would port the problem over to an Update Cursor: import arcpy # The input FC fc = "C:/W/Sik.gdb/yourFC" with arcpy.da.UpdateCursor(fc, ["aspect", "aspect_m60"]) as cursor: for row in ...


3

As user30184 pointed out, there's a tool that does the trick. Run the tool Create Fishnet Simply put your old 1km grid in the Template extent. This will populate the coordinates of your extent. Then fill the "Cell Size Width" and "Cell Size Height" with 500 geometry type > polygon That's it


2

EDIT: to spread some more light on the issue after a chat with the OP. One should remember that the suggested workflow will work only if the output for each tool wasn't defined; that is that tools are using the default output which is defined in the model environment settings. # You should continue using the model properties > workspace settings; but ...


2

Field Calculator. Right Click on Total_acci, select Field Calculator. You'll get an option to build a query. Add the other three fields together. If those are not an option, you may need to change the data type using ArcCatalog.


2

A GeoPDF is a specific file format falling under the broader category of geospatial pdfs. They are not the same thing in much the same way that a GeoTIFF differs from a regular TIFF - internal structure and formatting differ. If you used File > Export to create your pdf, you might have created a geospatial pdf as Esri does have some support for this. ...


2

Okay, I've provided this answer to try and consolidate my comments above and to serve as a resource for others contending with the issue of stream burning. As I stated in my answer to this question Shapefile and DEM: check rivers behaviour, you would expect a mapped vector stream data set to deviate from a corresponding DEM-extracted stream network because ...


2

This is a great example of how relatively simple arcpy.mapping scripts can offer more functionality than Data Driven Pages. First, if you haven't already, run a Spatial Join with your trees as your target layer and your districts as your point layer using the INTERSECT match option. It's better practice to perform a spatial join and apply a definition query ...


2

I can answer my own question, because I found the solution. It is a known QGIS 2.8.1. bug that is going to be fixed with version 2.8.2. The problem is with rotational informations stored in the World File. The bug is causing the misreading of such informations. If you try to change rotational information in the World File to be zero (actually all the World ...


2

I'm not really familiar with VB, but you could use this Python code: def check(value): if value == 0: results = 0.0001 else: results = value return results And for the Expression put: check(!Lung_lunc!) Make sure to change the Expression Type to Python.


2

Start ArcCatalog window and implement your mentioned method on the ArcCatalog Screen. I've showed at the square. Good Luck.


2

Your code is quite nice, thanks for the arcpy.da.walk example, there is a bit of confusion about feeding a tool the correct values and sys.argv, arcpy.GetParameter and arcpy.GetParameterAsText... I always use sys.argv, mostly because it's less typing, it also takes the confusion out of supplying the correct type to the tool. import os, sys, arcpy ...


2

You haven't shown how you received the parameter value, but I would guess you're likely using parameters[n].valueAsText. Use parameters[n].values instead to receive the value back as a list.


2

I would approach this as follows: Convert your polygons into lines (by which each edge of the polygons - a line between the consequent vertices - will become a line feature in the output feature class.) After the conversion, the output lines will preserve their "parent" polygon ID. Use GP tool: Feature To Line. Take each point and then find out which line ...


2

As mentioned by several other users here. Using Search and Insert cursors may not be necessary, but if for some reason you would still like to see how it is done, the following script should do everything you need. You will need to setup parameters for the script tool. I'll assume for now that you already know how to do this. Parameters: (0) Input ...


2

You are trying to set the field within the code block, when actually you need the code block to return the value you're looking for. If you just just add return aspect_m60 after the else block, it should work fine. Think of the code block as a place to write functions whose results can be used in your field calculator expression.


2

Hillshade computes the local illumination from a light source located at infinity (like the sun). Basically, it yields the cosinus of the normal to the face of the terrain and the light ray. This can be used for : visualisation and cartography : the light source is then located near the north, which then gives a nice picture of the relief. analysis ...


1

I think you should try mxdperfstat: An ArcGIS Engine command line tool to diagnose typical mxd performance problems. Supports ArcGIS 9.3, 10, 10.1, 10.2, 10.3 versions.


1

Like I said in my comment, I don't think this is possible exactly how you describe it. This should work. import os # Change the following 3 variables - - - - - - - - - - - -- - dir_fc = r'C:\dir\to\the\shapefiles' # set the index name and attribute from that layer to be used for the filename index_fc_name = "index" index_fc_attribute = ...


1

You can do this in ArcMap. It's a little hacky but you should be able to get the results you're looking for. The concept of what you'll be doing is referencing the image to a cartesian coordinate system and then identifying points on it as if it were a map and those points were coordinates. First, split the images into separate files. Next, for each ...


1

Ok Here is what I would do. Use the "Extract Values to Points" tool under "Extraction" which is in "Spatial Analyst Tools". You will use your point shapefile as the Input Point Feature and your continuous raster as the input Raster. I think that may be all you need to do. BTW instead of a 1-word comment, sometimes it is good policy to edit your question. ...


1

This is apparently not possible with ArcGIS for Desktop, see Esri's article FAQ: Are vertical datum transformations supported in ArcGIS? If you go to the ArcGIS idea page referenced in the article's comments, there is a mention of this being possible in Pro and Runtime, programmatically. To be verified with Esri, I couldn't find any confirmation of this.



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