POST
|
Hmm no that doesn't seem to help! Thanks for helping though. I figured out a way to make this work which is from from elegant. But basically I am just re-using the "copy snippet as python" bit from running reclassify in ArcMap. arcpy.gp.Reclassify_sa("C:/Users/.../soil.gdb/soil_raster", "texcl", "'Silt loam' 4;'Sandy loam' 2;'Fine sandy loam' 2;Loam 8;'Coarse sandy loam' 2;'Loamy sand' 1;Sand 3;'Loamy fine sand' 1;'Sandy clay loam' 5;'Very fine sandy loam' 2;'Coarse sand' 3;'Clay loam' 6;'Loamy coarse sand' 1;'Fine sand' 3;'Silty clay loam' 10;'Silty clay' 9;Clay 7;'Very fine sand' 3;Silt 4;'Loamy very fine sand' 1", soil_reclass, "DATA") You'll see it's weird because "clay" and "sand" don't have quotation marks around them, which seems random, so I can't dynamically generate these remap values should I need to change the classes. But I can run this in Python.
... View more
10-23-2020
02:10 PM
|
0
|
1
|
2289
|
POST
|
Oh haha, my "minimal example" seems to be poorly written.... Thank you for catching that. I rewrote it as you suggested and now the remap_values looks like this: remap_values RemapValue([['Loamy very fine sand', 1], ['Sandy loam', 2], ['Loamy fine sand', 1], ['Silt', 4], ['Sandy clay', 11], ['Fine sand', 3], ['Very fine sandy loam', 2], ['Coarse sand', 3], ['Loamy sand', 1], ['Clay', 7], ['Very fine sand', 3], ['Silty clay', 9], ['Coarse sandy loam', 2], ['Loamy coarse sand', 1], ['Sand', 3], ['Sandy clay loam', 5], ['Clay loam', 6], ['Silty clay loam', 10], ['Silt loam', 4], ['Loam', 8], ['Fine sandy loam', 2]]) dir(remap_values) ['_CompoundParameter__propertyGetter', '_CompoundParameter__propertySetter', '___keyword', '__class__', '__delattr__', '__dict__', '__doc__', '__eq__', '__esri_toolinfo__', '__format__', '__getattribute__', '__hash__', '__init__', '__module__', '__new__', '__reduce__', '__reduce_ex__', '__remapTable', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', '_addProperty', '_keyword', '_toRepresentation', '_toString', '_useDefault', 'remapTable'] So everything looks great, unfortunately it is still returning the same error for me.
... View more
10-23-2020
11:16 AM
|
0
|
3
|
2289
|
POST
|
Hey Dan - good eye. Unfortunately that still doesn't work. Must be something wrong with my raster file ...
... View more
10-22-2020
03:28 PM
|
0
|
0
|
2289
|
POST
|
I am reclassifying texture classes of a soil raster into integers: import arcpy from arcpy import env arcpy.CheckOutExtension('Spatial') soil_path = 'C:\\Users\\....\\soil.gdb\\soil_raster" class_map = [('Loamy very fine sand', 1), ('Sandy loam', 2), ('Loamy fine sand', 1), ('Silt', 4), ('Sandy clay', 11), ('Fine sand', 3), ('Very fine sandy loam', 2), ('Coarse sand', 3), ('Loamy sand', 1), ('Clay', 7), ('Very fine sand', 3), ('Silty clay', 9), ('Coarse sandy loam', 2), ('Loamy coarse sand', 1), ('Sand', 3), ('Sandy clay loam', 5), ('Clay loam', 6), ('Silty clay loam', 10), ('Silt loam', 4), ('Loam', 8), ('Fine sandy loam', 2)] remap_values = arcpy.sa.RemapValue(class_values) soil_reclass = arcpy.sa.Reclassify(in_raster='soil_path', reclass_field='texcl', remap=remap_values) This returns an error ExecuteError: ERROR 000622: Failed to execute (Reclassify). Parameters are not valid. ERROR 000628: Cannot set input into parameter remap. I am able to run the Reclassify tool just fine in ArcMap with these values, but copying the code as Python snippet doesn't help because once I format it for a standalone script, the error returns. (One weird thing: when pasting the snippet, some of the strings were unquoted, like clay instead of 'clay'.) There was a similar question on here for which the answer was to check for repeat keys in the remap, but there aren't any here. Any ideas? Banging my head against my desk on this one.
... View more
10-22-2020
02:57 PM
|
0
|
9
|
2336
|
POST
|
I found an answer to this question - no you cannot automate kriging optimization. https://community.esri.com/message/864045-re-how-can-i-do-batch-processing-with-geostatistical-wizard-not-the-tool-geost…
... View more
06-18-2020
05:08 PM
|
0
|
0
|
637
|
POST
|
Hmm yes that must be what the Geospatial Wizard is using under the hood, thank you. I was hoping there would be a function that would cross validate and select the correct parameters like the wizard but I guess that would be too easy. If only the Geospatial Wizard wasn't so opaque.
... View more
06-18-2020
05:03 PM
|
0
|
0
|
637
|
POST
|
Hi there, I have been using the Geospatial Wizard in the ArcMap 10.4.1 desktop GUI to interpolate rainfall station data with good success. During the process I consult the variograms and adjust parameters accordingly -- however, I noticed that the "optimize" feature in the Geospatial Wizard, which uses cross validation to optimize the kriging parameters, gives me equally accurate results. I have many many layers that I wish to interpolate and I want to do this in a standalone Python script. However, I can't find any way to "optimize" the parameters like in the Geospatial Wizard, I can only input them manually or use the defaults. Any luck with this? If I am forced to use Model Builder, does that have the optimize feature? Thank you.
... View more
06-18-2020
01:04 PM
|
0
|
4
|
685
|
POST
|
Awesome! Yes this worked perfectly for the small portion I was interested in. Thank you Tom.
... View more
02-27-2018
12:58 PM
|
0
|
0
|
1169
|
POST
|
Hey Dan, Thanks for replying. I'm using ArcMap 10.4.1. The NAIP file I'm using is accessed through a USDA server since it's such a large image. To do this, I go into the Catalog sidebar, scroll down to GIS Servers, click "Add ArcGIS Server", and add the server URL https://gis.apfo.usda.gov/arcgis/services). The file I use is in the NAIP folder, called "Washington", which I drag into my Table of Contents. The inputs to Segment Mean Shift are just the defaults, but I set processing extent to the extent of a small polygon feature in a separate geodatabase, rather than running analysis for the entire image. The path file for the NAIP image just reads "NAIP\Washington". There is no way to link directly to the file (e.g. clicking the yellow folder next to Input Raster and navigating to the USDA server - the raster files don't appear). I'm not sure how to get around using a server since the entire NAIP file for Washington is 1.88 TB. To clarify even further, I am accessing the NAIP file in the way this tutorial recommends.
... View more
02-27-2018
09:04 AM
|
0
|
1
|
1169
|
POST
|
Apologies beforehand, I've not done much image analysis in ArcMap. I'm trying to do OBIA on a portion of the NAIP 2016 aerial imagery for Washington (accessed on the GIS server through https://gis.apfo.usda.gov/arcgis/services). I'm following these steps on the ESRI website. First, I use the Segmented Mean Shift tool on a small portion of the NAIP image. There are 4 bands, but the tool takes the first three by default. However, after running for a few minutes I get an Error 999999 and an incomplete output raster in grayscale. Does anyone have any idea what I could be doing wrong?
... View more
02-26-2018
10:02 PM
|
0
|
5
|
1638
|
POST
|
I've just begun to use the R-ArcGIS bridge package arcgisbinding and am running into a problem when I try to join feature class data with the dplyr package. When I join them, the shape attributes in the data frame are dropped and I can only export it as a table, not as a feature class or shapefile. Here is some toy reproducible code. Below, I'm trying to get the ozone measurement columns from two shapefiles into a single data frame, then export the data frame as a shapefile. library(dplyr)
library(arcgisbinding)
arc.check_product()
fc <- arc.open(system.file("extdata", "ca_ozone_pts.shp", package="arcgisbinding"))
d <- arc.select(fc, fields=c('FID', 'ozone'))
p<-arc.select(fc,fields=c('FID', 'ozone'))
p$ozone<-p$ozone*2
p<-left_join(p,d,by="FID")
arc.write(tempfile("ca_new", fileext=".shp"), p)
# original dataframe has shape attributes
str(d)
# new dataframe does not
str(p) From the arcgisbinding package, p and d above are data frame objects with shape attributes. The problem is that once I use left_join , I lose the spatial attribute data in the joined data frame. Is there a way around this?
... View more
06-13-2017
11:10 AM
|
0
|
2
|
1468
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|