How to fill holes inside a polygon in QGIS? - qgis

I need to fill/delete the lines inside the polygon. I have tried the dissolve and delete holes tools, but did not work for me.
Any ideas and thoughts to delete the holes?

Have you try the geometry tools repair from processing menu. Seems invalid geometry ?
If it's not working try to use GRASS in the processing menu : v.clean (break, snap, rmdangle and rmsa) with a snap tolerance to 0.001. If not working, then try 0.01 or 0.1 (try to find the best threshold).

Related

How to use a texture with particle system to create lightnings effect?

I have a lightning texture tga file type :
and i dragged the lightning texture to a new particle system :
two problems :
how to make the 3d start size to be random ?
from youtube tutorial he did something that give him a random settings ine the 3d start size:
but my 3d start size is not random and i'm not sure how to apply the random settings :
the second problem is how to display the lightning in the particle system without the black box square around and to show only the lightning ?
For the first question, I can't say much more than try to play with the parameters in the same section "Shape" where you can change the "randomize" parameters.
For the second question: Do you see that "Alpha Is Transparency" check mark? Yes, that's it. Solves your problem ;)
For the first problem the random on the 3D Start Size.
on the right of it there is a small arrow click on it to expand and then you have some options, select Random Between Two Constants or play with it with the other options. then you can set the X and Y and Z random ranges.
I marked with red circle the arrow to click and expand to get to the options.
The second problem was the box(cube) in black around the lightning.
to remove it just go to the object with the particle system scroll down to the bottom to the shader, expand the shader options and in Rendering Mode change it to Transparent.
I marked with red circle again on the right what you have to change to make it transparent.
and we have nice lightnings and this is the basic i guess but it's working nice.

Fastest way to determine line of sight on a grid

I am improving a video game of mine where I currently have the problem that NPCs can shoot through walls. In order to fix this issue, I have decided to completely re-do my work regarding ground combat.
I use a tight grid for finding paths from any point A to B. I store my grid as an image-like structure and use Jump Point Search for the pathfinding itself. My goal is to find a location that is as far away from the enemy as possible (limited by the firearms's range) that also has a direct line of sight to the enemy.
In my latest approach, I determined all nodes in my grid that are within weapon range and that are connected to the enemy's location (colored in green in the image below). The final missing part is filtering these points so that only the points with a valid line of sight remain.
I can also detect the border lines (colored in blue) very fast. I could check for every node, if a line from this node to the enemy would intersect any border line. If that is not the case, I have clear line of sight. However, I assume this to be neither fast nor the optimal solution.
Do you have any ideas or suggestions? I am glad for any hint!
I visualized the grid in the following image to give you an idea of what I am talking about. If a character would stand in the lower right green area, he could not shoot the enemy in the upper left area because of missing line of sight.

QGIS polyline to polygon error

I have a set of polylines in qgis saved as .shp but when the geometry lines to polygons tool is used it fills in the areas on the outside of the lines, forming some strange polygon. Any thoughts?
A screenshot of your result might help here. That being said, you could try the Topology Checker plugin and check for dangles. If you find a bunch, your lines may not be closing properly, so the tool can't form polygons as intended.
Also, there is a GIS-themed Stack Exchange, which may answer your future questions better.

Drawing a polygon by a lot of dots

My desired output is moving a lot of dots to visualize some words.
The effect is similar to this video http://www.youtube.com/watch?v=Le13by2WM70 .
I think this problem could be split into two sub-problem.
The first is how to extract the path from a vector font.
The second is how to moving dots to visulize that polygon.
There are some tools could solve first part, but I have not idea about the second part.
Anyone has done this?
You could probably do pretty well by just sampling points on a regular grid, with a little jitter added in to avoid looking too computery. All you need to do is check if you are "inside" or "outside" of the path. For inside, place a fish (or dot); for outside, no fish.

I need help compensating for the shifting of images when trying to create a grid with one image and apply it on another

I have two images of yeast plates:
Permissive:
Xgal:
The to images should be in the same spot and roughly the same size. I am trying to use one of the images to generate a grid and then apply that grid to the other image. The grid is made by looking at the colonies on permissive plate, the plate should have 1536 colonies on it. The problem is that the camera that was used to take the images moves a bit up and down and the images can also be shifted slightly due to the other plate not being in exactly the same place.
This then means that when I use the permissive plate to generate the grid on the xgal plate the grid shifts. Does anyone know a way in which I can compensate for this? I am using perl with the gd module. Any advice would be greatly appreciated. Thank you
I've done this in other languages in relation to motion analysis. You can mathematically determine the shift in position between two images using cross correlation.
Fortunately, you may not need to actually do the maths :) You could use something like ImageMagick, which provides a lot of image processing functions for you, and is perl scriptable. Independently scripts already exists for tasks very much like yours -- see.
If you have only a few pairs of images and, as in the examples, they are very different in appearance then an alternative method to Tim Barrass' would be
Open the first image in gimp, find the co-ordinates of a landmark feature
Open the second image in gimp, find the co-ordinates of the same landmark
Calculate the offset
Shift the second image using ImageMagick's convert command with the affine option. Set the parameters sx=sy=1.0, rx=ry=0.0, tx= negative horizontal offset, ty= negative vertical offset