Tag Info

Hot answers tagged geometry-conversion

33

You can do polygon to centroid in QGIS using: Vector - Geometry Tools - Polygon Centroids

26

The simplest way is to use the points to create the line. To do this in QGIS use the Points2One plugin. Install this plugin (available via Plugins->Manage and install plugins) and follow the dialog to create a line from your points. If you have multiple lines, then make sure your points data has a suitable ID field to identify the lines they belong to....

23

From your point layer you can create Voronoi plogyons Which would result in this Then create a mask from Delauney triangulation process And then clip the Voronoi polygons layer with it. Would that be good enough? You can also try combining your Delauney triangulation mask with a buffer of your point layer and use that to clip your Voronoi polygons ...

21

I discovered a page named Constructing polygons from the shapes of other features on Esri's site that should allow you to contruct polygons from your lines with only an ArcEditor/Standard license. You can select the lines you want to convert to polygons, then use the Construct Polygons button on the Topology toolbar (ArcGIS 10.0 or earlier) or the Advanced ...

21

You can do polygon to border nodes in QGIS using: Vector - Geometry Tools - Nodes extraction

20

Voronoi polygons with a dissolve will give you the first part. Starting with your points, each set should have its own unique identifier ('col' in this example). Three col values with a set of points: Vector|Geometry tools|Voronoi Polygons with a 20% buffer gives you the 'boundary between points': Using 'col' as the dissolve variable with Vector|...

19

Converting lines to polygons will be easy: (Vector > Geometry Tools > Lines to polygons) To deal with dangling ends, you could create a buffer around the polylines (Vector > Geoprocessing Tools > Buffer) and set them to 'dissolve'. This would attach any dangling endpoints to eachother. Then convert the buffer polygons into lines (Vector > ...

19

Assuming you're using QGIS >= 1.6.0, the menu option you need is Vector|Geometry Tools|Polygons to Lines, which will create a new shapefile with all the attributes of the original. In QGIS 2 Vector > Geometry Tools > Polygons to lines In QGIS 3 Processing Toolbox > Vector Geometry > Polygons to lines

17

I know this is old but I was looking for the same as I don't have ArcInfo for the FeatureVerticesToPoints tools. After using Search cursor solution above I went forward to simplify the code and found that using NumPy Arrays in the Data Access Module a simple and very quick script could be produced. I'm using this as a script tool. Note: The key is the ...

12

For dealing with the dangle problem I suggest you try the Polygonizer plug-in, see here.

11

It can be done in a few ways, using self-joins or correlated subqueries but using window functions is probably the easiest way. The function lead() returns a value that's ahead in the given partition and our partition is (PARTITION BY <vehicle_id> ORDER BY <timestamp>) This query gives us the vehicle number, the position of that point in ...

11

To create polygons from points,you can also use 1) "points to path", then 2 ) "lines to polygons" tools without need to install any plugin

10

The Vector -> Geometry Tools -> Extract Nodes tool will generate a point layer shapefile with points at each vertex of each line.

10

What's wrong with the one-liner: > ptsCoarse = as(coastsCoarse, "SpatialPointsDataFrame") Converts the geometry and preserves the attributes, and gives you some more attributes so you can reconstruct the lines back if you so desire: > head(ptsCoarse@data) ScaleRank FeatureCla Lines.NR Lines.ID Line.NR 0 1 Coastline 1 0 ...

10

The spped of the different approaches will, of course, depend on the complexity of the polygons involved. The algorithms to calculate a centroid, as with ST_Centroid, require you to actually deserialize the polygon as @dbaston has said, and also do the calculation using all the points. ST_Xmax, ST_Xmin and ST_Ymax, ST_Ymin will be faster, as there is less ...

9

In QGIS to convert a polygon into a point you would use the Polygon Centroids tool. This is found under Vector>Geometry Tools>Polygon Centroids... This will also preserve attributes and puts the point in the geometric centroid of the polygon. Edit: For points around the perimeter, you will want, as mentioned, Vector>Geometry Tools>Extract Nodes... This ...

9

When you import the data into SQL Server, put it into a VARBINARY(MAX) column. You should then be able to CAST this as a Geometry or Geography as required. You will need to be careful that the string 0xE6 ... is not changed during the import. Another option is to do a dynamic query to get the selection. I put a couple of conversion examples below. -- As a ...

8

You could use line-to-polygon tool (See How can I transform a polygon to a linestring in QGIS?) followed by v.clean command (See http://grass.osgeo.org/grass64/manuals/v.clean.html).

7

use ST_MakeLine function in postgis. info here... ST_MakeLine — Creates a Linestring from point or line geometries. Example: SELECT gps.gps_track, ST_MakeLine(gps.the_geom) As newgeom FROM gps_points As gps GROUP BY gps.gps_track; i hope it helps you...

7

Download the ET Geowizards toolbox (Free) and use the createCenterlines tool. I think that should do the trick.

7

You need to break it down to points if they're good points and reconstruct. Polylines are made from paths, polygons are made from rings. Although they are created in a similar way they are not compatable, hence your error. Go through each point on the line adding a point to your output array and then insert. here's a post that might help Get all the points ...

7

So... I'm answering my own question. I'm just selecting my answer because it's not using GRASS and, at the moment, I'm trying to stick to the QGIS environment (in the future, I'm almost sure I'll need to invest more in GRASS). So... this is what I've did: I selected the select attributes by rectangle selected my whole layer Opened the layer attribute ...

7

I seem to have found the answer. Within ArcToolbox, Feature to Point seems to do the trick. Converts 1 multipoint to 1 singlepoint.

7

One approach is to convert this to raster and then extract contours Another is to find the buffer for each point;Dissolve those buffers to get a narrow polygon;Find the center line of each dissolved polygon.

6

This looks like it must be a O(n^2) algorithm for n points (although I have been unable to prove this). That means it will scale poorly and you're doomed to long computation times with more than a few thousand points. But some observations will help: Each "direction" is really two directions, that of a ray and another ray in the opposite direction. It ...

6

Building on @MickyT's answer, since you're going to have a table with your values already sitting in WKB (or whatever we're calling it), you would want to write sql that will convert all records to geometry, rather than having to declare a variable, etc. etc. So if you start off with a simple temp table that would replicate the WKB in one record, it would ...

6

You can use the centroid of the polygons as Ahsan Mukhtar says The polygons import geopandas as gpd polys = gpd.read_file("polygons.shp") polys.head() POLY_NUM Zn Pb geometry 0 24 10 0 POLYGON ((-716632.5126561673 -954202.638843462 1 25 30 34 POLYGON ((-716623.8860221611 -954167.954016855 2 ...

5

You want to use the ST_MakeLine function. There is an example of almost exactly what you are trying to do (if I have understood you correctly) here

5

ET Geowizards will easily convert Polylines to Polygons (preserving attribution) http://www.ian-ko.com/ET_GeoWizards/gw_NoRestrictions.htm Current Version is ET GeoWizards 10.1 (released 12 November 2011) Credit goes to Ianko Tchoukanski for producing and maintaining this excellent ArcGIS tool.

5

Well, we put an answer here which is not a complete answer to our question, that is, the question will remain "open for answering". It is however a solution for the problem in the question. Here is the trick we used: First let see the results: So the given lines in the left built polygons shown in the middle. They are real polygons as shown in the right;)...

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