|
POST
|
Good pickup on the missing "for lyr in layers" statement. The code was a cut down of a larger script and I missed copying the first line of that section so that's all good. I'll give the "if HTL_lyr.name in HTL_layerl_list:" section a try and see what happens. Thanks!
... View more
09-16-2018
05:12 PM
|
0
|
0
|
2811
|
|
POST
|
Hi All. I'm trying to run the below python code with no luck. The 2 layers listed on line 20 are referenced again on line 37 when I attempt to cycle through their extents. The code should pull the extents and apply them to the data frame. The issue is that the list at line 20 won't work unless there are no spaces in the layer names. If enclose the names in "..." then the code is "syntax error free" but fails at line 37 when trying to extract the extent of a string object instead of a layer. How can I work around this (would prefer to not have to rename my layers in the mxd!). import arcpy
from arcpy import env, mapping
from bisect import bisect
#input parameters;
Plantation = arcpy.GetParameter(0)
ForestID = arcpy.GetParameter(1)
CommonName = arcpy.GetParameter(2)
PYear = arcpy.GetParameter(3)
OpCode = arcpy.GetParameter(4)
#variables;
title1 = Plantation + " PLANTATION"
title2 = Plantation + "\r\nPLANTATION"
title3 = Plantation + " (" + CommonName + ")"
title4 = Plantation + " P" + PYear + " AREA STATEMENT"
mxd = mapping.MapDocument("CURRENT")
elements = mapping.ListLayoutElements(mxd)
layers = mapping.ListLayers(mxd)
HTL_layer_list = ["Entered In GeoMaster", "Entered In GeoMaster Archive"]
dflist = arcpy.mapping.ListDataFrames(mxd, "")
opcode_exp1 = "EnteredInGeoMaster IS NOT NULL AND Ops_Code = '" + OpCode + "'"
opcode_exp2 = "Ops_Code = '" + OpCode + "'"
if lyr.name == "Entered In GeoMaster":
lyr.definitionQuery = opcode_exp1
arcpy.AddMessage(lyr.name + " definition query updated")
elif lyr.name == "Entered In GeoMaster Archive":
lyr.definitionQuery = opcode_exp2
arcpy.AddMessage(lyr.name + " definition query updated")
# get current map extent
xmin, xmax = dflist[0].extent.XMin, dflist[0].extent.XMax
ymin, ymax = dflist[0].extent.YMin, dflist[0].extent.YMax
# loop through def query layer extents and create one extent to fit them all
for HTL_lyr in HTL_layer_list:
HTL_ext = HTL_lyr.getExtent()
if HTL_ext.XMin < xmin:
xmin = ext.XMin
if HTL_ext.YMin < ymin:
ymin = ext.YMin
if HTL_ext.XMax > xmax:
xmax = ext.XMax
if HTL_ext.YMax > ymax:
ymax = ext.YMax
# set df extent to new extent
dflist[0].extent = arcpy.Extent(xmin, ymin, xmax, ymax)
... View more
09-14-2018
12:29 AM
|
0
|
5
|
3003
|
|
POST
|
Looks like the short answer is not really. It appears to not be a tool that's available in the Toolbox but rather a menu item, so no anatomy to examine. Might have to send this one to an ESRI contact.
... View more
09-02-2018
09:10 PM
|
0
|
1
|
1741
|
|
POST
|
Is it possible to access the "Create Local Copy for Editing" and "Synchronize Local Edits with Server" functions using python? I have a tool that transfers data from one AGO layer to another but has manual steps requiring the user to download local copies of both layers, run the tool and then synchronize both layers again. Making a local copy of a feature service for editing—Help | ArcGIS for Desktop I would like to be able to automate the download/upload part of the process too as it happens at a set extent each time so is predictable. Is this possible? I can't see anything from my Googling and searching of GeoNet.
... View more
09-02-2018
07:06 PM
|
0
|
6
|
2092
|
|
POST
|
We have layer file setup that uses Unique values to create the Symbology. We currently edit the Label of each Symbol to include an Area amount in the legend next to each symbol. This layer changes from time to time though and the labels need to be manually edited to reflect the new Area totals. Is there a way to import labels based on the unique values used to categorise the symbols (using Python maybe?). If this is possible, then when the total area changes for a given value, we could rerun a script that would calculate the total area for each value, concatenate the value and area text before importing the text as the new label for the corresponding value in the Symbology. The main reason for this is that we don't want to have to redo the "Add All Values" and lose the customised colour schemes setup. William kalande
... View more
07-03-2018
06:45 PM
|
0
|
0
|
654
|
|
IDEA
|
I've just been looking around to see if this functionality was included. Apparently not. I hope it is in the future as it would be a great little feature to have extended to labeling! Trying to make my first Vector Tile Basemap and finding all these great tools.
... View more
01-23-2018
10:46 PM
|
3
|
0
|
6068
|
|
IDEA
|
I was thinking the same thing just yesterday when trying out WebApps for the first time. An overview map that only uses Aerial Imagery is fine for showing a large area within a country with sea borders, bit doesn't provide many useful references when looking at smaller areas only on land. Roads and Town names or custom layers would be a minimum.
... View more
01-08-2018
09:10 PM
|
1
|
0
|
1183
|
|
IDEA
|
Being able to restrict a date to either the Current date or a combination of Current and Past dates, Past dates only, Current and Future dates only, Future dates only, etc. would be a very handy ability to include in Collector. In my scenario (similar to what is discussed here: Collector for ArcGIS: Restricting a date field to current date), we want people to update the Start and Finish dates of forest harvesting operations as regularly as possible, but there may be delays due to the nature of our work meaning backdating is required. Projecting forwards though should not happen, so it would be good if we could disable that (Current or past date only). It would also be good if a 2nd date field could be restricted to not be back dated beyond a date set in a previous date field (i.e. End date of a harvesting operation could not be set as before the Start date).
... View more
01-04-2018
05:08 PM
|
4
|
0
|
671
|
|
IDEA
|
Being able to restrict a date to either the Current date or a combination of Current and Past dates, Past dates only, Current and Future dates only, Future dates only, etc. would be a very handy ability to include in Collector. In my scenario (similar to what is discussed here: Collector for ArcGIS: Restricting a date field to current date), we want people to update the Start and Finish dates of forest harvesting operations as regularly as possible, but there may be delays due to the nature of our work meaning backdating is required. Projecting forwards though should not happen, so it would be good if we could disable that (Current or past date only). It would also be good if a 2nd date field could be restricted to not be back dated beyond a date set in a previous date field (i.e. End date of a harvesting operation could not be set as before the Start date).
... View more
01-04-2018
05:08 PM
|
3
|
0
|
494
|
|
POST
|
Hi Marco. I am pretty confident that it is not the external software that was being used to read the output products as I tried it with numerous export file types that opened with different software packages and all had the same result. Put simply, whilst having more complex colour management options is not a bad thing for people like yourself, it shouldn't come at the detriment to other users who have been undertaking tasks for many years using preceding software without any glitches. Many graphics and images included in map layouts can be sourced from many places and there is a high chance they won't all be the same colour profile. You shouldn't need to be an expert in background settings like this to be able to produce a simple map layout to PDF which is a widely used document format.
... View more
01-04-2018
04:58 PM
|
4
|
0
|
3218
|
|
POST
|
This would be a useful feature to have. Being able to restrict a date to either Current, Current or Past, Past, etc. In my scenario (similar to Nisha), we want people to update as regularly as possible, but there may be delays due to the nature of our work meaning backdating is required. Projecting forwards though should not happen, so it would be good if we could disable that. It would also be good if a 2nd date field could be restricted to not be back dated beyond a date set in a previous date field (i.e. Start and End dates of a harvesting operation).
... View more
01-04-2018
04:50 PM
|
0
|
0
|
1251
|
|
POST
|
You mention that the transparency now works as vector outputs. Are you referring to in ArcMap or in ArcPro? This is something that I have come across in the past as well and is frustrating. If ArcPro can handle this then that is a positive (though still useless if PDF's don't handle images very well).
... View more
12-06-2017
04:46 PM
|
0
|
0
|
3218
|
|
POST
|
Putting it simply, that plain sucks. You would think that the latest and greatest would at least include all of the functionality (even if achieved via different, "improved" methods) of it's predecessor. Maybe in the future this will be fixed. PDF's are after all a pretty common format for document creation.
... View more
12-03-2017
05:54 PM
|
1
|
2
|
3218
|
|
POST
|
I'll go do some digging and see what I can find. Thanks for your feedback so far. I might just add in here that this isn't an issue in ArcMap (which we still use day to day - I'm just trying to familiarise myself on side projects).
... View more
11-29-2017
11:37 PM
|
0
|
0
|
9888
|
|
POST
|
It would still be good to know why it doesn't work as expected when exporting to the vector formats. PDF is our preferred method of map production because of it's easy use for viewing and printing to set page sizes (not to mention more versatile than images).
... View more
11-29-2017
11:28 PM
|
0
|
2
|
9888
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 08-24-2025 06:11 PM | |
| 1 | 2 weeks ago | |
| 1 | 10-08-2024 09:01 PM | |
| 1 | 06-05-2025 12:17 AM | |
| 1 | 12-03-2025 05:50 PM |
| Online Status |
Offline
|
| Date Last Visited |
2 hours ago
|