Skip to main content
15 votes
Accepted

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 ...
Vince's user avatar
  • 20.2k
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. ...
Kadir Şahbaz's user avatar
11 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 ...
Eggplant's user avatar
  • 239
11 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 ...
Spacedman's user avatar
  • 65.1k
11 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 ...
MrXsquared's user avatar
  • 34.9k
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 ...
culebrón's user avatar
  • 2,324
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) ...
katahdin's user avatar
  • 2,544
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 & ...
Ian Turton's user avatar
  • 82.2k
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/...
Ed Rollason's user avatar
  • 3,948
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, ...
ahmadhanb's user avatar
  • 41.1k
9 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 ...
Steven Kay's user avatar
  • 20.5k
9 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 ...
Ben W's user avatar
  • 21.8k
9 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 ...
JGH's user avatar
  • 42.3k
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> ...
geozelot's user avatar
  • 30.4k
8 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 ...
John Powell's user avatar
  • 13.7k
8 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 ...
Germán Carrillo's user avatar
8 votes
Accepted

PostGIS check if multiline string is included in polygon

It seems "included" here means intersects, rather than true containment; you want to run SELECT nw.* FROM "NeighbourhoodWatch" AS nw JOIN gis_streets AS gs ON ST_Intersects(...
geozelot's user avatar
  • 30.4k
8 votes
Accepted

Select polygons within polygons in same layer

Use "Select by expression" with overlay_within(@layer).
LM10's user avatar
  • 446
7 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 ...
anneb's user avatar
  • 1,381
7 votes
Accepted

Redistributing duplicated points inside the polygon

Here is how you can do this using a PyQGIS script. Open the Python-Console, copy paste the code, change your settings at the top of the code and hit run. You can also cancel the execution via QGIS-...
MrXsquared's user avatar
  • 34.9k
7 votes

Redistributing duplicated points inside the polygon

If you have a PostgreSQL BD with PostGIS, you can do the following query : SELECT a.*, ST_GeneratePoints(b.geom, 1, floor(random() * 5000 + 1)::int) AS new_address_geom FROM addresses a, ...
J. Monticolo's user avatar
  • 15.8k
7 votes
Accepted

Allow overlapping polygons in QGIS

Look at the panel "snapping toolbar"
Christophe P.'s user avatar
6 votes

Remove pseudo nodes in QGIS

Some options for pseudo-node removal with QGIS version 2.18: QGIS Dissolve will remove pseudo-nodes in a line data set. It creates multi-lines. By running QGIS Multipart to Singleparts, one gets ...
Håvard Tveite's user avatar
6 votes
Accepted

Grass Processing tools via QGIS : v.clean snap, chdangle, and rmdangle

Sometimes it's easier to understand something with the help of graphic or images. This post explains how to clean topology error with GRASS v.clean tool with some images and explanation about the ...
user104406's user avatar
6 votes
Accepted

pgrouting no result // topology problem

EDIT 3: After a long discussion in the comments I reviewed my answer, taking the sample data and it´s upload into PostgreSQL from within QGIS into account. I deleted my EDIT 2 as it became useless. ...
geozelot's user avatar
  • 30.4k
6 votes

Self-Contact Topology Errors?

There are quite a few automated tools for checking and repairing geometries in QGIS. The question is - why are they invalid in the first place? It may be helpful to go back upstream to figure out why ...
GISHuman's user avatar
  • 3,701
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 ...
csk's user avatar
  • 24.9k
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 - ...
Babel's user avatar
  • 73.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 ...
Encomium's user avatar
  • 3,143
6 votes

Cryptic PostGIS/GEOS topology error

This error is caused by a robustness issue in the GEOS overlay code used in PostGIS. So essentially in this case it's a bug, not a problem with your geometry inputs. That is a fairly recent version ...
dr_jts's user avatar
  • 5,143

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