|
POST
|
Technically all the arguments are optional so this would return something even with no arguments(see the example code in the help), as long as the workspace environment was valid and contained feature classes.
... View more
05-19-2017
07:13 AM
|
0
|
1
|
1945
|
|
POST
|
It looks like those are the only two remaining that still have some curve in the text to make them fit. The rest the text is straight so it is able to create a single rectangle around them.
... View more
05-18-2017
01:17 PM
|
0
|
2
|
1967
|
|
POST
|
By the way, if you need any help trying to write any of the code let me know I'd be glad to help out with it.
... View more
05-18-2017
11:30 AM
|
2
|
0
|
3210
|
|
POST
|
Maybe just using a white mask instead of a background would be more appropriate in this instance.
... View more
05-18-2017
11:29 AM
|
0
|
0
|
1967
|
|
POST
|
I'm not sure within the Apply Symbology from Layer Tool you can specify the field. From the Apply Symbology from Layer "The field in the Input Layer that will be displayed must have the same name as that of the corresponding Symbology Layer field. If this field is missing, the output data is drawn with default symbology." "You can name a field in the Input Layer to match the Symbology Layer field name using the Make_Feature_Layer tool." Hence why I suggested a work-around of use Make Feature Layer.
... View more
05-18-2017
10:52 AM
|
2
|
0
|
3210
|
|
POST
|
Do you have your enivronment set to add the output of geoprocessing operations to the map? When you run within a map document, the environment variable for addOutputToMap is probably already true, but may not in your standalone script. http://pro.arcgis.com/en/pro-app/arcpy/classes/env.htm Also, are you trying to just create a new layout element from the graph, or trying to overwrite the path of the old layout element with the old graph to the path of the new graph? /blogs/dan_patterson/2016/08/14/script-formatting?sr=search&searchId=d57231b1-81e4-474b-9b40-0152b23446b8&searchIndex=4 for future reference when posting code.
... View more
05-18-2017
10:42 AM
|
1
|
1
|
1740
|
|
POST
|
Thanks for the additional information. "I wonder if there's a way to code which RGB value each class 1-13 should be?" Not with arcpy, unless you want to get into ArcObjects from my understanding "It changed the symbology to match Map00002 polygons, but it did not use the .lyr file symbology. It used the first color ramp available in the pulldown in the symbology tab of layer properties." I just tested this, changing the value field to another field with the same values for my dataset, but I was hoping without addallvalues() it would keep the same symbology, but unfortunately it does not. Once you change the field it removes the old symbology. There are some ways around this of course but will take a fair bit more of coding. The limit of the .lyr file is that it is designed to work off a single field, and in your case you have 1000 fields you want to symbolize with in turn. One way would be to use the make feature layer tool, delete all the fields in that output feature layer but the one you want to symbolize off of, then rename that field to the one used in the .lyr file and turn off the existing layer on the map. In theory that could do what you need. It would require writing a new field info object each time to use in the make feature layer. http://desktop.arcgis.com/en/arcmap/10.3/tools/data-management-toolbox/make-feature-layer.htm#ESRI_USAGES_C58B9EFE094A48539F3A525C0C08C879 http://pro.arcgis.com/en/pro-app/arcpy/classes/fieldinfo.htm Another would to make a copy of the dataset you are using, then read the values for each of the fields into memory, then use an update cursor to overwrite the field the values in the field used by your symbology .lyr with the values from the other fields one at a time (Don't want to ruin your original dataset). I'd probably write them to a dictionary and use that with the update cursor to overwrite the field values http://desktop.arcgis.com/en/arcmap/10.3/analyze/arcpy-data-access/updatecursor-class.htm /blogs/richard_fairhurst/2014/11/08/turbo-charging-data-manipulation-with-python-cursors-and-dictionaries?sr=search&searchId=662b5725-3090-4fc8-a327-e72c3cde4fb4&searchIndex=0 Anyone else with suggestions? Dan_Patterson, xander_bakker, bixb0012, rfairhur24
... View more
05-18-2017
10:08 AM
|
2
|
3
|
3210
|
|
POST
|
A layer file usually has the symbology based on either the feature itself or a specific field. I'm not sure how a single layer file could possibly take care of what you are needing it to do, since you would only be able to select a single field, not iterate over them. You quite literally would need a layer file for each field to do things as you are currently proposing. http://desktop.arcgis.com/en/arcmap/10.3/tools/data-management-toolbox/apply-symbology-from-layer.htm "The field in the Input Layer that will be displayed must have the same name as that of the corresponding Symbology Layer field. If this field is missing, the output data is drawn with default symbology." Actually I see you used updateLayer, but see this line "Depending on the renderer (for example, unique value using a particular attribute), the attribute definitions also need to be the same. " A possible solution for you to look into is to use the Unique Values Symbology Class with your feature class layer(Assuming you are using unique values). Once the symbology has been applied from the layer file(you should only need to do this once), you can switch which field is used for the symbology, but since you are using the same 1-13 values for each field, it may carry the symbology over when you set the new field for symbolizing. http://desktop.arcgis.com/en/arcmap/10.3/analyze/arcpy-mapping/uniquevaluessymbology-class.htm See example 1 about how to access and change the symbology field. I've never tried this or tested it, but I think it would work for you. Any additional information about the type of symbology you are using, example of the output of your script, and how your layer file is set-up would be useful if that doesn't work. Also if it does work, please make sure to Refresh the active view prior to each export. http://desktop.arcgis.com/en/arcmap/10.3/analyze/arcpy-functions/refreshactiveview.htm Edit: Similar threads relevant to question https://community.esri.com/thread/79316 https://community.esri.com/thread/64140
... View more
05-17-2017
03:12 PM
|
1
|
5
|
3210
|
|
POST
|
I think this was more of an issue where the OP was using arcpy to zoom to a select feature of a single point and not getting a scale that worked with what he was trying to do. The behavior was replicated by the behavior within an ArcMap session when zooming to a single point. It would be interesting to do something like zoom to only selected feature for a point, where it calculates the maximum extent that would only include the selected point and not contain any other points. Conversely, you could write a script to calculate the extent of the whole point set and divide by the count of all the points in the dataset(I think just from a cursory glance at zooming to single points of a larger point set, it zoom to ~1/20th the original scale I haven't explored much at all if there is variance based on how dense/diffuse the dataset is), giving you a more representative fractional zoom with respect to the density of the data, instead of just the base zoom to selected feature where you have no control of it. Again depending on the purpose their is such subjectivity on what scale or extent would be "correct" for the purpose there really is no one size fits all solution.
... View more
05-15-2017
08:38 AM
|
0
|
0
|
3286
|
|
POST
|
Someone else recently had this issue and it was solved by creating the new mosaic in a regular folder then moving the resultant raster back to the gdb. https://community.esri.com/thread/194308-toruble-with-lidar-data-and-using-the-tool-mosaic-to-new-raster-with-multiple-images
... View more
05-11-2017
06:21 AM
|
1
|
1
|
2641
|
|
POST
|
You could just turn the list into a string, then remove the brackets and then use that string in the expression..... print str(toplist).strip("[]") returns: 328585, 568494 Either way this is a silly amount of work for what should be something very straightforward.
... View more
05-04-2017
03:06 PM
|
0
|
0
|
1710
|
|
POST
|
Yea I just realized I made a tuple not a list when testing multiple values......
... View more
05-04-2017
02:59 PM
|
0
|
1
|
1710
|
|
POST
|
I printed that query out and it doesn't keep the parentheses for the list, so the IN function doesn't work. Try this maybe: query = "\"{}\" in {}".format("Pop_MAX", "({})".format(toplist)) returned this for a single value "Pop_MAX" in (328585) and returned this for multiple "Pop_MAX" in ((328585, 568494)) The trick of it is to keep the toplist in parathenses regardless of if it is a list or not in the SQL expression. If you end up with the extra set of parentheses it shouldn't be an issue, but better than not having a single set.
... View more
05-04-2017
02:51 PM
|
1
|
4
|
1710
|
|
POST
|
I would run the check geometry and it will tell what the geometry problem is. You can repair the geometry using the repair geometry tool on the input dataset. You may wish to make a duplicate dataset to test the repair on first(not that it should cause an issue, but just in case as it does edit your existing dataset). I haven't directly run into reasons for bad geometries being created, but you can read this help on checking and repairing geometries that should take care of things. http://desktop.arcgis.com/en/arcmap/10.3/tools/data-management-toolbox/checking-and-repairing-geometries.htm
... View more
05-04-2017
02:34 PM
|
1
|
1
|
418
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 02-22-2017 08:58 AM | |
| 1 | 10-05-2015 05:43 AM | |
| 1 | 05-08-2015 07:03 AM | |
| 1 | 10-20-2015 02:20 PM | |
| 1 | 10-05-2015 05:46 AM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:23 AM
|