19 votes
Accepted

Generalizing polygon file while maintaining topology in QGIS?

GRASS is topology-aware. You can use v.generalize from the Processing toolbox to simplify polygons and if the input data is topologically correct so will the output.
user avatar
  • 81.9k
19 votes
Accepted

Identifying overlapping polygons in single layer using QGIS?

Enable Topology Checker Plugin in Plugin Manager. Add your polygonal layer in Topology Rule Settings window, select "must not overlap" rule and add them. To see overlap errors click on Validate button....
user avatar
  • 3,473
14 votes

Is the erratum about polygon point order in GeoJSON correct?

There are TWO "right hand rules" (well, scores, if not hundreds, but the direction of magnetic force induced on a positive charge isn't relevant to this discussion). One asserts that vertices be ...
user avatar
  • 18.8k
13 votes
Accepted

Changing drawing priority for selected feature in QGIS

You can change drawing order for the selected features using Symbology tab in Layer Properties. Open Symbology tab in Layer Properties or Layer Styling (F7). Check Control feature rendering order. ...
user avatar
10 votes
Accepted

Intersection postgis TopologyException

I just had a similar problem, and the solution is the following: You have many queries, so the first question is which one of them fails. I'd suggest bisecting the entire SQL query to find where the ...
user avatar
  • 2,294
10 votes
Accepted

Where does PostGIS store its topology tables?

Topology functions are stored in the topology schema, topology data (edges, faces, nodes, relations) are stored in a user-defined schema, and relations (topo id, layer id, element id, element type) ...
user avatar
  • 2,494
10 votes
Accepted

Can a shapefile have polygons that overlap each other?

Yes - there is no restriction on the actual shapes or positions of the polygons in a shapefile. The only real restriction is that you can't mix geometry types in a shapefile (so no points & ...
user avatar
  • 74.7k
10 votes

Solving topological errors like invalid geometries in QGIS?

The most successful way I've ever had of correcting topological errors in QGIS is actually to use GRASS. You can either: run v.clean from the processing toolbox (manual here https://grass.osgeo.org/...
user avatar
  • 3,649
10 votes
Accepted

Removing green Xs and red lines in QGIS

You are in the middle of editing or creating a new line feature. If you toggle the layer visibility you still see the half-created feature, and if you toggle editing off in that layer you'll still see ...
user avatar
  • 51.2k
10 votes
Accepted

How can I enable topological editing in QGIS 3

In QGIS 3.4 you may need to enable Snapping toolbar by right-click the main menu bar and select Snapping toolbar, and you will find this menu: The last three icons are Enable Topological Editing, ...
user avatar
  • 36.2k
10 votes
Accepted

Selecting features that do not touch other features in same layer in QGIS

You can use the function overlay_disjoint() (see documentation): overlay_disjoint(@layer) via "Select by expression" (see documentation) to select the features. Then you can delete them or ...
user avatar
  • 24.9k
9 votes

How to remove spikes in Polygons with PostGIS

Here is a link to my PL/pgSQL function which does exactly what the OP is asking for: removing spikes from polygons and linestrings. Here you can download it and read the documentation: PostGIS ...
user avatar
  • 219
9 votes

Select polygons within polygons in same layer

To SELECT those that are within others (courtyards): SELECT a.* FROM <buildings> AS a WHERE EXISTS ( SELECT 1 FROM <buildings> AS b WHERE a.<id> <> b.<id> ...
user avatar
  • 23.3k
8 votes

Generalizing polygon file while maintaining topology in QGIS?

This can be seen as a preliminary to @Underdark's answer whereby you can clean the topology of the vector layer before generalizing. GRASS has a v.clean function which contains a number of tools to ...
user avatar
  • 72.2k
8 votes
Accepted

Finding four states each of six pairs of which have common boundary using PostGIS?

Here's an attempt with postgis. i've used data imported from natural earth data, admin level 1, 1:10m scale. This will take a long time as it's a 4-way cartesian join with st_relate(). The magic ...
user avatar
  • 19.8k
7 votes
Accepted

What's difference between Topology and Check Validity in QGIS?

Topology means "the rules and behaviors that model how points, lines, and polygons share coincident geometry." (Source.) These rules can apply specifically to geometry and how it is stored, or be ...
user avatar
  • 15.5k
7 votes
Accepted

Create polygon from lines in PostGIS

I got this working by using ST_Node first, in conjunction with ST_Collect, to convert the lines into a set of noded linestrings within a MultiLinestring. As it says in the docs for ST_Node: Fully ...
user avatar
  • 13.2k
7 votes

Dragging all vertices at a given point programmatically in PyQGIS

This can be done using QGIS tools that you can enable programmatically. That is, there is no need to reinvent the wheel. Namely, you need to: Click on the Enable Topological Editing button in the ...
user avatar
7 votes

Topological editing of vertices that are common in two adjacent polygons in QGIS

Once in edit mode, select the vertex tool, then on the snapping toolbar, select enable topological editing and at last left-click once on the shared vertex, move them, click a 2nd time to set the new ...
user avatar
  • 34.3k
7 votes
Accepted

Select polygons within polygons in same layer

Use "Select by expression" with overlay_within(@layer).
user avatar
  • 436
6 votes
Accepted

How do you remove isolated roads from a bigger network?

My solution to this was kind of a kludge, but then I was doing a small class project working with a subset of one county's roads so the network wasn't that big and I didn't need to do it as a common ...
user avatar
  • 15.5k
6 votes
Accepted

How to generate pgrouting source and target with OSM?

In case you haven't tried it yet, the pgRouting Workshop is always a good place to get started. When you used osm2po to convert your OSM data, then source and target attributes are already there and ...
user avatar
  • 4,697
6 votes
Accepted

How to suppress polygon boundaries shared by objects of same type in QGIS?

That's possible using symbol levels - just like when creating a road style for linear features. Here an example using Natural earth countries: it looks as if they have been dissolved - but it is ...
user avatar
  • 81.9k
6 votes
Accepted

Automatically add vertex to polygon where vertex of another polygon touches it?

You could build a topology in a geodatabase, and then when you validate that topology, it will add vertices in the manner you describe. http://resources.arcgis.com/en/help/main/10.2/index.html#/...
user avatar
  • 2,358
6 votes

PostGIS Topology Requires Admin

The set of SQL commands that were needed for PostGIS 2.2.1: create extension postgis_topology; grant usage on schema topology to dbuser; grant all on all tables in schema topology to dbuser; grant ...
user avatar
  • 1,141
6 votes
Accepted

What is nontopological geometry?

I would not apply the term "non-topological" to a geometry. Basically, the shape of a geometry can be modified without affecting its topology, but this does not imply that you do not modify the shape ...
user avatar
  • 48.5k
6 votes

Errors when using QGIS Topology Checker with must not overlap rule

When the topology checker highlights a feature in red, it means that feature violates one of the rules. Since your only rule is "must not overlap," when a polygon is red it means that polygon ...
user avatar
  • 23k
6 votes
Accepted

Export topology checker results as table/shapefile in QGIS

Here is a bit of a hack I came up with which should do what you want. With the Topology Checker dock widget open and the table populated with some errors, open the Python console, paste the following ...
user avatar
  • 13.6k
6 votes
Accepted

Making vector geometries "Kiss" in QGIS

A better method to simplify is using the GRASS tool v.generalize from Menu Processing / Toolbox. It keeps topology intact, thus no need to fill sliver polygons. I' m not sure if you only have gaps - ...
user avatar
  • 40.1k
6 votes
Accepted

Unique attribute value across multiple layers

You might want to consider generating a UUID field for every table. QGIS supports GeoPackages, which are based on SQLite. There are discussions over at SO for how to generate SQLite UUID fields. See ...
user avatar
  • 2,751

Only top scored, non community-wiki answers of a minimum length are eligible