Comments (5)
Hi @csap2109. What version of our software are you using? I just tried it on 10.4.1 and it is applying the colormap properly. @akferoz
from raster-functions.
I got the newest arcgis version. If 10.4.1 is actually the newest, then I have it
Did you subtract ndvi-raster from each other? If yes, does your ndvi have scientific values (-1 - 1) ?
from raster-functions.
@csap2109
In this case the problem is likely with scaling and bit depth. Colormaps are only supported with 8 bit rasters. Colormaps in the Python raster functions are setup using 4 arrays.
[pixel value][Red][Green][Blue]
In the colormap you are using we are using a range of 0-255 in the pixel value array. In order for this to work on your output pixel block you will have to scale the values. You can to this by adding one then multiplying by 127.5.
You can also do scaling after applying the Python raster function in your function chain.
Add the stretch function on top of your Python raster function. When you do this go to the general tab in the function and set the output pixel type to 8 bit unsigned. Add the colormap function on top of the stretch function and you should be good.
Hope this helps
from raster-functions.
@jdrisdelle
Ich habe ersteres Versucht, da der Stretch im Nachhinein nicht mein Ziel war. Ich benötige ein einziges Script, damit ich dieses im Nachhinein online als Widget importieren kann. Deshalb kann ich auch keine bestehenden Funktionen verwenden.
Bei Ersterem funktioniert es leider nicht, aber vllt habe ich es auch falsch in das Script integriert.
Könntest du mir den 2-Zeiler Code zeigen, den du meintest und vllt wo du es in meinem Script einbaue würdest. Wie gesagt, ich habe es verschiedenst ausprobiert und das Ergebnis war nicht wie erwünscht.
from raster-functions.
@csap2109
You will be able to access both out of the box functions and Python raster functions using widgets in your web application so you can still use the workflow that i sent in my previous message. If you would still like to do everything in your Python raster function you can scale you can do the following in your updatePixels() method.
r1 = np.array(pixelBlocks['r1_pixels'], dtype='f4', copy=False)
r2 = np.array(pixelBlocks['r2_pixels'], dtype='f4', copy=False)
np.seterr(divide='ignore')
outblock = self.op(r1, r2).astype(props['pixelType'], copy=False)
outBlock = (outBlock + 1) * 127.5
pixelBlocks['output_pixels'] = outBlock.astype(props['pixelType'])
return pixelBlocks
from raster-functions.
Related Issues (20)
- Elevation Fill Void - Fill raster function HOT 9
- aspect-slope raster function problems HOT 1
- can not import scikit-image in ArcGIS Pro 1.4 HOT 4
- Slope-Aspect Customized Slope Values HOT 1
- Add support for non c-contiguous arrays in the python raster function HOT 1
- How to use code HOT 3
- Write Wiki to have instructions for ArcGIS Pro instead or in addition to ArcMap HOT 2
- Add Section to Wiki on Writing RFTs to Process Collections of Imagery HOT 4
- How reference many Rasters to other rasters (Warb) HOT 1
- Implement FMask based cloud filtering
- Add error catching to pixel percentile calculations
- Hillshade.py in ArcGIS Pro HOT 4
- Python extension packages missing
- Zonal stats function HOT 4
- How to write YOLO or U-Net Deep Learning code which is integrated with RasterFrames? HOT 5
- Hyperlinks Missing for select Raster Functions and Templates HOT 1
- Deploy Raster function on server HOT 4
- How to reference a field value in mosaic table to use in Python RFT HOT 9
- error running Clip raster function using Foreach loop HOT 2
- Difficulties with publishing a rft with a python raster function from Pro to ArcGIS server 10.9.1 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from raster-functions.