20

In the Python console: you can use the Shapely module (as in How to create equidistant points in QGIS?) with the function point = line.interpolate(currentdistance) The new Python API of the master version (1.9) has an equivalent command (as in Generating chainage (distance) nodes in QGIS of Nathan Woodrow) point = geom.interpolate(currentdistance) or ...


19

There is now a plugin called QChainage that does exactly what you want. You specify an interval distance and the plugin creates points along your line at the specified interval.


14

This code will work on the lastest dev build of QGIS. from qgis.utils import iface from qgis.core import * from PyQt4.QtCore import QVariant import random def createRandomPoints(count): # Create a new memory layer to store the points. vl = QgsVectorLayer("Point", "distance nodes", "memory") pr = vl.dataProvider() pr.addAttributes( ...


12

Ah.. rookie mistake... The response included escaped backslashes facepalm. After removing those, it's all good.


11

I've written a script that changes the Sextante Densify geometries tool to accept a certain distance. It's called Densify geometries given an interval. After running Densify, you can extract the points using Extract nodes tool. You can get it from Github and install instructions are on my blog.


10

I assume you are wanting to join two line segments into one line. This is how I did it ... Enable editing. Turn on snapping ( Settings -> Snapping Options ... ) Select the node node tool. Double click close to the end of one of the lines to add a node. Drag the node at the end to snap onto the the end of the other line Select both lines Merge their ...


9

pyproj has the Geod.npts function that will return an array of points along the path. Note that it doesn't include the terminal points in the array, so you need to take them into account: import pyproj # calculate distance between points g = pyproj.Geod(ellps='WGS84') (az12, az21, dist) = g.inv(startlong, startlat, endlong, endlat) # calculate line string ...


9

You don't say which software you're using, but the thing you're looking for is Voronoi polygons (AKA Theissen polygons). This is the set of polygons such that any point within a polygon is nearest to its seed point. You will find that the polygons tessellate, which might be a problem if your offices have a maximum distance of responsibility. If that is the ...


9

If you are just looking to connect orgin/destination points and not needing the curved "great circle" lines, take a look at the QGIS plugin called "mmqgis". It has a Hub Lines tool that I think will create the visual that you are looking for. "The hub lines tool creates hub and spoke diagrams with lines drawn from points on the "Spoke Point" layer to ...


8

Try ET Geowizards Generate (Import from Text) and use a Box type. If new to this free (some tools only) ArcGIS addon, go to http://www.ian-ko.com. For this you need to do a some simple formatting of your excel to be id,xmin,ymin,xmax,ymax - formatting is explained in the tool help.


8

You can use the arc.js plugin for leaflet to draw curved lines.


7

We came up with this technique at work that uses geoprocessing tools to do the job: First off, make sure your line segs have unique IDs. Buffer "FLAT" in each direction of the line, add a new field of the same name to each and give them a direction ("L","R"). Merge the buffers together. Buffer the original line again, this time "FULL". Convert the FULL ...


7

To get point in order and link to orginal geometry use SELECT (ST_DumpPoints(the_geom)).path as path, id, (ST_DumpPoints(the_geom)).geom FROM linestrings) and remove dublicates from http://wiki.postgresql.org/wiki/Deleting_duplicates remember that you need to have one unique id for dublicate removing, if you dont have one you need to create it


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.


7

If you are not forced to use QGIS, another Open Source GIS software OpenJUMP http://openjump.org/ has a Planer Graph tool that may be exactly what you need. Here you can find the tool. If you need only the edges you can uncheck all extra options. The result contains the common edges only once. With real data the result may not be perfect because adjacent ...


7

Use the ogr2ogr utility with the ST_REVERSE function in a SQL statement and OGR SQLite dialect: For example: ogr2ogr -dialect SQLITE -sql "select st_reverse(GEOMETRY), * from input" output.shp input.shp Note: You need to pass in the st_reverse(GEOMETRY) first as the GEOMETRY field is automatically selected if the * wildcard is used and ogr will write only ...


6

