GithubHelp home page GithubHelp logo

Comments (9)

jdrisdelle avatar jdrisdelle commented on May 26, 2024

Hi Ellen,

  1. No the fill raster code is a code sample that a user committed to our Git Hub repo. It much simpler that the elevation void fill tool. It essentially populates an array with a user defined value. In this case it fills the entire raster with that value. The code being used is a numpy function:

pixelBlocks['output_pixels'] = np.full(shape, self.fillValue, dtype=props['pixelType'])

We don't document these as they are code samples uploaded from our users. It is up to them to document/comment their code.

There is a function that is available out-of-the-box that does what you want.

http://pro.arcgis.com/en/pro-app/help/data/imagery/elevation-void-fill-function.htm

  1. I'm not sure if i can send you the code for the out-of-the -box function as it is is proprietary.

  2. You can open the code from any text editor or Python IDE.

from raster-functions.

ellend999 avatar ellend999 commented on May 26, 2024

Thanks for the quick response. I was using the elevation void fill function within ArcGIS Pro but it is not performing as expected. It is leaving cells unfilled that should be filled.
If I actually had the code, I understand I can open it in any text editor, but from what you are saying, I cannot access the code for the elevation-void-fill-function because its proprietary - yes?
Is there a way to call the function directly from python? I understand it is NOT part of ArcPy.

from raster-functions.

jdrisdelle avatar jdrisdelle commented on May 26, 2024

it can't really be called from Python. We do have a generate raster gp tool that will consume a raster+ function template a generate a physical output raster. You can place the void fill function in the template and use it. If you are using the out-of-the-box function and it is not working we can investigate that. What are you setting as your max void width? Can you share the raster?

from raster-functions.

ellend999 avatar ellend999 commented on May 26, 2024

The raster is just a selected HUC6 from the 10M NED available from the USGS.
I left the Max Void width to the default 0 so that all voids were to be filled.
I am running code but can share the raster when the data is free.

from raster-functions.

jdrisdelle avatar jdrisdelle commented on May 26, 2024

Ok. I can take a look at it and see what is causing the problem. The developer that worked on that tool is just down the hall. I can have him take a look at it. Are the holes that are not being filled doughnut holes or are they on the edge of your data?

from raster-functions.

jdrisdelle avatar jdrisdelle commented on May 26, 2024

Hi @ellend999,

Do you still want me to take a look at your data?

from raster-functions.

ellend999 avatar ellend999 commented on May 26, 2024

I noticed the issue when I went on to produce flow direction grids from the fill grid produced by the raster function. The flow direction grids produced values that are not legitimate flow direction values (in other words not 1,2,4,8,16,32,64, or 128). This happens when there are sinks in the data. When I run the Spatial Analyst/Fill tool and then run the flow direction, the flow direction values were all appropriate. I tried attaching the dem I was using but it was too big. Let me know if you have an alternative way for me to get you the data.

from raster-functions.

jdrisdelle avatar jdrisdelle commented on May 26, 2024

@ellend999. I just took a closer look at the fill gp tool and the elevation fill function. They are actually doing different things. The elevation void fill function actually fills nodata values in your DEM using either a fitted plane or idw interpolation. This was deigned to fill in holes created in Lidar derived DEMs caused in bare earth DTMs (i.e. building footprints or lakes).

The fill gp tool actually fills sinks which are hydrological anomalies in DEMs and not just holes from missing data.

So these two tools do different things at the end of the day. Maybe we can try to make a Python raster function that does something similar to the fill gp tool. Try plugging this function into the Python raster fucntion and see what it does:

https://docs.scipy.org/doc/scipy-0.14.0/reference/generated/scipy.ndimage.morphology.binary_fill_holes.html

Use the fill function from our repo as a starting point. Replace the current function in the updatepixels() method with this one. I can help if you get stuck.

from raster-functions.

ellend999 avatar ellend999 commented on May 26, 2024

from raster-functions.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.