More

Issue with dissolving a polygons layer in QGIS 2.4


I downloaded a dataset of roads and parks from OSM. I then buffered the roads and merged with the parks. Now - all i want is to dissolve / union all the features in the merged layer.

I fail to do it using QGIS, even though a test of the same layer in ArcGIS 10.0 worked.

By failing i mean: it takes ages and creates an empty layer at the end.

When trying on a much smaller dataset from the same layer in QGIS it works, so i assume the dataset is valid.

Did anyone else face this issue?

Do you have any idea how to approach it?


If the QGIS dissolve tool fails, you can use a dissolve tool from the Processing framework (e.g. SAGA or GRASS) instead.


Spatial analysis uses spatial information to extract new and additional meaning from GIS data. Usually spatial analysis is carried out using a GIS Application. GIS Applications normally have spatial analysis tools for feature statistics (e.g. how many vertices make up this polyline?) or geoprocessing such as feature buffering. The types of spatial analysis that are used vary according to subject areas. People working in water management and research (hydrology) will most likely be interested in analysing terrain and modelling water as it moves across it. In wildlife management users are interested in analytical functions that deal with wildlife point locations and their relationship to the environment. In this topic we will discuss buffering as an example of a useful spatial analysis that can be carried out with vector data.

Buffering usually creates two areas: one area that is within a specified distance to selected real world features and the other area that is beyond. The area that is within the specified distance is called the buffer zone.

A buffer zone is any area that serves the purpose of keeping real world features distant from one another. Buffer zones are often set up to protect the environment, protect residential and commercial zones from industrial accidents or natural disasters, or to prevent violence. Common types of buffer zones may be greenbelts between residential and commercial areas, border zones between countries (see Fig. 10.6 ), noise protection zones around airports, or pollution protection zones along rivers.

Fig. 10.6 The border between the United States of America and Mexico is separated by a buffer zone. (Photo taken by SGT Jim Greenhill 2006). ¶

In a GIS Application, buffer zones are always represented as vector polygons enclosing other polygon, line or point features (see Fig. 10.7 , Fig. 10.8 , Fig. 10.9 ).

Fig. 10.7 A buffer zone around vector points. ¶

Fig. 10.8 A buffer zone around vector polylines. ¶

Fig. 10.9 A buffer zone around vector polygons. ¶


Citing maps and data

A Twitter conversation this week reminded me that it’s not always easy to cite data or maps you may use in your reports, papers, or theses. As a result, I revisited and updated a web resource I put together 10 or more years ago that lists sample citations for GIS maps and data, and points to other web resources with formatting guides: Citing Geospatial Data Remember, you will need to choose a citation format acceptable to your instructor, advisor, or journal editor.


Import coordinates from Excel to QGIS and create Polygons

One of the most common routines in the use of Geographic Information Systems is the construction of spatial layers from information from the field. Whether this represents coordinates, parcel vertices, or elevation grid, the information usually comes in comma separated files or Excel spreadsheets.

1. The geographic coordinates file in Excel.

In this case, I am trying to import the human settlements of the Republic of Cuba, which I have Diva-GIS, which by the way is one of the best sites to download geographic data from any country. As you can see, columns B and C contain the information regarding latitude and longitude in the form of Geographical coordinates.

2. Import the file into QGIS

To import the coordinates of the Excel file, it is done:

Vector> XY tools> OpenExcele file as attribute table or Point layer

In case the file is saved with an .xlsx extension, the browser will not show it, as it only filters files with an .xls extension. It is not a problem, we can apply old DOS techniques and write in the name change, the filter: *. * (asterisk dot asterisk) and we do Enter this will allow all the files in that location to be seen. We could have just written * .xls and it would have filtered only files with the .xls extension.

Then we have a panel in which we must indicate which column corresponds to the coordinate in X, in this case we choose the column of length, the column of latitude for the coordinate Y.

And there we have it. The query shows that the layer has been saved with the data contained in the Cuban human settlements file, which includes the name, latitude, longitude, classification, and administrative province.

3. Create polygons from coordinates

In case, we want not only to import the vertices but also to create a polygon in the order of these coordinates, we can use the plugin Points2One. This plugin allows you to identify how the destination layer will be called, if what we will import will be built as lines or as a polygon.

