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 ...
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
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 ...
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 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 ...
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....
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
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)),
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;
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
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, ...
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 ...
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.
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 ...
Yup, it looks like that is the behaviour from JTS and GEOS. The problem is that your LINESTRING is invalid. If you have PostGIS 2.0, you can use ST_MakeValid(geometry) to fix the LINESTRING to a POINT.
This query verifies your bug, and uses ST_MakeValid as a workaround.
WITH data AS (SELECT 'POLYGON((150 280, 99 215, 190 210, 150 280))'::geometry AS poly,
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
No, probably not. I'm going to assume from the coordinates of your point that you are working in longitude/latitude coordinates, but that you want to express your distances in meters. Rather than building a real "circle", recognize that for the purpose of a true/false test you can express the query as a distance calculation.
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)))
I created a small, naive script which converts input LineStrings to CompoundCurves based on some heuristics.
What it does:
Cuts down sharp corners to create a visually more appealing results than the original data.
Uses plpgsql. No additional extensions required.
Accepts an optional "smoothing factor" between 0 and 100 besides a geometry.
What it doesn't ...
Skip the trig,
create view mypoints as
st_x(st_endpoint(geom)) + (st_x(st_endpoint(geom))-st_x(st_startpoint(geom)))/2,
st_y(st_endpoint(geom)) + (st_y(st_endpoint(geom))-st_y(st_startpoint(geom)))/2
) as geom
select geom from mypoints where id = 1;
should work fine, for all values of id