Hot answers tagged

5

Starting with a polygon layer A: Dissolve polygon layer A -> Polygon layer B Buffer B by a tiny negative amount -> Polygon layer C Zoomed right in you can see the difference: Convert polygon layer A to Lines -> Line layer D This looks the same as the original polygons but its represented by lines which means we can cut lines out of it: Intersect ...


4

Generate Near Table using the "closest" parameter set to ALL will build you a table showing the distance between every feature in one layer with every feature in another layer. You can then run summary statistics on this table (in Excel or some other table software) to identify the min and mean distance values for each input polygon. The more ...


4

you can use the processing tool "multiparts to singleparts" before: this will convert the multipolygon (the green one) into single polygons which you can join/merge afterwards.


3

Its close to being like a part of a WKT format string. You have: "5 50 0 0.5; 20 50 0 0.5; 5 40 0 0.5; 20 40 0 0.5" and the relevant WKT string would probably be: "POLYGON ((5 50 0 0.5, 20 50 0 0.5, 5 40 0 0.5, 20 40 0 0.5))" To convert to that and make sf objects... Replace all semicolons with commas: gsub(";",",",...


2

It looks like the orange linestring crosses itself, which is related to issues #600 and #1068 in the shapely github repository. The problem is that shapely's split function splits complex (i.e. self-intersecting) linestrings at their self-intersection points in addition to the points where they intersect the splitter geometry. Here is a solution that I ...


2

You are looking for an automatic method for drawing connecting lines with the help of points to create a closed polygon. You are tagged this question with qgis-processing but convex hull, as suggested in a comment by @s.k, doesn't look as a good option because there are points not considered in final produced layer (I tested it). Concave hull (k-nearest ...


2

In QGIS 3.16+ there is a new function: main_angle() that makes things easier.


2

As an alternative approach using the "Geometry Generator" via RMC > Symbology > Symbol layer type: Geometry Generator. Keep in mind that this approach depends on the capabilities of your PC. In the working window insert the following expression buffer( collect( $geometry, group_by:="REGION_UN" ), 0) Here the ...


2

I found out, that I missed the label-TAG with PropertyName: <TextSymbolizer> <Label> <PropertyName>name</PropertyName> </Label> <Font> <CssParameter name="font-family">arial</CssParameter> <CssParameter name="font-size">20</CssParameter> &...


1

Michael Dorman's answer looks quite similar to this PostGIS question, which was answered in more detail at this blog post. R's sf and PostGIS are similar in that they both build on the GEOS library, but don't have quite the same set of functions. Unfortunately I don't think the n.overlaps column in the result of sf::st_intersection() is counting what was ...


1

One way to define an "average polygon" could be the area covered by at least 50% of simulated polygons. Here is how this can be calculated using sf: library(sf) # Combine pol = kernel.poly.all pol = do.call(rbind, pol) pol = st_as_sf(pol) # Calculate average polygon pol_avg = st_intersection(pol) pol_avg = pol_avg[pol_avg$n.overlaps >= nrow(...


1

I think it could be possible by using Saga Union from QGIS processing tools. In following image I have a similar situation with two polygons. Filtering the tool in the browser of processing, you will have the following dialog window after it is launched. After click in Run, you will have a result similar to following image. I selected the small yellow ...


1

The solution to my problem was that I needed to use the snap geometries to layer tool in the Processing Toolbox. I used the farm shapefile as both the input and reference layer > Set Tolerance and Behaviour (for this I used snap to anchor nodes (single layer only)) > Run. Then I went to Vector > Check Geometries to make sure all topology errors were ...


1

At this point: st_intersection(i, flood.year) i is a number (your loop index). So its trying to do st_intersection( 1, flood.year) and telling you it doesn't know how to intersect a number with some polygons. I guess you need to subset one of your spatial data objects using that index and intersect that.


1

You can simply change the Image width: depending on what size you want, define a value for the no. of pixels the fill image should have:


1

I think the problem on this is that in the addDrawToolbar command, you have position equal to: c('topleft', 'topright', 'bottomleft', 'bottomright'). You need to pick one of these, like position = 'topright'.


1

Remove the ; at the end of where st_contains(ST_asText( ST_Polygon('LINESTRING(5.303 51.629, 5.387 51.626, 5.393 51.588, 5.281 51.592)'::geometry, 4326) ), visvangsten.locatie); You also have to close your polygon. Change it to something like: ST_Polygon('LINESTRING(5.303 51.629, 5.387 51.626, 5.393 51.588, 5.281 51.592, 5.303 51.629)


1

In the end I ended up using the following tools 1) Densify, 2) Feature Vertices to Points and 3) Near tool. Although it is not perfect it is a more precise way than buffer analysis.


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