how to remove edges from MapCache seeding process of MapServer heatmap - grid

I am trying to prepare heatmap on a MapServer-based a point layer. The configuration seems to work on MapServer side (fig 1) but there is an issue with MapCache.
The problem with MapCache is concerning edges that appears when requesting WMTS. There is no smooth transition to the next tile (fig 2). I think that this is somehow related to the grid used in seeding map process (I used WebMercator). Will appreciate if anyone can give me suggestion on how to eliminate those edges ?
part of layer mapserver config that might be important:
PROCESSING "RANGE_COLORSPACE=HSL"
PROCESSING "KERNELDENSITY_RADIUS=%radius%"
PROCESSING "KERNELDENSITY_COMPUTE_BORDERS=ON"
PROCESSING "KERNELDENSITY_NORMALIZATION=auto"
OFFSITE 0 0 0
SCALETOKEN
NAME "%radius%"
VALUES
"0" "50"
"25000000" "15"
END
END

In paragraph 2.7. the rfc of mapserver heatmap https://mapserver.org/sq/development/rfc/ms-rfc-108.html
describes that the tiling can be applied.
In order to work properly the kerneldensity_normalizastion have to be set as numeric value.
According to this insted of:
PROCESSING "KERNELDENSITY_NORMALIZATION=AUTO
set:
PROCESSING "KERNELDENSITY_NORMALIZATION=1
or any other numeric value.
update:
be aware that this RFC is outdated

Related

Optimize route on indoor map (warehouse) with R

Our project is focused on optimizing routes within a warehouse in R.
We have multiple locations "from" and "to" all numbered. There are also some constraints, like you have to follow specific pathways only.
(blue - starting location, red - points to go, grey - walls (constraints, cant go through))
What is the optimal way to start off?
Without exactly understanding what you mean by "S-shape pathways", I think you could model your problem as a network flow problem, also known as min-cut/max-flow problem. This would be a linear model, you could use the lpSolveAPI package for that.

How do I best map an unorganized point cloud back to it's organized ancestor?

I get an organized point cloud (using pcl and an ASUS Xtion Pro Live), which of course contains NANs and the like. I also get an RGB image of the same scene.
The first step for processing is removing those NANs, which converts the point cloud to unorganized. I then perform a few other steps, but that's not relevant to the question (I think, see P.S.1). What COULD (I'm not sure) be relevant is that I run extract multiple times, and so have quite a few intermediate point clouds. I believe this means I can no longer assume that the points are in the same order they were at the start.
For clarification, I do understand what an unorganized point cloud it and how it differs from unorganized, both theoretically and in terms of how the data is actually stored.
After chopping off various points, I now have a much smaller point cloud which consists only of points in the original point cloud (but much less of them). How do I map these points back to the matching points in the original point cloud? I probably could iterate through the entire cloud to find matches, but this seems hacked together. Is there a better way to do this?
My main aim is to be able to say that 'point A in my final point cloud is of interest to me' and furthermore to map that to pixel K in the RGB image I first obtained. It seems to me that matching the final point cloud with the initial one is the best way to do this, but alternatives are also welcome.
P.S.1 - One of the last few steps in my process is finding a convex hull and then extracting a polygonal prism from the original point cloud. If all else fails, I will just interrogate the (20-50) points on the convex hull to match them with my initial point cloud (minimizing computation) and hence to match them with the original RGB images.
P.S.2 - Random musing - since I know the original size of the RGB image, the origin of the camera relative to the point cloud (or, rather, the position of the points relative to the camera used to take them), and can trivially obtain the camera parameters, could I simply use ray-tracing through each point in my final point cloud to produce an RGB image? The image may need registration with the 'real' RGB image, or it probably won't since nothing will have actually moved except for rounding error.

How can I make DOT/neato graphs more compact without introducing overlap?

