POST
|
I have a Unique Values layer file (.lyr) that has a couple dozen unique value symbols in it. I have been working for a while to get a python script tool to apply this symbology to an ouput from the script tool, and then put it into an active MXD. Then when it is put in the MXD, I want to be able to remove some of the symbols in the Table of Contents, while retaining all the symbology in the Dataframe. After a week of searching, I found Representations have the ability to give me this functionality, using the Legend Options menu in the Symbology tab for that Representation, pictured below. [ATTACH=CONFIG]34144[/ATTACH] Plus I found out that Representations have Arcpy functionality to create and add them to layers and such, but there is absolutely no way I can find to replicate in Arcpy the functionality the Legend Options menu gives you. This is the very last aspect of a tool I am working on at work, and this is driving me crazy. Why does ESRI not provide Arcpy functionality to manipulate every single menu option you can do in the Arcmap GUI, even the small, insignificant ones like the Legend Options on the Representation properties menu?
... View more
05-28-2014
01:21 PM
|
0
|
1
|
2330
|
POST
|
Thanks for the quick reply. So far my script is working without failing, it will be interesting to see what the results are.
... View more
04-11-2014
07:26 AM
|
0
|
0
|
818
|
POST
|
I did not know where else to put this. I have a python list of string variables from an Arc Table I made, some of which contain single quotes in the middle of them. I am trying to have a for loop iterate through use these string values in the Where Clause of a few arcpy tools. The only thing is that in a where clause, since a string value has to to be in single quotes, the single quote in the middle of the string values is throwing an error and messing up the quotations that Arcmap is reading in the Where Clause. Other than having to have an update cursor go through and remove all the quotes from the string values, is there any way to get Arcpy tools with where clauses to work with strings that have a single quotation mark in them? I have already tried escaping it with \ and r', both of which didn't work. Any ideas?
... View more
04-11-2014
05:42 AM
|
0
|
2
|
2556
|
POST
|
I am also facing a similar problem. Trying to use arcpy.makequerylayer on table with lat/long fields but no shape field.
... View more
03-14-2014
08:15 AM
|
0
|
0
|
1050
|
POST
|
I know this is an old thread, but its 2014 now and I am experiencing this exact issue, even after having 10.1 and sp1. Is this going to get corrected in 10.2?
... View more
01-08-2014
10:48 AM
|
0
|
0
|
450
|
POST
|
I noticed on another link in the ArcGIS help sections that it states parameterType is read-only. On the one I provided, it states that it is both read and write. However, I managed to figure out my own solution to my problem. The reason I didn't go with setting both of them to optional, was that when someone picks a "Polygon" type, the field I need to be enabled and required, still says "optional" by the parameter where it is entered. This is a tool that might eventually be given to clients, so this could lead to alot of confusion. I found the solution in using the .clearmessages() method and placing the logic to them under the updateMessages(self) function . My code looks like this: import arcpy class ToolValidator(object): def __init__(self): self.params = arcpy.GetParameterInfo() def initializeParameters(self): return def updateParameters(self): if self.params[0].value: desc = arcpy.Describe(self.params[0].value) feature_type = desc.shapeType if feature_type == "Polygon": self.params[7].enabled = True if self.params[7].value == "All": self.params[8].enabled = True else: self.params[8].enabled = False else: self.params[7].enabled = False self.params[8].enabled = True return def updateMessages(self): if self.params[0].value: desc = arcpy.Describe(self.params[0].value) feature_type = desc.shapeType if feature_type == "Polygon": if self.params[7].value == "All": pass else: self.params[8].clearMessage() else: self.params[7].clearMessage() return This got the tool working the way I wanted it based on what the geometry type of the first inputs. Also if parameterType is read-only, it would be nice if someone at ESRI would correct that for the link I provided in the first post.
... View more
01-06-2014
06:50 AM
|
0
|
0
|
349
|
POST
|
I am currently creating a python script tool at work that works fine, and could be even more polished if I can get certain functionality working using the tool validation. I am trying to get the tool to recognize what the the geometry type of the first input is, and based on that, set a parameter further down as a required parameter if its a "Polygon", or not required if it is a "Point". Here is my code so far: import arcpy class ToolValidator(object): def __init__(self): self.params = arcpy.GetParameterInfo() def initializeParameters(self): [INDENT]return[/INDENT] def updateParameters(self): if self.params[0].value: desc = arcpy.Describe(self.params[0].value) feature_type = desc.shapeType if feature_type == "Polygon": self.params[7].enabled = True self.params[7].parameterType = "Required" self.params[8].enabled = False self.params[8].parameterType = "Optional" elif feature_type == "Point" or "Multipoint": self.params[7].enabled = False self.params[7].parameterType = "Optional" self.params[8].enabled = True self.params[8].parameterType = "Required" [INDENT]return[/INDENT] def updateMessages(self): [INDENT]return[/INDENT] I have gotten it to recognize the geometry type of the first input once someone sets it. When its "Polygon", it will disable parameter[8], and when its "Point", it will disable parameter[7]. My problem is with with trying to toggle the parameterType property of a Parameter object, as suggested http://resources.arcgis.com/en/help/main/10.1/index.html#//018z00000063000000 here. It says that the parameterType property is both read and write using tool validation. For whatever reason, I cannot get it to work. Ultimately, if the input geometry type is "Polygon", I would like parameter[7] set to parameterType "Required" and parameter[8] set to disabled. If the input type is "Point", I would like parameter[8] set to parameterType "Required" and parameter[7] set to disabled. Any help is appreciated.
... View more
01-04-2014
09:24 AM
|
0
|
2
|
3641
|
POST
|
Ah, Makes sense now. It has been the interpolation method that has so far made contours that best matched the data. I will have to fiddle with IDW more then.
... View more
10-04-2013
05:59 AM
|
0
|
0
|
1026
|
POST
|
Are you talking about : "If the cell center of the perimeter cells of the output raster fall outside the convex hull (defined by the input points), then those cells will be assigned NoData values. If an input point falls within one of these perimeter cells and the cell center falls outside the convex hull, the cell will still be assigned a value of NoData." ??? How would I use this to enlarge the processing extent of my points?
... View more
10-04-2013
05:13 AM
|
0
|
0
|
1026
|
POST
|
This is understood, the boundary I am trying to extrapolate to is not far beyond the point extent. I realize that data beyond the points will be filled will error. I have tried setting the processing extent to all sorts of things and cannot get a different result.
... View more
10-03-2013
05:46 PM
|
0
|
0
|
1026
|
POST
|
I have a polygon shapefile of an oil basin, and a point file of sample points that fall within the polygon. I am using Natural Neighbor to try to interpolate a z-value from the points, but every time i run it, it only produces a raster to the edges of the points. I am trying to get it to interpolate to fill up the entire polygon of the basin. I have heard you can interpolate beyond the extent of sample points, but I cannot get it to work. I have tried everything including setting the raster processing extent to that of the polygon extent, and setting the polygon as a mask in the environment settings of the Nearest Neighbor tool. This video describes what Ive tried starting around the 6:25 mark. This is for a big map project I am struggling with at work. Any help greatly appreciated.
... View more
10-03-2013
05:39 PM
|
0
|
6
|
4884
|
POST
|
[ATTACH=CONFIG]27122[/ATTACH] Here is the map example I'm trying to replicate.
... View more
08-30-2013
11:25 AM
|
0
|
0
|
153
|
POST
|
I have a raster layer I interpolated from when I ran the Getis-Ord_Gi* Hotspot tool. My bosses at work really are interested in me trying to get it to resemble the map pictured here . They want the higher value clusters to be displayed like the "islands" shown in the example, but also have all the other values not visualized. I really just cant figure out how I can symbolize a few parts of a raster, but not the lower values at the same time to achieve this "islands of heat" effect. Any suggestions?
... View more
08-30-2013
10:38 AM
|
0
|
3
|
384
|
POST
|
I have a school project where I am trying to alter the visibility of certain layers when people click on various parts of an accordion pane in my application. I have it set up to where when an accordion pane panel is clicked, the ID of that panel is recognized and it will reference the updateLayerVisibility function I am trying to get to work. My question, is how do I get the updateLayerVisibility function to recognize the array of layers IDs I have set for by a variable in the function I have that recognizes the clicking of a certain accordion pane panel? The updateLayerVisibility function I am trying to get to work can be found here, under map and then toggling layer visibility.
... View more
11-29-2012
03:16 PM
|
0
|
0
|
510
|
POST
|
From what I read on ESRI desktop help, I decided that bilinear interpolation is the best for resampling elevation data. Does anyone have a link to a good paper about resampling DEMs that I could cite?
... View more
02-03-2011
01:37 PM
|
0
|
0
|
310
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|