Tag Info

Hot answers tagged

6

There is a large amount of documentation from ESRI on creating your own tools in Python, so I will assume that you can access your selected layer without issue. There are many methods for selecting data randomly, for example choosing in random number in the range of the number of features (using the random module as suggested by @MichaelMiles-Stimson above), ...


5

This is definitely possible. I just did a test, and I was able to get it to work by using float() around the Acres variable. So, this worked fine for me: def FindLabel([PARCEL_NUM], [PROP_ADDRE], [Acres]): if float([Acres]) >= 10.0: return [PARCEL_NUM][-8:] + '\n' + [PROP_ADDRE] else: return [PARCEL_NUM][-8:]


4

Yes, you're problem is that you are looping over every single row every single time. You need to specify which row you are wanting to update. It sounds like you have 2 polygon features and you are wanting to update poly1 from poly2 where poly2 intersects poly1. You can do this without peforming a join. with arcpy.da.SearchCursor(poly2,"*") as c1: for ...


4

esri leaflet is an alternative to the ArcGIS API for JavaScript, not something that makes much sense to try and combine. L.esri.DynamicMapLayer provides comparable functionality (within Leaflet) for loading dynamic map services published to ArcGIS Server to the class 'esri/layers/ArcGISDynamicMapServiceLayer' in the JSAPI please check out the esri leaflet ...


4

(1) I have usually heard of it referred to as a "Hexagonal Map" or "Hexagonal Grid Map". Both queries turn up a lot of relevant results in Google. Example Link Here: http://anitagraser.com/2012/03/04/mapping-density-with-hexagonal-grids/ The link above also outlines the process that you would use in QGIS. If you want to do it in ArcGIS. This article ...


3

While it's true that you've implemented the worst possible case of feature dataset (mis)use, I've worked with customers with more feature datasets than that (2000), and Oracle upgrade took about five minutes, so I suspect you're looking in the wrong place for optimization. Some of the things you can do: Make sure your database is optimally configured, and ...


3

I have found that a spatial join is always faster than a cursor. Your real hangup will be working with the entire parcel feature class, however, when only a selection of those features are needed. To improve the efficiency of your process, I'd suggest pulling out only the parcel features you need for your analysis and creating a copy in memory. You want to ...


3

I would recommend the Parse Path tool in ModelBuilder. Make sure to select the "Name" parse type. In this (very simplified) model, I included a "workspace" variable that I can call at any point and combine with the name value from the parse path output. The syntax for that would be %Workspace%\%Value% in the output path parameter. You should also attach ...


3

This is probably a bit of a roundabout way of performing this analysis, but I just did a quick test and it worked for me: Use the Raster to Polygon tool convert your raster, with the simplify polygons option unchecked. This should provide a polygon representation of the raster cells with the 'gridcode' attribute being the value of the raster cells. ...


3

I would do this the other way around from current comments/answer. I am assuming your scenario changes are where the flood values, not the buildings, change. Convert your buildings to raster with Polygon to Raster, using your flood raster as the extents and matching cell size/row column count/etc. There is some risk that a resulting cell won't be classed as ...


3

Use the Get Count and Calculate Field tools. Make sure the output of Get Count is a precondition for Calculate Field. The output of Get Count is passed to Calculate Field via in-line variable substitution. E.g.


3

Copy/Paste your shapefile to the Data Frame/Table of Contents so you have two copies of the same shapefile: Definition query one of the copies for Yes values, query the other for No values: Then symbolize each by ID field: The result should be something like this: Just a disclaimer, this method is purely for display purposes.


2

It sounds like all you need is a simple join. Use the join tool and use a common field to combine the table and shapefile together. ESRI Help: About Joining and Relating Tables EDIT: I see now it is a new shapefile you want. In that case I would still do the join and then save the joined shapefile as a new shapefile.


2

Give this blog a read. It should get you started by providing you ideas of how you can actually consume a feature service with geoprocessing. Either have it as a layer inside the map and use a name match in the script to it. Or use a featureset parameter and use the URL to it Either way, unless you want to provide the end user the ability to select a ...


2

