Short answer: you can get it using a custom SVG. See bottom of this post for one.
I believe it is better to represent it than to modify the line geometry. Should you want to move an edge or do other actions on the geometry, it would be a nightmare to manage if the wiggles are part of the geometry instead of just a representation of a straight ...
You are going about it the right way, using ST_PointN and generate_series. One way of doing this, using dummy data (substitute your own in initial CTE) would be:
sample(geom, id) AS
ARRAY[ST_MakePoint(0, 0), ST_MakePoint(10,10),
ST_MakePoint(50, 50), ...
I propose a solution using PyQGIS. It should work both for Linestring and MultiLineString layers.
This solution is based on the creation of semicircular rings, so you need to set a value for the diameter (i.e. the step variable in the code below). The step you choose won't be the real step used because it is adjusted on the basis of the line length (but it ...
I think I found an interim solution, which I'm posting in case it's useful for anyone:
import pandas as pd
import numpy as np
from geopandas import GeoDataFrame
from shapely.geometry import Point, LineString
# Zip the coordinates into a point object and convert to a GeoDataFrame
geometry = [Point(xy) for xy in zip(df.lon, df.lat)]
df = GeoDataFrame(df, ...
You may not have to get too sophisticated--ArcGIS 10 has a tool to do just what you describe called Bearing Distance to Line (Data Management). You can even input a point shapefile as long as it has the attributes you need (i.e. X field, Y field, Distance Field, and Bearing). Of course you can add this tool to an arcpy script using:
You could accomplish this a few different ways depending on what sort of output you are wanting, but the concept is the same. It's generally easier to do a simple rotation followed by a translation rather than trying to calculate the coordinates in a single step.
In this case, the basic steps are:
Create a line of the desired length at the origin (0,0). ...
Here are a few new tricks, using:
EXCEPT to remove geometries from either table that are the same, so we can focus only on geometries that are unique to each table (A_only and B_only).
ST_Snap to get exact noding for overlay operators.
Use the ST_SymDifference overlay operator to find the symmetric difference between the two geometry sets to show the ...
If the LineString is simply to be subdivided at a position closest to the given Point, you could do what you want with this (splits LineString at closest Point to given Point and remerges the two segements afterwards)
ST_Line_Substring(line, 0, ST_Line_Locate_Point(line, point)),
According to Romain D on it1me.com, it can be done with the Leaflet.PolylineOffset as referenced in the comments by MattPil29 above.
I have adapted it for the data in your example. I turned off your original line by changing opacity to 0 in myStyle. There is probably a more elegant way to not add it.
The other key is flipping the x,y coordinate to make L....
There are several linear referencing functions that can be used to reference subsets of LineStrings, which can be converted to a geography and get the length of the geodesic with ST_Length.
For example, get the distance along line that are near points pta and ptb:
The thing you need to do is a temporal analysis.
As you said you have two vector data(shp) of different times. you can find the change using geometry processing. In QGIS load two vectors and GoTo Vector->GeoProcessing and from there you can use Difference function which will give another shape as a result.
Hope that helps
The ST_Polygonize aggregate in PostGIS will return a geometry_dump containing all possible polygons formed by a set of lines. I'm assuming the block IDs shown in your example are not related to the IDs of input linework. If this is the case, you can get your polygons and IDs with:
SELECT (st_dump).path as poly_id, (st_dump).geom FROM
You could, of course, do this with conversion via Well Known Text:
spatialite> SELECT AsText(GeomFromText("LINESTRING(1 2, 3 4, 1 3)"));
AsText(GeomFromText("LINESTRING(1 2, 3 4, 1 3)"))
LINESTRING(1 2, 3 4, 1 3)
However it is definitely possible to use MakeLine() with more than two points.
Apart from the obvious version that you know about already, ...
In QGIS 3.10 it's possible to dynamically create zig-zag lines and wavelines with the help of the indispensable "geometry generator" and a custom Python expression function.
from qgis.core import qgsfunction,QgsExpressionContextUtils,QgsExpression,QgsProject,QgsPoint,QgsGeometry
@qgsfunction(args='auto', group='Custom', usesGeometry=False, referencedColumns=...
Some of many (somewhat hacky) solutions using the field calculator:
select to add a field with type BOOLEAN
use one of the expressions (returning true when line is curved)
area( convex_hull( $geometry ) ) > 0 AND area( convex_hull( $geometry ) ) IS NOT NULL
or, probably better performing
length( $geometry ) > distance( start_point( $geometry ), ...
SELECT name,ref,type,ST_Distance(ST_Buffer(r.geom,20),ST_SetSRID(ST_MakePoint(lon, lat),4326))
FROM roads r
ORDER BY 4 ASC
For point in lon/lat coordinates:
SELECT name,ST_Distance(r.geom,ST_SetSRID(ST_MakePoint(lon, lat),4326)) FROM roads r ORDER BY 2 ASC LIMIT 1;
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
Consider some test data similar top the thick line in the question's figure:
SELECT 'LINESTRING (114 374, 200 380, 250 350, 259 343, 350 280, 380 180, 383 169, 360 80)'::geometry AS geom
INTO TEMP data;
the straight line (dashed) can be constructed from the start and end points:
SELECT ST_AsText(ST_MakeLine(ST_StartPoint(geom), ST_EndPoint(geom)))
aha! i found the solution:
to fetch the portion of the line and then can use the following to split it correctly:
ST_Line_Substring (geom_way,0,ST_Line_Locate_Point(geom_way,closest_point)) as first_half
ST_Line_Substring (geom_way,ST_Line_Locate_Point(geom_way,closest_point),1) as other_half
Here's an approach that uses a temporary table to incrementally aggregate clusters together. I don't really care for the temporary table approach, but this seems to perform quite well as the number of lines increases (I have 1.2 M lines in my input).
The ST_Envelope() function operates on single geometries, therefore you are right, you need aggregate your MULTILINESTRINGs before you pass them by St_Envelope(). St_Collect() is a good aggregation function for that job.
FROM line_table as foo
If you want to retrieve the bounding box for each ...
The length attribute of a LineString will return a value in the units of the coordinate system of the geometry. The coordinate system in your case is not specified, so there is not much meaning to the length.
Your input of 360 is in degrees, so you assume an unprojected coordinate system, such as WGS84. This is why you get a length in degrees, even without ...
In my case I have each geometry in disctint tables. What I did was :
For lines -> ST_LineInterpolatePoint() with 0.5 factor.
For polygons -> Test if ST_Centroid() is inside its geometry. If so, ST_Centroid() is the best choice, if not I choose PointOnSurface().
Here's the query :
CASE WHEN (SELECT the_geom FROM points WHERE gid = d.gid) IS NOT ...
You will need:
1) A table with LineString geometries:
CREATE TABLE lin (
id serial PRIMARY KEY,
geom geometry(LineString, 31370)
CREATE INDEX ON lin (id);
CREATE INDEX ON lin USING gist (geom);
2) A table with Point geometries where you want to split your overlapping lines. They can represent train/metro stations, intersections, bifurcations etc.