|
POST
|
Because these field maps are handled at validation time, not at run time, the approach you really need to do is to use the Calculate Value tool to generate a field map dynamically at runtime using the arcpy FieldMappings objects in a Python function. Re: Generalizing Fieldmaps in ModelBuilder
... View more
05-23-2019
09:08 AM
|
0
|
0
|
1045
|
|
POST
|
Robert, that is exactly how to do it! The only thing I'd add is if the variable you are using is a pathname (likely to have \ characters in it) you need to escape it, for example: r"%Path%" + ".tif"
... View more
05-23-2019
09:04 AM
|
0
|
0
|
7860
|
|
POST
|
If you can get it paid for I would go for Friday. The final morning sessions allow you to catch that one tech session you could not fit in during the week. The closing session and open Q&A is also very useful as you get really great information on what Jack and the team are thinking.
... View more
05-23-2019
08:53 AM
|
5
|
0
|
1693
|
|
POST
|
If you start an incident, be sure and point the tech support people to this thread. In the past that has helped grease the process and save on the back and forth. Also once you have an incident number, they have a record of it and any past and future workarounds or fixes in the database. Please do open an incident, this way others can benefit from your suffering so it isn't wasted! I have to say I've always been happy with their help, even if it doesn't mean an immediate fix, at least I know of any workarounds right away.
... View more
05-06-2019
02:24 PM
|
0
|
0
|
3086
|
|
POST
|
In ArcGIS Pro, spatial questions are answered using geoprocessing tools like Spatial Join, Intersect, and Summary Statistics, not with SQL statements. A pure SQL approach to spatial queries would be the domain of other GIS systems, say, PostGIS or SQL Server Spatial, that include extensions to the SQL language that include spatial operators.
... View more
05-04-2019
11:05 PM
|
1
|
4
|
4005
|
|
POST
|
Do you have a reason not to do it the "old way", directly writing to Esri grid format? From 10.5 and later, python map algebra expressions may write intermediate output to .tif format, copying the data out to a new raster with the .save() operation. (See: https://community.esri.com/people/curtvprice/blog/2017/03/03/temporary-rasters-in-arcpy?sr=search&searchId=a006aa67-780e-4515-8b5c-f5d1c69aeead&searchIndex=0.) Calling raster tools directly with arcpy.gp avoids any temporary rasters to be written to disk, which is sometimes desirable for performance reasons, or in your case where the intermediate raster implementation is breaking your workflow! I recommend submitting this to Esri support so they can investigate this issue. I suspect there may be an issue with the path names of the input rasters that is resolved by avoiding the intermediate raster by using arcpy.gp. For now seems like the best approach is to keep doing it "the old way." Which is really just an alternate method of calling the Combine tool, not deprecated. All the raster tools (including ones usually accessed with math operators like + for Plus, or within a complex map algebra expression with tools like Int) may be called using this alternate implementation with the code pattern arcpy.gp.Rastertool_sa(). Hope this helps!
... View more
05-04-2019
10:39 PM
|
2
|
0
|
1254
|
|
POST
|
This is the workflow I am suggesting. southdakotacities.lyr is a layer file with the comma formatting saved from setting it up in ArcMap. Of course this requires that the field with commas set (POPULATION in my case) is both in the .lyr file and in the target feature class (in this case wyoming_cities). from arcpy import env
from arcpy import mapping as AM
# get active data frame
mxd = AM.MapDocument("CURRENT")
df = mxd.activeDataFrame
# get layer definition from layer file, (includes field formatting)
lyr = AM.Layer("southdakota_cities.lyr")
# update name and source
lyr.name = "wyoming_cities"
lyr.replaceDataSource(env.workspace,"FILEGDB_WORKSPACE", "wyoming_cities")
# add layer to map, this layer has wyoming_cities with commas in attribute table
AM.AddLayer(df, lyr)
... View more
05-03-2019
01:58 AM
|
0
|
1
|
4927
|
|
POST
|
Have you asked Esri support yet? They can probably explain what workflow you need.
... View more
05-02-2019
03:44 PM
|
0
|
2
|
3086
|
|
POST
|
Unlike ArcMap you can't set the extent directly (as Dan quoted above): Extent is not a direct property of the Camera object
... View more
05-01-2019
08:14 PM
|
0
|
0
|
6560
|
|
POST
|
Seems to me like the updateConnectionProperties method on ArcGISProject (the "apex object"?) is the one you want, as that would be a lot less work! I suggest going back to trying the method on the project, and add some debug code to your script to verify the connection properties are getting modified at all before you bother to .save(). Another thing to try is set the validate parameter of updateConnectionProperties to False and see what happens. If [validate is] set to True, the connection properties will only be updated if the new_connection_info value is a valid connection. If it is not valid, the connection will not be replaced. If set to False, the method will set all connections to match the new_connection_info, regardless of a valid match. In this case, if a match does not exist, then the data sources would be broken. (The default value is True)
... View more
05-01-2019
07:59 PM
|
0
|
2
|
6049
|
|
POST
|
Dan, I think you're missing the question. Yuriko wants to modify the display properties of fields within a layer object in ArcMap. Unfortunately, the only way I know how to do this in arcpy is to create a layer with the formatting properties set up ahead of time using the ArcMap user interface, save it as a .lyr file. Then at script run time, load the .lyr from disk and point its source property to a dataset. To get in this deep to the ArcMap object model you must delve into .NET and do it in ArcObjects.
... View more
05-01-2019
07:37 PM
|
1
|
3
|
4927
|
|
POST
|
The install download package includes the needed Visual C++ stuff (Desktop\SetupFiles\Support\VCREDIST), and setup.exe is wired to look for it and install it for you. So my recommendation is uninstall your C++ packages, and then running setup.exe instead of setup.msi. (Setup.exe by the way takes all the msiexec arguments the msi does if you need to do your install silently.)
... View more
04-29-2019
03:44 PM
|
0
|
0
|
4139
|
|
POST
|
Allison, I think you may not need a spatial join or a Python loop here, I suggest you try the Summary Statistics tool, asking for the MAXIMUM CLOSED_ROLL_YEAR and using parcel ID as the case field. This will give you a table unique by parcel ID (unless I'm not understanding your data, you should check!). When you have that table created and have verified it is unique by PARCEL_ID, (there's a Find Identical tool that can help with this), first add an attribute index to your stats table by PARCEL_ID. Then, add a join to a the point layer linking to the output table from Summary Statistics using PARCEL_ID as the key field. Then, you can select for assessor_tax_roll_xy.CLOSED_ROLL_YEAR = stat_table.MAX_CLOSED_ROLL_YEAR. This selected set is what you are looking for (I think). Once the selection is applied, remove the join and use Copy_Features to copy the selected points to a new output feature class with the points that you want. Hope this helps.
... View more
04-28-2019
05:20 PM
|
1
|
0
|
1250
|
|
IDEA
|
ARCPLOT's RESELECT with KEYFILE is the one I really miss. AML forever, man!
... View more
04-27-2019
07:33 AM
|
1
|
0
|
1159
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 08-11-2021 01:26 PM | |
| 5 | 12-10-2021 04:58 PM | |
| 1 | 02-27-2017 09:30 AM | |
| 2 | 12-04-2023 01:05 PM | |
| 1 | 04-12-2016 10:17 AM |
| Online Status |
Offline
|
| Date Last Visited |
06-19-2024
12:10 AM
|