4. How to import coordinates from Excel to other CAD / GIS programs.

As you may recall, we have done this process with many other programs. As simple as QGIS, few. But here's how to do it with AutoCAD, Microstation, Manifold GIS, AutoCAD Civil 3D, Google Earth.


10.5. More spatial analysis tools¶

Buffering is a an important and often used spatial analysis tool but there are many others that can be used in a GIS and explored by the user.

Spatial overlay is a process that allows you to identify the relationships between two polygon features that share all or part of the same area. The output vector layer is a combination of the input features information (see Рис. 10.13 ).

Рис. 10.13 Spatial overlay with two input vector layers (a_input = rectangle, b_input = circle). The resulting vector layer is displayed green. ¶

Typical spatial overlay examples are:

Intersection: The output layer contains all areas where both layers overlap (intersect).

Union: the output layer contains all areas of the two input layers combined.

Symmetrical difference: The output layer contains all areas of the input layers except those areas where the two layers overlap (intersect).

Difference: The output layer contains all areas of the first input layer that do not overlap (intersect) with the second input layer.


Mdhntd

Did any laptop computers have a built-in 5 1/4 inch floppy drive?

How can I define good in a religion that claims no moral authority?

If my opponent casts Ultimate Price on my Phantasmal Bear, can I save it by casting Snap or Curfew?

Falsification in Math vs Science

What information about me do stores get via my credit card?

Does adding complexity mean a more secure cipher?

Deal with toxic manager when you can't quit

Cooking pasta in a water boiler

What does Linus Torvalds mean when he says that Git "never ever" tracks a file?

Will it cause any balance problems to have PCs level up and gain the benefits of a long rest mid-fight?

How much of the clove should I use when using big garlic heads?

How did passengers keep warm on sail ships?

What to do when moving next to a bird sanctuary with a loosely-domesticated cat?

Can an undergraduate be advised by a professor who is very far away?

Why can I use a list index as an indexing variable in a for loop?

How to charge AirPods to keep battery healthy?

Why not take a picture of a closer black hole?

Are spiders unable to hurt humans, especially very small spiders?

ELI5: Why they say that Israel would have been the fourth country to land a spacecraft on the Moon and why they call it low cost?

Old scifi movie from the 50s or 60s with men in solid red uniforms who interrogate a spy from the past

Button changing its text & action. Good or terrible?

Why doesn't shell automatically fix "useless use of cat"?

How to translate "being like"?

Quickly find all polygons that overlap with two or more polygons in Shapely

The 2019 Stack Overflow Developer Survey Results Are InHow to find the intersection areas of overlapping buffer zones in single shapefile?Find and list all polygons that overlap with another polygonHow to convert small overlaping polygon features to inner ring in QGISShapely (geos) crashes during unary_unionDissolving polygons based on attributes with Python (shapely, fiona)?Summing attribute values for areas where multiple polygons overlap using QGIS?ArcGIS find all polygons that intersect with more that one polygon from another layerClipping algorithm that can make one layer with no overlapping polygons from N polygonsMultipolygon created from Scratch LayerWhen does Shapely's “polygonize_full” detect a dangle?Cannot find polygons that are inside a big polygon using GeoPandas

I have a set of Polygons (in Shapely) that I wish to find all intersections that are comprised of overlaps of two or more polygons. I have been working based off the code found in this answer. I have a code so far that works in the if 1: statement below, but it takes a very long time to run. The code that is in the if 0: statement, runs quickly, but produces an output with some errors. See below for an example of the error.

Below, the orange represents all the shapes that I would like to check if they are produced (by unary union in Shapely) by two or more overlaps, the cyan represents the output of the if-statement that works (if 1 in above code), and the pink represents the incorrect selected polygons by the if-statement that doesn't work (if 0 in above code). The top left corners of the text boxes in the pictures represent that point being selected, and as you can see the second picture, the pink area only has one polygon from the STEREO_OBSERVATIONS (which is the set of polygons that are being checked for overlap) so it should not be selected. By contrast, the left adjacent cyan square to the pink square highlighted in the third picture has two polygons from STEREO_OBSERVATIONS and as such is correctly selected by the cyan result. The layering of the polygon layers is shown in the first picture.

