Tag Info

New answers tagged

0

I can't find a recent example of this, or an example in C#, but you can call any tool in your toolbox (including custom models) via ArcObjects. This older example in VBA provides the basic structure for this process. EDIT: This more recent example makes use of the modern geoprocessor to call a custom toolbox and execute a tool. There are VB and C# ...


2

I did a presentation a few years ago where I developed a tool to take GPX points and create a line featureclass by rows where the speed is indicated as an attribute. You can symbolize the output by that field in ArcMap. Natural breaks seems to symbolize it well. I just uploaded the tool to arcgis.com, you can download it here. After you get the line, you ...


0

So I haven't completed the solution, yet, but it looks like you can use this tool: Conversion > JSON > Features to JSON. This will convert your shapefile (in my case 81 polygons) to a JSON file. You can open this with a text editor to see that, indeed, all the vertices are listed for each polygon. Further, the python standard library (import json) ...


1

The block comment /../ seems to work as long as you have something in your definition query. If you comment everything out, you need to put a 1=1 before your commented out lines Examples: All commented out: 1=1 /* and ASSIGNMENT_STATUS <> 'Closed' and DEVICE_TYPE = 'device' and ASSIGNED_TO = 'somebody' */ 1 uncommented, 2 ...


3

Just incase you don't have Advanced licensing, or Spatial/3D Analyst extensions, I've created a geoproccessing tool that will generate random points within a polygon boundary with the ability to set a minimum distance between points. You can download the toolbox, and see the source code here: click me Here's a screenshot of the parameters: You would ...


1

You can use the For iterator tool to run the Create Random Points tool ten times. Within the Create Random Points tool, specify a minimum distance of 50m, 2 points, and your polygon feature class. Make sure to connect the For iterator to the Create Random Points tool as a precondition.


1

XTools pro, a non-ESRI add-on has a feature that enables to toggle a definition querry on/off on a layer. Very useful. You can also copy/paste your defintion query in the Layer properties "General" tab. There is a window there for "Description" that is often unused. I often copy/paste my definition queries in there when I need to turn them off. There are ...


0

I do not know of a good address locator but you could try Google's Geocoding service via Python: import urllib import json GOOGLE = 'http://maps.googleapis.com/maps/api/geocode/json?' def google_geocoder(query, from_sensor=False, googleGeocodeUrl=GOOGLE): """use google geocoder to get coordinates from adddress query -- address to geocode """ ...


0

I realized my mistake and figured the way out. Mistake: My point data was in a csv file. Since I wanted my distance to be in meters, while converting csv to shp, I was straightaway choosing a projected coordinate system (PCS). Probably, the ArcMap was not able to define a spatial reference and hence was locating the points far away from where they actually ...


1

ArcGIS does not include tools to detect corrupt geometries because it is not possible to create them (short of hacking the SDE metadata tables). Native SQL types can create corrupt geometries, if ArcGIS is not used in the pipeline, but then there are native tools to detect and repair or delete those same corrupt geometries, so no Esri tools are needed. A ...


2

@PolyGeo's answer is accurate. But I just want to draw attention to the use of table views in the original case; they shouldn't be necessary. Code could be simplified down to something like this: import arcpy import os arcpy.env.workspace = r'C:\Parishes\Cameron.gdb' parish = "Cameron" # use other folder as needed out_folder = arcpy.env.scratchFolder ...


3

As a test I suggest trying to change: outname = str(fc) + parish + ".xls" to outname = 'C:\\Parishes\\' + str(fc) + parish + ".xls" I suspect that trying to write a *.xls to a *.gdb (even though that is a folder) is what may be upsetting the tool.


1

Here is my solution... open in arcmap the suspect layer. zoom to the entire dataset. make it the only selectable layer (if there is more than one) start editing make a selection box around all of the features switch the selection you now have all the <NULL> geometry rows in the sde table. delete


0

If you use the Describe method on a mosaic dataset then all it's properties are read only. If you get a handle on the Mosaic dataset as a layer object then according to Help if the SymbologyType property returns OTHER then the layers symbology cannot be altered. The following code returned OTHER for a mosaic dataset I have so I guess you cannot change it? ...


0

A solution is to write a python script/tool to compare on one or several fields, which prints every difference found (field values or shape difference).


1

