New answers tagged

1

This might not be your entire problem, but MakeFeatureLayer doesn't return the layer name - you've already provided it. I don't know that it has a defined return value, so you're trying to set the mask environment variable to an unknown (from our perspective) value. Instead, you want to set it to the layer name, so change that line to arcpy.env.mask = lyr. ...


-1

This problem would be clearer if we could get a sense of your spatial problem, not just code. What are you trying to get arcgis to do? With only lines and polygons, I have the sense that you're probably using the wrong tools for the job. Euclidean allocation usually takes rasters, but why do you even need rasters here with lines and polygons? With lines ...


3

Try splitting your raster into smaller parts. It seems to be really big. I just found this post: http://forums.esri.com/Thread.asp?c=93&f=995&t=225045, someone had a similar problem as you: Quote from link above: Any count exceeding 2^31-1 will therefore "roll over" into the most negative numbers; for instance, (2^31-1) + 1 will appear as ...


1

An easier but also dirtier solution that has worked for me. Don't forget to create a backup of your original data. Open the Attribute Table and Start Editing Edit any two values manually so the minimum and the maximum value you want your classification to be based on are included (remember the original values) Save and Stop Editing Classify based on the ...


0

http://proceedings.esri.com/library/userconf/proc14/tech-workshops/tw_471.pdf Running multiple renditions of slide # 5 might be your only option if you have 20 folders and then press play. I had Bare Earth / First Returns and ARCMAP only ran them one at a time taking 2 hours for over 800 tiles. A lesson learned if you move the datasets around and see a \ ...


1

Here is the best solution I have found thus far using dbfpy and arcpy. import arcpy from dbfpy import dbf from arcpy import env def DBFtoCSV(): '''Convert every DBF table into CSV table. ''' env.workspace = pathlist[1] # Set new workplace where tables are located tablelist = arcpy.ListTables() # list tables in file for table in ...


0

This answer applies to 10.3. Have you tried using the Editing tool "Split" for all these tasks? Start editing your line, select the relevant section, and then go to the Editor dropdown and select "Split". This lets you split a line or line segment into parts based on distance from start or end of the line, into equal parts, or by a percentage. You don't need ...


0