Change your exception handler to this: # Return any errors except Exception as e: print(e) arcpy.AddMessage(arcpy.GetMessages()) Now open py file in IDLE and try to run. See what error you have. ED|T: for row3 in row2: = you'll get a "row2 is undefined" error here in case you'll manage to get here :) First clean up syntax errors first and people ...


2

Instead of going the python route, I would recommend using this sequence of geoprocessing tools: Create new field in soil table called layer, and field calculate it with the value "soil" Perform union on soil layer and land use (soil first input and land use second input) The union process will help you deal with soil features that span multiple land use ...


2

If I understand well, the problem here is that you want to do a spatial join (based on location) but you are using a method for table join (based on a "key" field). Indeed, there does not seem to be a key field and you don't have the same number of feature, so you will not be able to get the match based on your attributes. I suggest that you start with ...


2

For shapefiles, the time portion is truncated from the datetime value. So you should work inside a geodatabase if you need the time. If you really need to work in a shapefile, I suggest that you try it within a text field


2

When you say embedding, I'm presuming you mean this approach? http://resources.arcgis.com/en/help/main/10.2/index.html#//005700000017000000 If so, short answer is no. Embedding scripts is a nice way to minimize the number of files you have to pass around or just to hide/encrypt your work. You could embed your utilities as long as your utility functions ...


2

You need to put the fields you want to include in the cursor within a list or tuple. How you have it now, you are putting a WHERE clause of "OD". arcpy.da.UpdateCursor(in_table, field_names, {where_clause}, {spatial_reference}, {explode_to_points}, {sql_clause}) You want: with arcpy.da.UpdateCursor(fc, ("Depth", "OD")) as cursor: With that said, I ...


2

In this screen shot I have wind turbines and randomly buffered 10km around 4 different ones. I manually selected the lower left buffer, ran the model and got a result - you can see that 4 turbines exist in this buffered area and only this area (no overlap to the other areas) Heres the model. I noted the type of selection required for each tool. The dashed ...


2

Do you have an Advanced License? If so, I think you should be able to use the Near or Generate Near Table tool to find the 2 closest pipes to each valve. Then You could join that table back to the Pipes FC based on the FID to bring the diameter fields over.


2

From the ArcGIS 10.1 Help: Files with a .txt, .asc, or .csv extension are interpreted as comma delimited, while files with a .tab extension are interpreted as tab delimited by default. Any file with one of these extensions will be interpreted as a text file table even if it doesn't contain tabular data. If you attempt to display a text file that ...


2

This blog has some explanations, here is a brief excerpt from one of the answers: When you use a barrier, every IDW calculation--that's one per output grid cell--has to involve a check against the barrier file for every possible neighbor. The more features there are (you have 1088) and the more vertices they have (you have 23,938), the longer it ...


2

You would need to look into some Help pages. Add the layer to the TOC. Get parameter (country name) as text. Get your cities into an array with arcpy.da.SearchCursor and do simple math with Python.


2

There is no way to stretch the heading across multiple columns using the built-in legend functionality in ArcMap. You could repeat the heading across both columns by splitting your layer into two, but that's probably not desirable. My recommendation would be to hide the layer heading in your legend and use a static text element (e.g. Rectangle Text box) to ...


2

As dmahr said, this isn't possible but there are workarounds. My normal one is to create a separate legend for those items and use the legend title for your text instead of the layer heading. The title can be centered above all the columns in the legend, unlike the layer name or layer heading. So in your example map, I'd create 3 legends: one for Fire Hazard ...


2

You should use the Near GP tool for that (Advanced license only). It will add two fields to your point shapefile: one for distance to the nearest coastline feature and another for the coastline feature ObjectID.


2

It looks like you don't actually produce an output from your tool, only modify the input file. Although you have an argument for outFc you're not creating the output. Notice: all fields added and field calculations are performed on the input feature class. If you change your outFc to: outFc = arcpy.GetParameterAsText(2) the user can specify an output ...


2

One way to tell if arcpy is installed is to go into Add/Remove Programs, select ArcGIS 10.2 for Desktop, and click the Uninstall/Change. When the ESRI window opens, select Modify and then click Next, and on the following screen Python should not have a red X on it. If it does have a red X, then you can change it to install the feature. Another way to ...



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