POST
|
I've been communicating back and forth with ESRI and they finally came up with an answer: it seems to be a bug in the arcpy API, which shall be fixed with ArcGIS 10.5 (pre-release already available). As soon as I can confirm this, I will post it here. From what ESRI told me, there is no workaround for versions lower than 10.5 except for manual adjustment.
... View more
11-08-2016
12:46 AM
|
0
|
0
|
246
|
POST
|
Hi Dan, you're right, you can not set the outline of polygons using arcpy (a major, issue, from my point of view). It is also correct that the initial class break values rely on the reference layer unless you call the reclassify-method. However, the behaviour I'm struggling with occurs whether I use UpdateLayer or ApplySymbologyFromLayer. I think it is a general problem with arcpy, and even the ESRI-folks have not found a probable solution so far.
... View more
10-20-2016
04:25 AM
|
0
|
0
|
246
|
POST
|
Hi all, I'm struggling with an issue which I think is a bug in arcpy. I'm using AddSymbologyFromLayer_management to apply the symbology from a reference layerfile (yes, an actual layerFILE, not a layer within the mxd) to a newly created polygon shapefile which is displayed as a layer. This works fine, even when I change the field the symbology shall be based on. However, when I also change the class breaks (I use GRADUATED_COLORS here), the outlines, which are set to "No color" in the reference layerfile, are set back to default, which means some kind of grey with 0.4pt width. This behaviour only occurs when I change the class breaks via code, if I keep them as they are, everything is fine. This is what I basically do within the code: # get reference layer
ref_lyr_file = os.path.join(workspace, 'styles', 'graduated_colors_reference_style.lyr')
# get newly created layer
new_lyr = arcpy.mapping.ListLayers(mxd, lyr, mapDF)[0]
# import symbology from reference layer-file
arcpy.ApplySymbologyFromLayer_management(new_lyr, ref_lyr_file)
# set value field
new_lyr.symbology.valueField = draw_param_dict[draw_parameter]
# reclassify values
new_lyr.symbology.reclassify()
breaks = new_lyr.symbology.classBreakValues
# round values nicely as new class breaks
lenMin = len(str(int(breaks[1])))
new_breaks = [int((round(b / (10 ** lenMin), 2)) * (10 ** lenMin)) for b in breaks]
# update map document
new_lyr.symbology.classBreakValues = new_breaks
arcpy.RefreshTOC()
arcpy.RefreshActiveView() How I create the new breaks is not important, so you can skip this section. The thing is: the polygon outlines are set back to the default color ONLY AFTER applying new class break values. Does anyone know how to get around this? Thanks for any help
... View more
10-20-2016
02:02 AM
|
0
|
3
|
929
|
POST
|
I'm doing this to get rid of the connection (I'm using an engine, not the connection itself): engine.dispose()
del engine From my understanding, this should do the job (an engine has no particuclar method .close()).
... View more
08-09-2016
07:56 AM
|
0
|
5
|
780
|
POST
|
The parameters set are the server and database from which the data shall be read, paths and some text for the map title as well as the exporting format. Nothing special there. I honestly have no idea what the 'lowercase' issue means, it occurs somewhere whithin the pandas module when executing the SELECT-query. To me, it seems like the pandas module opens the connection, defines a cursor object and then goes through the columns provided by the SELECT-query. For the first time, everything is perfectly fine. When I run it a second time, it seems like the cursor-object is not overwritten, but appended to the first one, which causes the object to be a tuple. I don't know I'm right here, and the worst part: I have no clue how to get rid of that problem.
... View more
08-08-2016
12:44 PM
|
0
|
4
|
1274
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|