POST
|
arcpy.env.outputCoordinateSystem = arcpy.SpatialReference(102039) Seems to have solved the issue. Is this best practice when working with feature data?
... View more
08-21-2020
01:41 PM
|
0
|
1
|
624
|
POST
|
When I use `arcpy.Clip_analysis()` in a stand-along Python 3.6 script, the output is missing a spatial reference. When I complete the task within ArcGIS Pro using the GUI, the feature output maintains the spatial reference. The input feature, the clipping feature, and the output feature are each in a different file geodatabase. The clipping feature is a polygon and the clipping feature can be point, line, or polygon; I am experiencing the same issue with each feature type. The input feature and the clipping feature are both projected with "USA Contiguous Albers Equal Area Conic USGS." Is there something I can change int the environmental settings? Other suggestions?
... View more
08-21-2020
01:02 PM
|
0
|
2
|
666
|
POST
|
Yeah, there are a couple hundred of them, but I could make a key using a feature of the zones and then use that key in python. That seems less cumbersome. I just wanted to make sure that I wasn't missing some function, because it didn't seem like an esoteric task to me, but maybe it is. Thanks.
... View more
08-19-2020
05:27 AM
|
0
|
0
|
795
|
POST
|
I have many rasters currently projected in NAD_1983_Albers. I would like to project each into the appropriate UTM zone (NAD 1983). I am trying to do this with a stand alone python script in ArcGIS Pro. Since the rasters are in NAD_1983_Albers currently, I can't (or do not know how) to extract latitude and longitude of a point within the raster to use something like the python script found here to determine UTM Zone. I could project into an intermediary projection and then do something like Raster To Point and then find the UTM zone with a script. Then I'll need to link to this Spatial Reference Object when I project the rasters again. This seems cumbersome. Or, I could create a feature from the raster and then use arcpy.CalculateUTMZone_cartography and use the Spatial Reference Object stored as a field value to project each raster. (However, separate issue, arcpy.CalculateUTMZone_cartography calculates the UTM for the features I've tested as "Southern Zones" and in WGS 84, though all of the locations are in the Northern Hemisphere). Or, using this feature, I could use arcpy.CalculateField_management to find the coordinates of the centroid, and follow as above. Though this 'feature' approach also seems cumbersome. Basically, am I missing something? Or, is this task going to be rightfully cumbersome?
... View more
08-18-2020
01:13 PM
|
0
|
2
|
838
|
POST
|
Thanks. I tried 'select layer by attribute --> selected feature --> copy feature' as well as sticking that and the rest of the <select layer by attribute> into a submodel. But, unfortunately, <select layer by attribute> is run for each polygon still. Scripting is likely the way to go. But, I am now eager to see if this could work with model builder. Exporting the model to Python script isn't functional, but does reveal the <select layer by attribute> within the 'for loop' as I mentioned above. Here is that script for completeness: import arcpy def # NOT IMPLEMENTED# Function Body not implemented def Model13(): # # To allow overwriting outputs change overwriteOutput option to True. arcpy.env.overwriteOutput = False Input_Feature = "Water" Clipping_Feature = "Locations" for Selected_Polygon, Name in # NOT IMPLEMENTED(Clipping_Feature, [["String_ID", ""]], False): # Process: Select Layer By Attribute (Select Layer By Attribute) Selected_Feature, Count = arcpy.SelectLayerByAttribute_management(in_layer_or_view=Input_Feature, selection_type="NEW_SELECTION", where_clause="FCODE NOT IN (3, 6, 15, 85)", invert_where_clause="") # Process: Copy Features (Copy Features) Output_Feature_Class = "C:\\Foo\\Bar\\Water_CopyFeatures1" arcpy.CopyFeatures_management(in_features=Selected_Feature, out_feature_class=Output_Feature_Class, config_keyword="", spatial_grid_1=None, spatial_grid_2=None, spatial_grid_3=None) # Process: Clip (Clip) Name = "86" Clip_Name_shp = fr"C:\Foo\Bar\Water_Clip_{Name}.shp" arcpy.Clip_analysis(in_features=Output_Feature_Class, clip_features=Selected_Polygon, out_feature_class=Clip_Name_shp, cluster_tolerance="") if __name__ == '__main__': # Global Environment settings with arcpy.EnvManager(scratchWorkspace=r"C:\Foo\Bar\MB_Test.gdb", workspace=r"C:\Foo\Bar\MB_Test.gdb"😞 Model13()
... View more
07-24-2020
06:33 AM
|
0
|
0
|
599
|
POST
|
In model builder I am attempting to Clip a Feature which has Selected Attributes by each polygon in another feature. This model will get the desired output. But, it will "Select Layer By Attribute" each time. Making the process slower. I've tried variations of putting either the 'top' or 'bottom' commands before clip into submodels, but this has resulted in the same behavior. I've tried different iterators (e.g., use split by attributes on the clipping feature and then a feature class iterator) to no avail. If export to python code I can see that 'arcpy.SelectLayerByAttribute_management" is in the same for loop as 'clip'. How might I adjust this model to no longer "Select Layer By Attribute" for each clipping polygon?
... View more
07-23-2020
02:21 PM
|
0
|
2
|
637
|
POST
|
Thank you both: "!IsNull" is new to me, specifically the "!" Cheers, Mike
... View more
06-05-2012
05:43 PM
|
0
|
0
|
370
|
POST
|
You could do this with Con or SetNull depending upon what you want. Both are documented in SA's help file. Con ("Grid B" < 0, 0, "Grid A"): This means where Grid B is less than zero use zero, otherwise use Grid A. But this would require an additional step of making the values "null". So, can I use two "InGrids" with SetNull? For example, SetNull("Grid B", "Grid A"). Would this equate as set null all values of Grid B and use only non-overlapping values of Grid A. Thanks again, Cheers, Mike
... View more
06-04-2012
04:15 PM
|
0
|
0
|
370
|
POST
|
Steve and Curt, Thank you for the suggestions. These methods add some elegance to the procedure. Cheers, Mike
... View more
06-03-2012
06:50 PM
|
0
|
0
|
484
|
POST
|
Hello, For example, I have two grids (A and B). I would like to remove from GridA any cells that have a value in GridB. Grids A and B occupy the same space but measure different things. What is the best way to perform this operation? I was not having success googling the issue. Thank you kindly, Mike
... View more
06-03-2012
06:47 PM
|
0
|
5
|
497
|
POST
|
Thank you this should work. However, the size of the raster exceeds Excel's (where I 'read' the array data right?) current row limits. So I think I'll need to raster to points in Arc and then use the SORT command in Arc and then do the Raster Calculator operations. Thanks again, Cheers, Mike
... View more
05-30-2012
12:53 PM
|
0
|
0
|
484
|
POST
|
Hello, I have a raster (grid) file that has about ~11,000 columns and ~ 6,000 rows. I want to select / create a new grid that contains the top 10,000 valued cells. I have done two analyses and want to compare the 'spatial overlap' between the two approaches for the top 10,000 cells. I have yet to arrive at any method, let alone a clever one, to perform this operation. Does anyone have a suggestion on how to perform such a task? Thank you kindly, Mike
... View more
05-26-2012
11:11 AM
|
0
|
6
|
869
|
POST
|
Hello, Unfortunately you can't rotate point shapefiles in editor. Thanks for the suggestion. Cheers, Mike
... View more
01-20-2012
10:23 AM
|
0
|
0
|
434
|
POST
|
Thank you for the quick reply. Attempting the procedure now. Cheers, Michael
... View more
01-20-2012
09:27 AM
|
0
|
0
|
434
|
POST
|
Hello, I have several rectangular plots (shapefiles) in which I have several points (shapefiles). I have the XY data (UTM) for the points. I understand that UTM data is XY, but I would like to know the point locations within the plot ("the plot's XY"). For example, one of the plot's corners would become the new origin for my "PLOT XY." Can this be done in ArcMap? And if not, what should I be reading about / searching for to complete this operation? Thank you kindly, Mike
... View more
01-18-2012
06:08 AM
|
0
|
4
|
849
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|