You could have the add-in enable or disable depending on the name of the mxd by putting a boolean test in the OnUpdate() sub. If My.ArcMap.Application.Document.Title = Authorized.mxd Then Enabled = True, or something like that. You could also require a user to enter a password and have each add-in on your toolbar query the result in its OnUpdate() and then ...


1

The most reliable way to do this in ArcMap is to use the Table to Excel (Conversion) tool, making sure the Use field alias as column header checkbox is checked: How column names in the output are determined. NAME —Column headers will be set using the input's field names. This is the default. ALIAS —Column headers will be set using the input's ...


0

USPS recognizes not 12 but close to 200 possible street suffixes, plus there are countless possible misspellings of them. With real life data that is not 100% clean and standardized, you will have a better luck with an address validation API, such as YAddress (made by the company I work for). After correcting and standardizing the address, YAddress breaks ...


2

If you want code in an add-in like a button to be available when it is loaded rather than when it is clicked, in the Config.esriaddinx file add onDemand="false" to that button's xml. You can also use an Extension class to execute code during its OnStartup(). Create the extension, and in the Config.esriaddinx file, add autoLoad="true" to its xml.


0

This is more or less a complete rewrite of my original answer; I was incorrect about what I thought the OP was asking. Given some of the additional information, I would recommend doing something like the following. You could enter it in the python console, or just make a standalone script on the desktop and run it with idle. import arcpy ...


1

The caching tools that exist in the ArcToolbox on Desktop simply make calls to the Caching tools that have been already published on the Server. If your workflow involves updating a cache through these tools, simply call the tools on Desktop, or call the already published tools on the Server. Publishing these tools as their own GP Service introduces an ...


0

The KML did not want to have the 'CellID' as a naming convention, a simple change to 'Name' worked just fine.


2

using Arcmap 10.1 you can use an alternative option: add your all geo-refed raster in a new arcmap define the projection properly in the data frame properties Go to windows menu and click on image analysis. In image analysis tool select all your rasters and click on mosaic button present in a window below named "processing". A temporary raster add in table ...


1

Mosaicking non georeferenced images using ArcMap may not be possible at all. I Suggest you use online base-maps if you know the locality of the images, look for duplicate points from the image and an online base-map then use those values to first georeference so that you can Moiasack


0

In the table of contents window, when you activate a certain data frame, anything that you do thereafter will correspond to that specific data frame contents. If you add anything it will belong to the activated frame. This might help you in knowing to which data frame will your scale bar belong to when you add. If you have few data frames you could remove ...


1

The suggestion by @MichaelMiles-Stimson is a good one. Alternatively, you could type some code into the Python window of ArcMap: mapDoc = arcpy.mapping.MapDocument("CURRENT") scaleBar = arcpy.mapping.ListLayoutElements(mapDoc,"MAPSURROUND_ELEMENT")[0] print scaleBar.parentDataFrameName If your scale bar is the only Map Surround Element in your map then ...


0

As you have access to Arcmap or ArcCatalog, Use Project tool to simultaneously project your shape files to another coordinate system and importing them into your enterprise geodatabase!


0

The workaround sometimes doesn't work after you add values and group categories. You need to click ok, then go back into the Layer Properties and then ArcMap will now let you calculate the counts by clicking on the Count heading.


3

You do not need the [0] brackets here on this statement: if photolink[0][:4] == "http": That would return "h" only and not "http" TRY if photolink[:4] == "http": The new arcpy.da.UpdateCursor in v10.1 and greater uses bracket indexes to relate to defined field(s) and also is faster since it does not iterate over each fc field. with ...


1

The code presented in your question doesn't match what is asked for in the question. "I'm trying to label certain features using a specific field (osm_name_58_en). However, when this field is null, I want to label the feature with (som_english_32_name). If both are null then I want to label with the (amenity) field." This sentence implies that you only ...


3

The Correct form of your code is : def FindLabel ( [amenity], [osm_english_32_name], [osm_name_58_en] ): if not ([osm_name_58_en] is None): return [osm_name_58_en] elif not([osm_english_32_name] is None): return [osm_english_32_name] + '\n' + [amenity] else: return [amenity] The semicolon in the last line is removed. ...


0

you can use quick import tool in data interoperabilty toolbox to covert your data to arcgis geodatabase then expot those feature class to shape file.


1