What is the best way to query the STRtree structure so as to check to intersection or overlap? I have tried to use the centroid in the code, but that hasn't seemed to produce the correct output.

Fig. 1 (Legend/layering)

Fig 2. (Incorrect selection by fast algorithm [if 0 in code] in pink)

Fig 3. (Correct selection by slow algorithm [if 1 in code]


QGIS » QGIS Application

Recently this script has developed an issu. James Stott 05:55 Bug report #9356 (Closed): Atlas print does nto respect composition page size, orientation Hi
I've been testing the atlas updates here. One thing I got stuck with is that although I set the composition page . Tim Sutton 05:15 Bug report #9355 (Closed): Export/add geometric column terribly slow Even in the case of points (no complex calculations to do), it takes hours for half a million points (on a slow machi. Paolo Cavallini 04:53 Bug report #7209: WCS client seems broken Giovanni Manghi wrote:
> yeah I know, this is why I wrote "apparently". Anyway now I tested also under Windows and ap. Radim Blazek 04:05 Bug report #7209: WCS client seems broken Radim Blazek wrote:
> The last considerable change in WCS client was 3 months ago, so I have no idea how it got broke. Giovanni Manghi 04:20 Редакция 5310040a (qgis): add header installation of simplify methods Jürgen Fischer 03:07 Feature request #9326: Tolerance (snapping) during analyses Probably this could be solved with a new command, allowing the user to arbitrarily reduce the precision of coordinate. Paolo Cavallini 02:12 Редакция 2af29d18 (qgis): #9345: fix axis invert calculation Alvaro Huarte 01:18 Feature request #9352 (Closed): update 7 parameter transformation fir Israel ITM grid
Please update +towgs84 parameter for the Israel ITM grid (EPSG:2039).
The 7 parameter transformation is officia. Michael Davis


10.5. More spatial analysis tools¶

Buffering is a an important and often used spatial analysis tool but there are many others that can be used in a GIS and explored by the user.

Spatial overlay is a process that allows you to identify the relationships between two polygon features that share all or part of the same area. The output vector layer is a combination of the input features information (see figure_overlay_operations).

Рис. 10.13 Spatial overlay with two input vector layers (a_input = rectangle, b_input = circle). The resulting vector layer is displayed green. ¶

Typical spatial overlay examples are:

Intersection: The output layer contains all areas where both layers overlap (intersect).

Union: the output layer contains all areas of the two input layers combined.

Symmetrical difference: The output layer contains all areas of the input layers except those areas where the two layers overlap (intersect).

Difference: The output layer contains all areas of the first input layer that do not overlap (intersect) with the second input layer.


Hfrhyu

Is there a kind of relay only consumes power when switching?

Is there hard evidence that the grant peer review system performs significantly better than random?

Can the Great Weapon Master feat's "Power Attack" apply to attacks from the Spiritual Weapon spell?

Did Deadpool rescue all of the X-Force?

How fail-safe is nr as stop bytes?

How can I reduce the gap between left and right of cdot with a macro?

The code below, is it ill-formed NDR or is it well formed?

How do I use the new nonlinear finite element in Mathematica 12 for this equation?

Why does it sometimes sound good to play a grace note as a lead in to a note in a melody?

What is the topology associated with the algebras for the ultrafilter monad?

How often does castling occur in grandmaster games?

Why wasn't DOSKEY integrated with COMMAND.COM?

Why do we need to use the builder design pattern when we can do the same thing with setters?

What's the meaning of "fortified infraction restraint"?

How come Sam didn't become Lord of Horn Hill?

AppleTVs create a chatty alternate WiFi network

Question about debouncing - delay of state change

What would you call this weird metallic apparatus that allows you to lift people?

What is a fractional matching?

Why is it faster to reheat something than it is to cook it?

How to react to hostile behavior from a senior developer?

Can anything be seen from the center of the Boötes void? How dark would it be?

Quickly find all polygons that overlap with two or more polygons in Shapely

Unicorn Meta Zoo #1: Why another podcast?How to find the intersection areas of overlapping buffer zones in single shapefile?Find and list all polygons that overlap with another polygonHow to convert small overlaping polygon features to inner ring in QGISShapely (geos) crashes during unary_unionDissolving polygons based on attributes with Python (shapely, fiona)?Summing attribute values for areas where multiple polygons overlap using QGIS?ArcGIS find all polygons that intersect with more that one polygon from another layerClipping algorithm that can make one layer with no overlapping polygons from N polygonsMultipolygon created from Scratch LayerWhen does Shapely's “polygonize_full” detect a dangle?Cannot find polygons that are inside a big polygon using GeoPandas

I have a set of Polygons (in Shapely) that I wish to find all intersections that are comprised of overlaps of two or more polygons. I have been working based off the code found in this answer. I have a code so far that works in the if 1: statement below, but it takes a very long time to run. The code that is in the if 0: statement, runs quickly, but produces an output with some errors. See below for an example of the error.

Below, the orange represents all the shapes that I would like to check if they are produced (by unary union in Shapely) by two or more overlaps, the cyan represents the output of the if-statement that works (if 1 in above code), and the pink represents the incorrect selected polygons by the if-statement that doesn't work (if 0 in above code). The top left corners of the text boxes in the pictures represent that point being selected, and as you can see the second picture, the pink area only has one polygon from the STEREO_OBSERVATIONS (which is the set of polygons that are being checked for overlap) so it should not be selected. By contrast, the left adjacent cyan square to the pink square highlighted in the third picture has two polygons from STEREO_OBSERVATIONS and as such is correctly selected by the cyan result. The layering of the polygon layers is shown in the first picture.

What is the best way to query the STRtree structure so as to check to intersection or overlap? I have tried to use the centroid in the code, but that hasn't seemed to produce the correct output.

Fig. 1 (Legend/layering)

Fig 2. (Incorrect selection by fast algorithm [if 0 in code] in pink)

Fig 3. (Correct selection by slow algorithm [if 1 in code]


How to stylize polygons sharing the same attributes to represent a common outline

In QGIS 3.14.16, I want to outline multiple polygons which share same attribute value.

Styling the layer with the same attribute value bring the following result:

The style I wish to have is:

I could use the dissolve function to get the expected result. However, this is not a solution for me, as I need to modify frequently the attribute table.

Is there a way to configure such a style?

My final goal is to style polygons layer with:

  1. Outlined polygons in function of a field (as described above),
  2. Colored polygons in function of another field.

Graphically speaking, I want to jump from that style:

to this:

Polygons are colored with category according to field A. They are also outlined with category style according to field B.

Here are examples of what I tried so far:

Example 4 (this last example is the best way I found to circumvent that issue, see comments below):

One Answer

I would suggest using a Virtual Layer in conjunction with st_union() .

Given a layer of polygons s with attribute r , click New Virtual Layer. On the dialog that appears, click Import to bring in the layer s .

Under Query, enter the following query:

The result will appear as a separate layer in the table of contents, but being linked to the same data source, will update as edits are made to the polygons layer. This new virtual layer can be styled separately, such as with a categorized simple outline.

In the image below, a series of squares are symbolized by one attribute, and a virtual layer as described above is overlayed.

When the r attribute is edited for a selection of features, the virtual layer updates as well.


Solving invalid geometry in QGIS

I came across this issue when trying to use simplify on a polygon layer. Simplify stops because of invalid geometry (Example of problem spots).

When I try to check the geometry using the available tool (check validity), the whole polygon gets labelled invalid, and the areas indicated in the picture (Example of problem spots) are highlighted as errors.

I attempted to remove these areas by using delete holes, but this only fixes the errors inside the polygon and not those around the edges.

How can these be fixed in a methodical, automated way? I get hundreds of such errors along the edges of the polygon, and this process will eventually have to be repeated for hundreds of other shapefiles, so a manual approach is not feasible.

Background: I am using QGIS 3.2.3 - Bonn, and I have limited experience with the software and GIS in general. I did not generate the original polygons myself, so I don't have control over that unfortunately.


Watch the video: How to merge multiple ShapeFilesVector Layers into One ShapeFile Using QGIS Editor (October 2021).