New answers tagged

0

This has nothing to do with improving raster to polygon conversion but, rather a bit of lack of understanding in how this should be applied. Converting a raster to polygons is intended to convert integer rasters with clustered values (eg., landcover) to a vector geometry. You are trying to convert a floating point raster with no discrete spatial patterns. In ...


1

import arcpy def rotateXY(x,y,xc=0,yc=0,angle=0,units = "DEGREES"): import math x = x - xc y = y - yc if units=="DEGREES": angle = math.radians(angle) xr = (x*math.cos(angle))-(y*math.sin(angle)) + xc yr = (y*math.sin(angle))+(y*math.cos(angle)) + yc return xr,yr def createIndexPoly(X,Y,h=5,w=5,sr=None): angle = 20 ...


1

Using SQL in QGIS DB-manager, you have lots of flexibility select a.id, a.FSI, sum(b.FSI*0.35) as sum_neigbour, sum(b.FSI*0.35) + a.FSI as result from FSI a left join FSI b on st_intersects(st_buffer(a.geometry, 450), b.geometry) group by a.id Gives you following result:


3

As BERA said, dissolve is the tool. The trick is in create a field with values equals for each contiguous feature to dissolve. So, I digitizing, approximately, your shapefile and it looks as follows: If I want to dissolve all features, I have to create a field (e.g. common) with the same values in each record. Following image presents result of Dissolve (...


4

You can not use Excel to this, because the number of characters per cell in Excel is limited to 32767 characters. See https://support.office.com/en-us/article/excel-specifications-and-limits-1672b34d-7043-467e-8e27-269d656771c3. This means Excel cuts off WKT strings which are longer and therefore become invalid. I am not aware of another software like ...


0

A simple query to do this is: SELECT pt.id, poly.* FROM grid pt JOIN polygons poly ON ST_Intersects(poly.geom, pt.geom); One caveat: this will return multiple records if a point lies in multiple polygons. To ensure only a single record is returned per point, and also to include points which do not lie in any polygon, use: SELECT pt.id, poly.* FROM ...


0

A more refined and faster procedure, which does not have a problem with zero or negative is as follows: Make sure the raster has values that can be divided into classes as integers, so multiply by 10, 100 or whatever gives you large numbers. These can be real numbers, not necessarily integers; in the next step they will be rounded. Use GRASS r.reclass, and ...


2

I'm not some expert for OpenLayers, so I came up with rather primitive method, but it works. One possible solution is to create separate point style for each point, with it's index as text. Solution could then look something like this (in old notation, I'm not familiar with ES6): var polygon = new ol.geom.Polygon(); polygon.setCoordinates([polyCoords]); ...


0

@nbeuchat, I found your idea interesting, at least from my point of view, But function ST_Buffer() distorts the boundaries and so you don't mind my suggestion next, run your script without ST_Buffer and see the result :-)... SELECT (ST_MakePolygon(ST_ExteriorRing(ST_Union( ST_Difference(ST_ConvexHull(ST_Union(geom)), ST_Collect(ST_Convexhull(geom))), ...


1

The correct way would be, var polyJson = JSON.parse($parameters.polygonString); var poly = Polygon.fromJSON(polyJson); Take a look here ArcGIS Docs - Using fromJSON


0

Just in case any one else finds this question, I think the problems were occurring because of geometry errors. Unfortunately, these were not picked up with the QGIS check and fix geometry tools. However, I was able to run the layer through ArcGIS repair geometry before using dissolve, and this seemed to resolve the issue. I've had no problems with it since.


1

Reference Scale can do this. Although it would have to be a very different scale to your current map scale to have that kind of effect. See: Units and Symbol Size (Scroll down to the 'Reference Scale' section).


2

If your layer is a MultiPolygon layer it easy to join the two multiparts of your polygon just using the Reshape Feature tool combined with the Merge Feature tool (both in the Advanced Digitising Toolbar). Reshape the edge of one of the parts to overlap the second part. Select the two tarts that you want to join. Use the merge tool to join them. See ...


0

Conceptually: Iterate over each large polygon, using intersect to determine which small polygons intersect it. Then, using the centroid of each small polygon as it's 'location', calculate the distance and bearing of each small polygon to that large polygon. The data will be assigned to each small polygon.


0

Sorry I don't know WikiMapia, but maybe you can find something useful from Natural Earth? https://www.naturalearthdata.com/downloads/ At the current date all the maps downloadable from the website are in the public domain. All versions of Natural Earth raster + vector map data found on this website are in the public domain. You may use the maps in any ...


2

You can convert your Pol_large into an sf object using the library sf. And then apply the function st_intersection to it. Pol_inters <- st_intersection(st_as_sf(Pol_large)) Your attribute table then looks like this, with the IDs separated by comma: Simple feature collection with 6 features and 5 fields geometry type: POLYGON dimension: XY bbox: ...


0

I fixed it by using the v.generalize.smooth GRASS plugin; now the buffer works on every polygon.


1

A short summary: The latitude and longitude points in my data were an sf object since I had a column containing rows of characters points (which also needed to be changed using st_as_sf) such as [1] POINT (-82.34323174 29.67058748) [2] POINT (-82.3432356 29.67058998) and so on. Then next, my shapefile was a LINESTRING type, not Polygon so that also had to be ...


0

If you need only the geometry and not the attributes, just running normal Vector→ Geoprocessing Tools → Union with no Overlay layer [optional] should do the trick.


0

See the Spatial Join Largest Overlap tool which can be downloaded here: https://www.arcgis.com/home/item.html?id=e9cccd343bf84916bda1910c31e5eab2 "This tool presents a new spatial relationship, Largest Overlap, where a target feature is joined to the join feature with the largest area or length of overlap."


4

In the processing Toolbox, under SAGA, you have a treatement called polygon self-intersection which seems to be what you're seeking ... (as a result, i seem to recall you will have a new field aggregating the id of all the polygons intersecting)


0

Give a try to the "Check Geometry" tool under the Vector menu in QGIS.


1

Sample shapefiles: Use this script. Change paths. import geopandas as gpd # Read shapefiles. Change paths zipcodes = gpd.read_file(r"C:\PATH\TO\ZIPCODE.shp") lines = gpd.read_file(r"C:\PATH\TO\LINES.shp") df = gpd.sjoin(lines, zipcodes, op="intersects") # ZIPCODE: zip codes column name in your shapefile. Don't forget to change it lines["...


2

I suppose you have a dataset of points. To achieve described visualization you should use three tools from the Processing panel. Step 1. Heatmap — this tool makes a raster layer from a vector point layer. It's a necessary step to resolve the problem. Step 2. Contour tool to transform a raster layer to a vector line layer. Step 3. Lines to Polygons tool ...


1

The convex hull idea worked pretty well but has the disadvantage of including parts of neighborhoods on the other sides of the source neighborhoods. The following query builds on the convex hulls idea but fix the areas around the original neighborhoods. SELECT ST_Buffer(ST_MakePolygon(ST_ExteriorRing(ST_Buffer(ST_Collect(ST_Difference(ST_ConvexHull(...


5

As mentioned in comments, a ST_ConvexHull is by far the easiest solution to generate your desired Polygon: SELECT ST_ConvexHull(ST_Collect(shape)) AS geom FROM subquery ; ST_Collect is a lot more performant compared to ST_Union, and ST_ConvexHull will happily work with MULTI* geometries and GEOEMTRYCOLLECTIONs.


0

Not exactly what you want, but Close enough? select st_convexhull(st_collect(geom)) as geom from( select geom, st_clusterdbscan(geom, eps:=25000, minpoints:=2) over () AS cid --polygons within 25000 map units are grouped together from ( select * from ak_riks where "kommunnamn" IN ('Askersund','Karlstad','Katrineholm','Karlskoga','Ludvika')) sub) cluster ...


10

To have a polygon layer with a texture orientated according to the rotation of the polygon you can use this expression: angle_at_vertex(shortest_line(centroid(oriented_bbox($geometry)), boundary(oriented_bbox($geometry))),0) Add the expression in the Orientation variables of the fill as shown in the image With this expression, the orientation of the ...


Top 50 recent answers are included