If you specifically want a single elevation (or specific elevations) as lines you can use Contour List (3d analyst, Spatial analyst). Unlike Contour (3d analyst, Spatial analyst) which creates contours at a specific interval the contour list tool produces contour isolines at specific elevation values.. for this example you would supply the value 0 for ...


0

Thanks Jim! That was the problem. I went back and adjusted all the field names by removing the spaces between and was able to load the data without any problem :)


0

I reviewed the log file and noticed that the translation log after reading C:\Users\Dell\Desktop\POWIERZCHNIE\Dotyk\Powierzchnie_dotyk.tab is incomplete. I am unable to see if this was successful or it failed! ( I assume you have posted the complete log). Can you try inspecting this data (C:\Users\Dell\Desktop\POWIERZCHNIE\Dotyk\Powierzchnie_dotyk.tab) using ...


0

Here http://www.geol-gis.ch/en/dt-dipping-plane you will find information about a tool that creates a 3D square plane of determined orientation, dip and width, at determined coordinates. The output is a 3D polygon.


4

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 ...


0

You need a subtle change to your model. See the image below: Configure Expression parameter of Calculate Value like this: Set Output Dataset or FeatureClass parameter of Project tool to %output_value%


1

For anyone who is interested, I just learned a really quick way to do this. Zoom into the area / extent you are working with > open image analysis window > click the clip tool under processing. A layer will be added to the map of the area in the extent when you performed the clip function.


1

I want to offer an alternative solution following up on your last paragraph, which is easily accomplished in a single analysis without the need for iteration or even Model Builder unless you wish to repeat it many times. You cannot use the Near tool in this case, as that only returns the closest feature. You could use the Generate Near Table tool with an ...


1

I would recommend to build a simple model to iterate through all rasters in your workspace and then convert each of them to Polygon. To add an iterator, In model builder go to: Insert > Iterators > Rasters You final model should look like this: and your Calculate Value Should look like this: The code block: def t(s): return ...


1

As far i can recall, you can select all table from this batch tool and copy into microsoft excel and modify input parameters of the tool in excel (apply some excel formula to change the output to lessen manual labor). After that you can select all in the tool and paste this excel rows back into the tool.


2

If you are running the tool outside of ArcGIS session, in Python (or when in the Python window and the extension has not already been enabled), you will need to check out an ArcGIS Spatial Analyst extension license before running a tool. You do it with: arcpy.CheckOutExtension("Spatial")


3

To do this I would use two tools: Intersect (Analysis): Computes a geometric intersection of the input features. Features or portions of features which overlap in all layers and/or feature classes will be written to the output feature class. then Summary Statistics (Analysis) Calculates summary statistics for field(s) in a table.


0

I tested this on 10.3 and got the same result you did. The lines show up in layout view, but not once you export to pdf. It's possible that one of the settings in the export pdf options (and the slightly different arcpy.mapping options) causes this to happen, particularly something to do with compression. I didn't feel like testing them all because I use a ...


1

The problem you have apparently run into here is character encoding. Particularly when moving between programs and fonts as your Excel > Word > Arc pasting does, and single quotes are one of the worst characters for this issue. ` (upper left standard keyboard) and ' (next to Enter standard keyboard) are two different characters. Likely your 'shorter' quotes ...


2

So I got it to work finally. The image was read only so I couldn't define spatial reference. Having fixed that the only work to be done with the available image was to define its coordinates and projection. So had to create a custom coordinate system with GCS Moon 2000 and Mercator projection (sphere). And voila no need for tedious georeference or Project ...


3

The way I have done this in the past is to put the code to close the window in the close document event. So you need to set up a document event handler to catch the close document event: Private m_CloseDocument Private Sub DocumentEventsHandler(ByVal doc As IMxDocument) If doc is Nothing Then Return End If Dim documentEvents = ...


0

I have found a solution to my problem. I spent quite a bit of time trying to find the solution to the 64 bit problem. Instead, I installed 32bit version of QGIS v2.8.2 and now it works perfectly. Perhaps just a version error. This fixes the solution. 32bit it is.


2

This kind of task is best approached by using the tool validator; you can set value of a parameter by reading another parameter's value (and listing feature classes from the workplace user specified). def updateParameters(self): if self.params[0].value: self.params[1].value = #ListFeatureClasses code else: If you want to populate a parameter with ...



Top 50 recent answers are included