Subscribe to this thread
Home - General / All posts - Visibility Count
HMS
145 post(s)
#27-Mar-21 00:48

Hi everybody, after applying the visible count transform (TileViewshedTilesCountPar) to an image (with a height range from 0 to 143 m) and a point file (with around 200 observers) with a relative Z of 25 m, the resulting image has negative values.

This negative values seem to match the visibility area and a closer look to the image shows that you have negative values adjacent to positive ones (for instance there are negative values of -128 side by side with positive values of 127). It seems the absolute value is correct but the negative sign makes this result a strange one. Is this an expected behaviour?

(edited: I noticed when the number of observers is significantly reduced (around 100) the resulting image values remain positive. Is there a limitation for the number of observer points?)

If needed I can provide a link to the mxb.

adamw


9,588 post(s)
#29-Mar-21 10:10

Negative values can be produced by the LevelAll / LevelAny functions, Count should produce non-negative values.

Can it be that you left the Result option in the Transform pane at (same field) and the pixel type of the original image was something like INT8? Because then the negative values could be the result of an integer overflow. Set Result to New Field or New Table and set the pixel type to FLOAT64 to counter.

If it isn't the above, the MXB would indeed help.

HMS
145 post(s)
#29-Mar-21 12:19

Hi Adam, thanks for looking into this. The original image is 128x128 FLOAT64 as well as the resulting image, (the result is the same both for a new field or a new table) and the projection used is ETRS89 / Portugal TM06 (EPSG: 3763).

Here's the link for the mxb: https://we.tl/t-OqSsFs2JAJ

adamw


9,588 post(s)
#29-Mar-21 13:37

Thanks a lot!

This is our bug. There is an integer overflow indeed, inside our code. We will fix it.

HMS
145 post(s)
#29-Mar-21 13:45

Great to be of some help. As this is an ongoing analysis, is the overall visibility calculation correct if I apply TileAbs to find the absolute value of the pixel or is the bug preventing a correct analysis with this number of points?

adamw


9,588 post(s)
#29-Mar-21 14:57

No. You can obtain correct results by running the count analysis on portions of 127 or less observers, then summing the outputs.

HMS
145 post(s)
#29-Mar-21 15:29

Thanks! I'll do that.

Manifold User Community Use Agreement Copyright (C) 2007-2019 Manifold Software Limited. All rights reserved.