My question is essentially the same as this one but the given answer doesn't work for me.
Here is a sample rendering (source) with
compound=true;
overlap=scalexy;
splines=true;
layout=neato;
There is some unnecessary overlap in the edges but this isn't too bad, the main problem is all the wasted space.
I tried setting sep=-0.7; and here's what happens.
The spacing is much better but now there is some overlap with the nodes. I experimented with different overlap parameters and this is the only one which gives remotely acceptable results.
I tried changing to fdp layout and setting the spring constant attribute K globally but I just got stuff like this:
The source is all straightforward a--b--c sort of stuff, no fancy tricks.
What I want is for all edges to be shortened as much as possible (up to a minimum) provided that this adjustment doesn't introduce any new overlaps, which is where sep fails completely. That doesn't seem like it should be too hard for a layout engine to do. Is it possible with the graphviz suite? I don't mind changing rendering software, but I don't want to annotate the source on a per-node or per-edge basis.
My ideal result would be to minimize the deviation in edge length, considered one node at a time, i.e. each node would have edges of equal length apart from the necessary exceptions, but that's wishful thinking. The priority is to reduce the length of each edge with the constraint that this cannot introduce overlap.
I will accept partial solutions but they must be fully automatic and open source.
How can I do this? Thanks.
I found https://sites.google.com/site/kuabus/programming-by-hu/graphviz-test-tool, an interactive tool for parameterizing the many options and repeatedly rendering them. I went through the full list provided by the Java application, eventually ending up with this set of attributes:
overlap=false
maxiter=99999999
damping=9999999
voro_margin=.001
start=0.1
K=1
nodesep=999999999999
labelloc=c
defaultdist=9999999
size=20,20
sep=+1
normalize=99999999
labeljust=l
outputorder=nodesfirst
concentrate=true
mindist=2
fontsize=99999999
center=true
scale=.01
inputscale=99999999
levelsgap=9999999
epsilon=0.0001
I was not able to find a parameterization of neato that made producing the desired "moderately scaled" graph possible.
You should set
overlap = compress;
this should compress it at much as possible.
Try sep = +1; first, and then play with values between 0 and +1 to find the optimal setting for you.
I have a graph with 50 nodes and 68 edged (sorry cannot publish the whole picture, just a fragment). Found two reasonable presets (1 and 2):
digraph {
graph[
# 1. Less overlaps but less compact.
# This is the choice for now.
layout=neato; overlap=prism; overlap_scaling=-3.5;
# 2. More compact but some overlaps exist (may be adjusted by `sep`).
#layout=neato; overlap=voronoi; sep=-0.15;
# The following is common.
outputorder=nodesfirst, # Will always draw edges over nodes.
splines=curved;
]
node[fontname="Helvetica",];
node[shape=box;style="filled";penwidth="0.5";width=0;height=0;margin="0.05,0.05"];
edge[label=" ";color="#000080";penwidth="0.5";arrowhead="open";arrowsize="0.7";];
. . .
}

Generate subdivided triangle-strip cube?

I want to generate a cube where each face is divided into bits, like the following image:
http://img59.imageshack.us/img59/2504/gridcube165c3.jpg
Now, I can do this pretty simply if I'm just rendering quads, by just spacing vertices along each face plane at regular intervals, but my problem comes in when I want to turn the whole thing into a triangle strip. I've just got no idea how to unwrap it programmatically- is there some pattern to unwrapping that I'd follow?
I'm thinking of starting with the vertex at the top left corner as Row 0 Column 0 (R0C0), I'd want (first triangle) R0C0, ROC1, R1C1, (second triangle) R0C0, R1C0, R1C1 and so forth, and then when I reach the end of a row I guess I'd use a degenerate triangle to move to the next row, and then when I reach the end of the face I'd do the same to start a new face.
My main problem is that I can't visualize the program loop that would do this. I can reason out which vertex comes next visually, which is how I worked out the order above, but when I try to think programmatically I just stare blankly.
Even worse, with the end product I want the generated cube to be UV-mapped with a simple cube-map unwrap (the kind that looks like a T or t).
I guess, really, the best solution would be to find a library that already does this for me.
You could take a look at Ignacio CastaƱo's 'Optimal Grid Rendering' even though it's not triangle strips, it may inspire you.
Otherwise, you could use NVTriStrip library and be done with it.

Algorithm needed: Draw Outline Round Dots

Is there a well established algorithm I can steal^h^h^h^h^h copy which will draw an outline shape given an area filled with dots ?
I'm specifically thinking of this:
John Conway's Life: it might be nice way to see Life from the 'design-stance' (Dan Dennet's phrase) - and one way of doing this would be to draw outlines around either known patterns : or perhaps joining-the-dots : drawing the line on the furthest - but still interacting dots in a particular area.
So a glider would still look like a glider pretty much: but bigger shapes would just show their outline.
I haven't thought this through probably [as some patterns involve 'separated', non-interacting dots - only destined to interact in a future generation - I guess you could factor in a temporal interaction like this?] , and should have posted to 'www.halfbakery.com' , but maybe this is interesting .....
Check out Graham scan (convex hull algorithms).

Resources