Tag Info

Hot answers tagged

5

You must write an ArcMap Addin Extension. In the extension, listen to DocumentOpened event and from there, show your form. Useful Link To create the extension, use Arcgis visual studio template. Then change SetupEvents method like this: private void SetupEvents() { m_docEvents = ArcMap.Document as IDocumentEvents_Event; ...


5

Your output dataset has the same name as your input dataset. Try setting a different workspace for the output, like: outWorkspace = "C:\\users\\data\\shapefile_roads_projected"


5

You would use .split method for this. inStr = "1753 21ST ST 2ND FLOOR" result = inStr.split(' ST ') print result >>>['1753 21ST', '2ND FLOOR'] Keep in mind that result is the list which you would need to iterate if you want to get hands at individual element of the address. If you will need to work with the address items in a more advanced way, ...


4

Per the help file: Hard and soft qualifiers for line and polygon feature types are used to indicate whether a distinct break in slope occurs on the surface at their location. A hard line is a distinct break in slope, while a soft line will be represented on the surface as a more gradual change in slope. See also this KB article, which provides ...


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


3

The classes seem to contain the values you want to display but have also ultra high ones. I have not a exact solution to your problem but some hints you could try. Add the .csv file to ArcMap and export it as .dbf before joining. Add the .dbf to your workspace and try the join with this file Alternatively open the .dbf files in excel and check if these ...


3

According to the metadata on the data's source webpage, there are latitude and longitude values for the image which means you need to georeference it (if it isn't already) using those values. For the longitude values, I would switch to a +/-180 range, rather than a 0 to 360 range. So for the upper left longitude of 332.26, I would use -27.74 instead. ...


3

Set Data source Tool you run in ArcGIS Desktop is not available directly as a GP tool. The exact logic behind it is not exposed to the end user. You can do that what this tool does in arcpy (with more advanced options): Updating and fixing data sources with arcpy.mapping (arcpy.mapping). The arcpy function that is the closest in terms of functionality is ...


3

You could run this within the Python window of ArcMap: counties = str([str(row[0]) for row in arcpy.da.SearchCursor("YourLayerName", ("CNTYPROPER"))]) cleaned = counties.replace("[", "(").replace("]", ")").replace("'", '"').replace(" ", "") print cleaned


3

I would do the manipulation directly in R. require(rgdal) # Read shapefile shp = 'X:/path/to/your/shapefile.shp' myshp = readOGR(shp, layer = basename(strsplit(shp, "\\.")[[1]])[1]) # Extract the attributes as a data frame df = data.frame(myshp) # Extract a specific field from data frame field = df$CNTYPROPER


3

Well, the error message is pretty straight forward: ERROR 000670: output Output Dataset or Feature Class is same as input Input Dataset or Feature Class Failed to execute (Project). The infc and outfc variables both point to the same feature class. One easy fix would be to output into a different folder. So, create a new folder called "projected" ...


3

The call to SelectLayerByAttribute could be handled like this: ARCPY.SelectLayerByAttribute_management('cities', "NEW_SELECTION", "CITY_NAME = '{}'".format(city))


3

Here's an example of how you could get the area using a search cursor: polygon_layer = "C:\\Polygon.shp" with arcpy.da.SearchCursor(polygon_layer, ("OID@", "SHAPE@")) as search_cursor: for row in search_cursor: oid = row[0] geometry = row[1] print "OID {0}: area is {1}".format(oid, geometry.area)


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


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.


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


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.


2

Use the Dissolve (Data Management) tool, select your number and material fields, then click OK. I'm not sure if the lengths will be added, but a simple "Calculate Geometry" length should fix that.


2

To do this use Summary Statistics with a Case Field: • A field will be created for each statistic type using the following naming convention: SUM_, MAX_, MIN_, RANGE_, STD_, FIRST_, LAST_, COUNT_ (where is the name of the input field for which the statistic is computed). The field name is truncated to 10 characters when the output table is a ...


2

There are 2 ways of doing this Advanced ArcMap Settings Go to C:\Program Files\ArcGIS\Desktop10.0\Utilities\AdvancedArcMapSettings.exe (Depending on what version of ArcGIS you are using) Go to the System paths tab Click on the browse button for Templates path Browse to the folder location Click Apply Registry Key Create a Registry Key for the key ...


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

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


2

Either the WGS 1984 in the original raster, or in the target UTM doesn't match Esri's definition of WGS 1984. It's probably one of the names. If it's the original raster, try using the Define Projection tool to reset it to Esri's WGS 1984 definition. If it's the output coordinate system, try using Esri's version instead.


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


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")


2

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


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


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.


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


1

Image services such as these do not perform at full capacity unless your dataframe is in the same projection as the image service. To rectify the situation make sure your current data frame is set to the SouthAfrica_Albers_Equal_Area_Conic projected coordinate system. Once you do that, you will find the image service is quite snappy. Right click the ...



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