Spatial Analyst - Python - IsNull problems

2346
7
11-08-2009 10:34 PM
XanderBakker
Esri Esteemed Contributor
OK, I found out that the Raster Calculator has been replaced by Python. At first quite a shock :eek:, but I'll get over it, since this is the future and AG94 is really cool... :cool:

There seems to be some problem with the IsNull function.

I simply want to assign the values in RASTER2 to the output raster when RASTER1 has NoData and in other cases assign value 0.

The resulting raster contains the value 0, but the NoData areas are NoData.

I believe this used to work with the Raster Calculator in previous version.
Am I missing something here (a setting perhaps)? :confused:

Kind regards,

Xander


Additional info:
It seems that the problem is caused by the IsNull function within python. When using the IsNull tool from the toolbox the result contains 1 and 0 values. Using IsNull in python only returns 0 values and NoData. The IsNull through Python works differently than using the IsNull tool.:(
0 Kudos
7 Replies
XanderBakker
Esri Esteemed Contributor
I have tested a very simple expression to determine if an input raster contains NoData. This should result in a raster containing 0 (false) and 1 (true) values.

It seems that the "is null" function using arcpy dot sa yields 0 and nodata while using "is null" from arcpy dot gp returns the desired 0 and 1 values. See the attached image.

Why are there two 'identical' functions resulting in different outputs?
0 Kudos
EricRice
Esri Regular Contributor
Please contact technical support and work with one of our analysts so we can document this behavior.  Based on your description it sounds like a defect.



Regards,
0 Kudos
XanderBakker
Esri Esteemed Contributor
I reported it to ESRI INC support, they forwarded it to ESR NL. ESRI NL was able to reproduce this issue and will report it back to INC again.

😞 I do wonder why such a simple to reproduce issue, which in fact is country and dataset independent, has to follow such a large route to enter the system. Can't say this is the most efficient way.

Hope you might look at these procedures in the future to make contributions from over seas a bit easier...
0 Kudos
JohnHauck
Occasional Contributor II
The following report has been logged regarding this issue:

[#NIM051255  arcpy.sa.IsNull returns incorrect results. ]
0 Kudos
KimOllivier
Occasional Contributor III


Hope you might look at these procedures in the future to make contributions from over seas a bit easier...


At least for beta testers. Surely the beta team want direct feedback? I am sorry that reporting through the distributor support desk is not worth the effort for me so I just ignore the requests to report a beta bug that way. We know there will be bugs, its not a production issue.

If the beta team are not monitoring the beta feedback forums then why bother at all? The agreement requires active testing and feedback.
0 Kudos
EricRice
Esri Regular Contributor
We are monitoring the beta forums, but we like to officially document as many issues as we can and with Support staff fielding Beta incidents, a decision was made to follow existing workflows for reporting defects/enhancements, the same as you would for our released products.  I'll be sure to pass your concerns on to the appropriate staff.

Best Regards,
0 Kudos
XanderBakker
Esri Esteemed Contributor
I have been rather critical regarding the procedure that needs to be followed to report a bug from overseas. Indeed it would be faster if one could directly report to ESRI inc and doesn�??t have to go through the local ESRI distributor first. There is however the aspect of data related problems. The local distributor will have more knowledge about the datasets used than ESRI inc and in my case ESRI NL is an efficient organization. If they can discard it being a data related issue, they can forward it to ESRI inc. That�??s what happened here and all occurred within a 24 hour time frame.

It still leaved the issues (bugs) that can be reproduced regardless of the dataset used. It would be more efficient if these cases could be reported directly to ESRI inc. 😉

The involvement of ESRI on the beta forum is much higher than on the normal ESRI forums. In my humble opinion they are taking this very seriously and doing a good job�?�

Kind regards,
0 Kudos