Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Hot answers tagged

10

You can use the v.voronoi tool from GRASS to create voronoi polygons, and it will enables you to specify an extent based on layer extent:


7

First, run MakefeatureLayer to enable the Ratio Policy on a specific field. Then, run the FeatureLayer though Intersect, it will honor the split policy rule. The field specified must be Numeric.


5

There is no "snap to sketch" equivalent in QGIS, unfortunately. There are a couple of ways to deal with this situation, but each involve a couple of steps. Go to View > Toolbars, and enable the Shape Digitizing Toolbar. One of the tools is for creating rectangles. There are several different options within that tool. For more precision, you may want to use ...


4

There is an option to activate the Control feature rendering order under Symbology: in which you can identify the rendering order based on a field: However, since overlapping polygons are considered topologically incorrect, it is better to clean the contour polygon to get rid of overlappings. The solution is to use v.clean tool from Processing toolbox -&...


4

You can do this simply, by adjusting the buffer. Here is an example. The following polygon and points layers would normally result in the problem you illustrate in your question. When running the Voronoi polygons tool, increase the buffer region percent. The exact amount will vary, but since we're clipping the result, it won't hurt to overshoot. In my ...


3

From the examples in the plpygis documentation, it gives : Some functions that analyze or manipulate geometries are possible in SQL but are easier to model in a procedural language. The following example will use Shapely to find the largest component polygon of a multipolygon. CREATE OR REPLACE FUNCTION largest_poly(geom geometry) RETURNS ...


3

Two options: If your geometries are defined in EPSG:4326, you can simply assign the SRID to the column: SELECT UpdateGeometrySRID([<schema>,] <table>, <column>, <SRID>); as a shorthand for ALTER TABLE [<schema>.]<table> ALTER COLUMN <column> TYPE GEOMETRY(<GEOM_TYPE>, 4326) USING ST_SetSRID(<column&...


2

If it's for specific cities and regions, you can use Overpass Turbo to create queries like admin_level=6 to find border ways. You'll want to consult the Tag:boundary=administrative wiki page to make sure that you're using the right admin level for the country you're looking at. If, however, you want to just extract those borders for the whole planet, you'll ...


2

In the first graph you have selected only the NDVI band using l5.select('NDVI') While in the second graph you do not do that, and then the band defaults to the first band values. That's why the values differ. Try: //Create a graph of the time-series. var graph = ui.Chart.image.seriesByRegion({ imageCollection: l5.select('NDVI'), regions: col, reducer: ...


2

Spacedman's nsplit is a great solution, deserves a tick. If you're happy to try this with sf, sf::st_sample() is vectorised: library(sf) library(dplyr) nsplit = function(X,n){ p = X/sum(X) diff(round(n*cumsum(c(0,p)))) } nc <- read_sf(system.file("shape/nc.shp", package="sf")) %>% st_transform(32617) # for you, sfdf <- st_as_sf(spdf) ...


2

If your data is a string you will need add any extra [] then convert it into an array of coordinates var polyCoords = '[3143090.603086447, 9928281.393790578], [3283734.7351311715, 9928892.890016861], [3181003.3691158947, 9849398.380600277], [3143090.603086447, 9928281.393790578]'; var pointCoords = '[3229617.319105267, 9916160.39109719]'; var ...


1

What you need to use is Tabulate Area tool. In fact, this a direct application of Tabulate area tool, but it requires Spatial Analyst extension: in_zone_data: Use the land use as input zone feature, zone_field: choose the field that defines the land use in_class_data: use the flood reclass raster data that will have their area summarized within each land ...


1

You could convert your flood hazard raster to polygon using the "Raster to Polygon" tool. You can then interest this with the Land Use vector file and calculate the areas of each using the "Calculate Geometry" function in the attribute table.


1

Try Thin greyscale image to skeleton plugin: The Thin Greyscale plugin will thin a greyscale image to a greyscale skeleton image, given a set of levels Convert polygon to raster with Rasterize Run Thin greyscale image to skeleton plugin Convert to polyline using GRASS r.to.vect


1

This method should let you achieve your first option, "each of the smaller area will be associated only with one of the bigger areas" Select the sliver polygons using the "select features by expression" tool, with the expression $area < threshold. Substitute a minimal area value where the expression says "threshold". Use the tool "eliminate selected ...


1

Perhaps: Split it out by polygon ID, use the different polygons to clip one another, and merge the results as a new polygon?


1

There's probably a better way to do this but I think this will generate what you want: nsplit = function(X,n){ p = X/sum(X) diff(round(n*cumsum(c(0,p)))) } where X is a vector of sizes and n in the total. Example: > nsplit(c(1,2,3,4,5),123) [1] 8 17 24 33 41 Those numbers sum to 123 and are approximately in the ratio 1:2:3:4:5. See also this: >...


1

You are comparing each geometry to itself, and for [ST_]Within/[ST_]Contains, a geometry is a positive match for itself! You need to self-join the table to allow for comparisons between different rows of it: SELECT a.id, COUNT(b.id) FROM <table> AS a JOIN <table> AS b ON ST_Within(b.geom, a.geom) AND a.id <> b.id GROUP ...


1

This happens often often to me when dissolving polygons. The only reliable and easy way that I found was to buffer the polygons with a minimal distance that is still acceptable for you (e.g. 0.001 meters).


1

A very simple implementation would be to perform BFS filling the polygon with the geohashes. Then you can recursively breakdown the edges into higher precision. Here's an example Example BFS


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