Error with Spatial Analyst Filter tool - Invalid Weight neighborhood mask

1828
13
Jump to solution
11-14-2017 10:41 AM
DavidAskov1
Occasional Contributor

I am using ArcCatalog 10.5, running the Filter tool from the Spatial Analyst toolbox. I enter an input and output grid and specify low filter type. I leave the ignore nodata box checked. The inputs to this aren't complicated, but I'm getting an error:

Here are the Messages
Executing: Filter C:\temp\2017-11\multi-model-vis\PNW_4km_2017090900\averages\average00.tif C:\temp\2017-11\multi-model-vis\PNW_4km_2017090900\averages\average00_filterlow.tif LOW DATA
Start Time: Tue Nov 14 09:18:19 2017
ERROR 010333: Invalid Weight neighborhood mask::  C:\PROGRA~2\ARCGIS\DESKTO~1.5\BIN\NBR02
ERROR 010067: Error in executing grid expression.
Failed to execute (Filter).
Failed at Tue Nov 14 09:18:19 2017 (Elapsed Time: 0.26 seconds)

This laptop is actually pretty new, and I have never fiddled around with the file mentioned in the red line. There is no file or folder of that name when I go there in Windows Explorer.

I have two ideas, and any feedback is appreciated.

1) Use the Focal Statistics with the MEAN statistic type. This seems like the same thing as the rectangle with 3x3, or I can create my own 3x3 kernel file with all weights equal (1, for example).

2) Try to create a kernel file at this location.

Has anyone ever experienced this? If you have a file at C:\PROGRA~2\ARCGIS\DESKTO~1.5\BIN\NBR02 (this path is just DOS shorthand for "C:\Program Files (x86)\ArcGIS\Desktop10.5\bin"), can you please attach it to this thread or insert its text in a reply?

thanks! David

0 Kudos
1 Solution

Accepted Solutions
DavidAskov1
Occasional Contributor

My best guess as to the problem is that the FILTER tool is trying to write a temporary kernel file into a directory that is forbidden to users who are not administrators. As my non-administrator user, I am unable to create files in that directory (C:\PROGRA~2\ARCGIS\DESKTO~1.5\BIN\), so that would explain the failure. I have 3 work-around solutions for this:

1) Run ArcCatalog as an administrator. Just find it in your start menu and right-click on it and choose "Run as Administrator". You have to have another user/pass login to do this. My work's policy is that users are not administrators, but we have access to an admin account for limited usage. This works for me, but may not for you. Also, it runs as a separate user, so I don't have access to any of my settings (database connections, folder connections, symbols, etc, etc.) from my user. I guess I could switch over to the administrator user full-time, but... yuck.

2) The filter tool with the LOW type is basically the same as FOCAL STATISTICS with the RECTANGLE neighborhood at 3x3 and a MEAN statistics type. That is working fine for me as a non-administrator.

NOTE: My guess is FILTER is running FOCAL STATISTICS with an irregular neighborhood and trying to write out a temp 3x3 kernel file.

3) Use python. This worked fine in both the ArcCatalog command line and a stand-alone script (both running as my non-admin user). It is only the tool in ArcCatalog that gave me an error.

View solution in original post

13 Replies
XanderBakker
Esri Esteemed Contributor

I just ran a low filter with 10.5 and I had no problems:

I do notice that you are using a folder that contains names that start with a number like "2017-11". Try and copy the data to the folder "C:\temp" and try again to see if it might be the folder name.

DavidAskov1
Occasional Contributor

Xander Bakker‌ - I copied the input to C:\temp and got the same result. Can you please take a look in C:\Program Files (x86)\ArcGIS\Desktop10.5\bin to see if you have a file or folder named NBR02? If so, can you post its content and/or attach it? thanks

0 Kudos
XanderBakker
Esri Esteemed Contributor

I already looked (before I posted me answer) and I don't have a file with that name of anything NB* for that matter. I wonder if this has something to do with the data, but the error is very strange. If the data is not too big and you can share it here I can run it on my system, otherwise I would recommend contacting support and registering a case for this.

DanPatterson_Retired
MVP Esteemed Contributor

