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)
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
# Create a new memory layer to store the points.
vl = QgsVectorLayer("Point", "distance nodes", "memory")
pr = vl.dataProvider()
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.
I assume you are wanting to join two line segments into one line.
This is how I did it ...
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 ...
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:
# calculate distance between points
g = pyproj.Geod(ellps='WGS84')
(az12, az21, dist) = g.inv(startlong, startlat, endlong, endlat)
# calculate line string ...
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 ...
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 ...
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.
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 ...
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
remember that you need to have one unique id for dublicate removing, if you dont have one you need to create it
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.
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 ...
Use the ogr2ogr utility with the ST_REVERSE function in a SQL statement and OGR SQLite dialect:
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 ...
There is this QGIS plugin which says it does exactly what you want.
(However, I was not able to use it correctly in QGIS 2.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()
geom = f.geometry().asPolyline()
geom = QgsGeometry.fromPolyline(geom)
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!
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,...
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", ...
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 ...
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 ...
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 ...
You could make myLine into a factory function:
and then for each line you need to create:
line = myLine()
However this would be a minor gain. You could become more expressive and concise in this way:
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.
I didn't try plugin myself, but successfully used Raphaël. Hope you can find a use of it.
Here is the ...
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 ...
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 ...
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