There is this QGIS plugin which says it does exactly what you want. https://plugins.qgis.org/plugins/joinmultiplelines/ https://github.com/dgoedkoop/joinmultiplelines (However, I was not able to use it correctly in QGIS 2.6)


6

Following Nathan's answer, you can create a python action in the layer where you want to swap lines: layer = QgsMapLayerRegistry.instance().mapLayer("_your_layer_id_") r = QgsFeatureRequest([% $id %]) f = QgsFeature() if layer.getFeatures(r).nextFeature(f): geom = f.geometry().asPolyline() geom.reverse() geom = QgsGeometry.fromPolyline(geom) if ...


6

This plugin reverses the line direction too: https://hub.qgis.org/projects/swapvectordirection You have to select a feature, and turn the layer into edit mode before clicking on the plugin icon.


6

If you want to reverse selected crossection lines in QGIS3.X, I recommend the plugin--digitizingtools. Of course it works well in qgis3.x. And at its tool bar, you can see flip line tool. Enjoy youself!


6

If you snap the point to the line then you can split the line and then extract the parts from the resulting collection. Use a really small tolerance, I don't know how small it needs to be... > site_snap = st_snap(site, reach, tol=1e-9) > parts = st_collection_extract(st_split(reach$geometry, site_snap$geometry),"LINESTRING") parts is now two features,...


5

For this to work, you will need a working PostGIS installation. Shapefiles can be loaded into PostGIS using the QGIS PostGIS Manager tool. SQL queries can be executed in multiple tools from within QGIS (if it has connection to a PostGIS database), eg. RT SQL Layer plugin. If you have only one destination point but multiple source points (table "source", ...


5

Here is an illustration of the workflow I mentioned in the comment above, and although I don't know of any simple pre-canned routine to do this, I have attached an excel spreadsheet that one can import a set of origin-destination coordinates and the sheet then makes a set or circular line coordinates (spreadsheet here). It has formulas set up so it is pretty ...


5

Depending on how far you got in the process, you may want to skip to step six. I have however provided full steps for creating a layer below. The basic process you would want to follow for creating a layer in QGIS is: From the Layer Menu, choose New Shapefile Layer... Specify the type. In your case, for a road you likely will want to specify the type as ...


5

As far as the first question is concerned, there is a PostGIS function just for that, ST_DumpPoints. The first example in the docs page is exactly what you need. It's a set-returning function, so it doesn't just dump the points, but also some info (the path array) that relates them to the original geometry. Since you only care about the points, you could ...


5

You could make myLine into a factory function: def myLine(): return ogr.Geometry(type=ogr.wkbLineString) and then for each line you need to create: line = myLine() line.AddPoint_2D(0,0) line.AddPoint_2D(0,10) feature.SetGeometryDirectly(line) However this would be a minor gain. You could become more expressive and concise in this way: def myLine(...


5

Considering IE8 support requirement, we don't have many options on the table. I can only recall one SVG lib that has VML fallback — Raphaël.js So you can try this Raphaël layer plugin implementation for Leaflet. https://github.com/dynmeth/RaphaelLayer I didn't try plugin myself, but successfully used Raphaël. Hope you can find a use of it. Here is the ...


5

One option is to create a fishnet grid specific to your area of interest. By specifying one row and X columns, you can very efficiently create a series of lines. I describe this method in greater detail here and here for two similar situations. For fine control of individual line placement, use the editor. From the image, you can see I created 16 lines ...


5

For anyone coming to this with newer versions of QGIS, the function to do it is now called "Collect Geometries" rather than "Single parts to Multipart" so it's now Vector > Geometry Tools > Collect Geometries. You can then choose a field (or fields) to use as your grouping variable (Unique ID Fields). I used it to fix up some statistical areas which included ...


5

you can use this simple steps as arcpy script, or as Model: use the tool Feature vertices to points with BOTH_ENDS option. Buffer the resulted points with 10m. Erase the lines using the buffer result. in the case of Arcview i have found this erase script , or this question about using erase in arcview


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