I have none by that name in my ...\bin path

ChrisDonohue__GISP
MVP Frequent Contributor

To tag onto what Xander Bakker suggested, also change the filenames or folders so that there are no dashes in any of them.  Sometimes the system blows up because of the dashes, but then provides an error unrelated to this issue.  I don't know why it happens this way, but that is just the way it turns out sometimes, and getting rid of the dashes fixes the other issues.

Also, try shortening the grid and tiff filenames.  It may be that it is choking on a "too long" filename.  For whatever reason, the process sometimes seems to apply the most restrictive condition to files that normally don't have those restrictions (in this case that would be the GRID filename limitations).  It's worth a try....

Esri Grid format

The name of an Esri Grid format raster has more specific restrictions:

  • The maximum number of characters is 13.
  • It cannot have spaces.
  • It cannot use special characters other than underscore ( "_" ).
  • For tools that output a Grid Stack, the stack name cannot have more than 9 characters.
  • The total length of the name for a Grid and its path cannot be more than 128 characters.

Source:  Output raster formats and names—ArcGIS Help | ArcGIS Desktop 

Chris Donohue, GISP

DavidAskov1
Occasional Contributor

Hi all - I think I found two work-around ideas.

First, I appreciate the input on filenames. I re-ran it with the simplest names I could give it and got the same error. Here is the "copy as Python Snippet" for what I tried:

arcpy.gp.Filter_sa("C:/temp/avg.tif", "C:/temp/avg2.tif", "LOW", "DATA")

It feels like we can eliminate wacky file names from the list of suspects.

The error is saying the neighborhood mask is invalid, which I'm guessing is basically a kernel file, and if it's missing, that would be invalid... Why it's missing is anyone's guess, but the name looks like a temporary file name, so I started asking myself "what would cause a temporary file to fail?" Well, I'm not running ArcCatalog as an administrator user, and that would absolutely prevent me from writing into the program files x(86) folder. In fact, I had that problem the other day with something else.

WORK-AROUND 1: Run as Administrator - This worked!!! Except, it's a real hassle, because it actually runs as another user, so I don't have access to any of my settings (database connections, folder connections, symbols, etc, etc.). I guess I could switch over to the administrator user full-time, but... yuck.

WORK-AROUND 2: Can someone please confirm the following?

Is the FILTER tool with the LOW type the same as FOCAL STATISTICS with the RECTANGLE neighborhood at 3x3 and a MEAN statistics type? That is working fine for me.

Last note: I appreciate the suggestion to file a tech support request, but our academic site license policy is basically that we are only allowed to do so when it is a total show-stopper, so I'm wondering if FOCAL STATISTICS is the same thing.

0 Kudos
DavidAskov1
Occasional Contributor

WORK-AROUND 3: Use python. That works fine. In the great irony, I was actually writing a python script, and I only used the tool in ArcCatalog to try it once or twice before putting it in code. Gah! That should teach me for using the mouse instead of the command line...

0 Kudos
DanPatterson_Retired
MVP Esteemed Contributor

Filter  ... is a 3x3 moving window

As for the academic license thing... I am being like a salmon right now.. apparently they prefer someone that doesn't use the software to be the contact person... They need to expand their contact tree to at least include senior software-using instructors

As for ArcCatalog... I never run tools from ArcCatalog... (long story... I know, I know... it shouldn't matter) but when I have had an 'issue' with a tool in Catalog... it seems to miraculously go away when I run the same tool from within Arctoolbox in ArcMap.  Pro makes this more normal  since 'catalog' in Pro isn't really 'catalog' they just renamed the 'Project' pane to catalog

Good luck

XanderBakker
Esri Esteemed Contributor

A comment to your question at workaround 2:

Is the FILTER tool with the LOW type the same as FOCAL STATISTICS with the RECTANGLE neighborhood at 3x3 and a MEAN statistics type? That is working fine for me.

If you look at this help: How Filter works—Help | ArcGIS Desktop , you will see:

A low pass filter smooths the data by reducing local variation and removing noise. It calculates the average (mean) value for each 3 x 3 neighborhood. It is essentially equivalent to the Focal Statistics tool with the Mean statistic option.