An easy way to get the script translated to python would be to create a Model, here are the steps: Create a blank model Add the Calculate Field tool, fill out everything using the UI, run it If it runs as desired export the model to python script, Model menu>Export>To Python Script. The syntax should run in python for either the originally set parser (VB ...


3

I think this should work. Note that I use the r specifier for both the internal and external strings. You can skip the outer one, but then you need to double all backslashes. arcpy.management.CalculateField("test", "Link", r'r"\\ftp\raw" + time.strftime("%Y%m%d") + r"\files\boundary" + !NAME! + ".shp"', "PYTHON") Or, slightly longer, but with a more ...


4

Ah! Firstly consult rules for python string literals when there is a mix of both single and double quotes. Here expression is a string that may need to be mixed of single and double quotes. You can not enclose double quotes with double quotes or single quotes with single quotes without special sanitization. There are couple of ways you can assign your ...


2

I hope I understood your problem sufficiently. As far as I got it, I would try the following: # predefine the constant parts of your expression using a variable: constant = "\ftp\raw\YYYYMMDD\Files\Charles" nameVar = "yourobject.Name" # use the built in function .format for setting up the expression for your arcpy.CaculateField_management function: ...


1

There are two paid products that I know of: DXF Page Exporter - cheap but somewhat poorly implemented with crappy results. Converts everything to polygons - texts and lines included! Real world coordinates export is not precise - seems to be a rough approximation - in their words "data precision loss is due to real-world to pixel coordinate conversion". ...


1

Well I had that problem with Hec-geoHMS while trying to create the basin model file. To fix this I implemented the steps mentioned above and I did not change the output destinations of any files on any operation starting from (Preprocessing) so by default it stored them in a folder called (Layers). The error didn't happen again due to me "going with the ...


1

The major issue you are missing is that the ObjectID column is not intended to be used as an identifier column. It is not necessarily a static number. It is possible that the powers that be at your workplace know that and are keeping that in mind in their workflow. On the other hand, you might want to make sure they know that if anyone edits the data or ...


6

Here's a simple expression with no need to define a function in the codeblock: Headwater = 0 if !NextDown_Copy! else 1 This checks if each value of NextDown_Copy is truthy (i.e. not a null, 0, empty string), and returns a 0 if so, otherwise it returns a 1.


5

FeatureClassToFeatureClass_conversion is the equivalent tool for the ArcGIS desktop export data function. It almost never is a good idea to use ObjectId as a user reference. Why don't you generate a user id column which you know will be consistent through data exports?object Ids within a gdb are given in reference to other features in feature classes stored ...


2

Python uses None to denote null values. I'd replace your Null with None (no quotes or brackets)and see what you get. Your script is essentially looking for a text string value of null. Furthermore, it's not contained in single quotes, so you're throwing a syntax error twice over.


0

You can use JoinField_management to join the table in which you have the schema to the Feature Class that has no fields defined. If you join by OBJECT_ID, the Feature Class will receive all the fields from the join table. Details and code block for this solution as well as an alternative solution you can find here: How to create a geodatabase feature class ...


0

I ended up selecting all the features in the layer and exporting to a new layer. The python script worked fine after that. Not sure what the issue was but this resolved it.


1

Your indentation is off, you're missing an indent on the "Else" line: def reLabel(typeLabel): if typeLabel == 'BPS Easement': return 'BPS' else: return 'Other'


2

I would suggest converting your CAD annotation to geodatabase annotation and trying again. Here is an Esri knowledge base article on how to do so: http://support.esri.com/EN/knowledgebase/techarticles/detail/19961


0

I doubt there is anything simple you can do. I am sure you could come up with something iteratively adding the adjacent polygons with some logic using the required area and the area of the individual adjacent polygons. If you wanted to get fancier and have the script make better decisions you could also incorporate the length of the shared border. I just ...


0

If you are moving a shapefile or file geodatabase feature class that is the source of a layer to a new location, and then you change the source of that layer to be the same shapefile or file geodatabase feature class in that new location then the definition query will still work. If you are changing the source of a layer to a different shapefile or file ...


0

Have you tried changing the double quotes ("") to single quotes (' ')? That helped my SQL code run smoothly.


0

If you are trying to locate the midpoint interactively, there is a midpoint tool that can be used while editing. http://desktop.arcgis.com/en/desktop/latest/manage-data/editing-fundamentals/creating-a-point-or-vertex-at-the-midpoint-of-two-locations.htm


0

If you combined the two points of which you want middle points into a multipoint,then you can use the tool "FeatureToPoint".It will create new point based on each multipoint ,the new point is just the centre point of the two original points.The tool "FeatureToPoint" is located at "Data management tool——Feature".The version of ArcGIS is 10.X.


5

If you have a materialized view with a geometry column, you don't need to "create a spatial view" -- it's already created! At this point you have two options: Use the materialized view as a Query Layer Register the view with your enterprise geodatabase Unfortunately, in the crush to retire ArcSDE application servers and the admin utilities that let ...


1

I believe you will need to register your materialized view in SDE so that it recognizes the view as a spatial table. If that is not an option, you may want to refer to the documentation and possibly make a conventional view that accesses the materialized view, but calls the appropriate functions to retrieve the data in a fashion suitable for ArcGIS Desktop. ...


2

Yes, you can publish this tool so it can reconcile versions that are created dynamically. You need to add a couple other tools to the model though. Most of the tool parameters can/should be model parameters, this will give you the most flexibility. You should not use a parameter for the sde connection since this will be a connection on the server. The ...


0

You could request this as an ArcGIS Idea but so far, at least for me, requirements like this have been easy to meet by just opening a new MapDocument object so I suspect it would not attract a lot of votes. For example, when Selecting predefined ArcMap template using ArcPy? means a "predefined template" to be an MXD located in a Map template folder inside ...


2

I believe you should look into the Attribute Assistant which is located here: http://solutions.arcgis.com/shared/help/attribute-assistant/ - You want to set up the Autonumber Set the tool to operate "On Create" and it will find the highest number in your [number] field and populate your missing data with the next autoincremented number automatically ...


0

If you look at the syntax section of the help file for this tool, what is the output? Then look at the syntax section of the feature class to feature class tool, what is the expected input type? Do they match? This why you should be reading the help file as this explains why the tool will not connect.


1

From ESRI Mapping Center: The default symbology can be changed using the Advanced ArcMap Settings Utility. This executable file is usually found in your C:\Program Files\ArcGIS\Utilities directory. Just navigate to that directory, double click the AdvancedArcMapSettings.exe file and the ArcMap Advanced Settings dialog will open. Click the ...


3

Unfortunately, there is no such function. Save a Copy is the only possibility for now. Hopefully, ESRI will work on it.


2

Indeed, marking intermediate parameters as Managed can cause issues. Below is an example of using the Raster Calculator and then Raster to Polygon. When using in_memory the model fails; when marking the intermediate outputs as Managed, the in_memory - even though exists in the output path - is ignored and the data is written to %temp%, as the Scratch folder. ...


0

Probably your output was based on temporary data. Mark the output as a parameter so you can define the output location and make sure it is not marked as intermediate when you right click on it. Post a screenshot of your tool processes.


0

I ended up using python. If anyone else comes across this, here is some example code (you just have to merge them all together at the end). Its not the most efficient, but it works. print "" print "###############################################" print "Starting loop" for i in inds: i = str(i) print "" print ...


2

When you run Polygon to Raster, under Value field you need to specify "distance" (if you haven't changed the default of Multiple Ring Buffer). Then, the new raster will have as many unique values as there were unique distances, specified under field Value. This Value field is the one to reclassify, but until you run Polygon to Raster, ArcMap won't be able ...


1

You may use Zonal Histogram. As Input raster of feature zone data, specify your polygon(s). As Input value raster, the land quality raster. The output table will show each land quality class as a row, each polygon class as a column. Thus if you have more than one polygon, you may want to group them into classes beforehand, using a unique value for each class ...


0

The default location for geoprocessing output in ArcGIS is in a geodatabase in your My Documents folder: My Documents\ArcGIS\Default.gdb You can browse to this using ArcCatalog or Add Data in ArcMap. If you have run the tool from within ArcMap it may even have added the output as a layer inside your current map.


3

On the Geoprocessing menu, see the Results option. This will open a new window which lists the geoprocessing results from the Current Session. Right-click on the top line of the results and choose Open - this will show you the parameters which were used in the geoprocessing session, including the location of the output data.


2

I think you were adding the whole shape when you added to your array. I've changed slightly to only get part 0, and add pnt to the array with arcpy.da.InsertCursor (outFc, "SHAPE@") as iCurs: with arcpy.da.SearchCursor (inFc, "SHAPE@") as sCurs: for geom, in sCurs: for i in range (geom.partCount): part = geom.getPart ...



Top 50 recent answers are included