20

Short answer: you can get it using a custom SVG. See bottom of this post for one. Long answer: 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 ...


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


18

So, by example. Here's a simple table with two connected groups of edges: drop table lines; create table lines ( id integer primary key, geom geometry(linestring) ); insert into lines (id, geom) values ( 1, 'LINESTRING(0 0, 0 1)'); insert into lines (id, geom) values ( 2, 'LINESTRING(0 1, 1 1)'); insert into lines (id, geom) values ( 3, 'LINESTRING(1 1, 1 2)...


18

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 ...


16

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: WITH sample(geom, id) AS (VALUES (ST_MakePoint(0,0), 1), (ST_MakeLine( ARRAY[ST_MakePoint(0, 0), ST_MakePoint(10,10), ST_MakePoint(50, 50), ...


15

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, ...


14

Plugin mmqgis for QGIS. http://michaelminn.com/linux/mmqgis/ (http://plugins.qgis.org/plugins/tags/mmqgis/)- Delete Duplicate Geometries


12

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: arcpy....


11

select (ST_Azimuth(h.vec) - ST_Azimuth(h.seg)) from ( select ST_MakeLine(cp.p, point.geom) vec, ST_MakeLine(cp.p, ST_LineInterpolatePoint( line.geom, ST_LineLocatePoint(line.geom, cp.p) * 1.01) ) seg from ( select ST_ClosestPoint(line.geom, point....


10

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). ...


10

Here's a query that should get you what you want: SELECT a.name, b.name, ST_LENGTH(ST_Intersection(a.geom, b.geom)) FROM polygons a, lines b WHERE ST_Intersects(a.geom, b.geom);


10

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 ...


9

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....


9

From the doc: ST_PointOnSurface — Returns a POINT guaranteed to lie on the surface.


8

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


8

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) SELECT ST_AsText( ST_LineMerge( ST_Union( ST_Line_Substring(line, 0, ST_Line_Locate_Point(line, point)), ...


8

Since you have successfully imported data, use the tool presented in the figure. QGIS 3.4


8

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 ), ...


7

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 LIMIT 1; 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;


7

aha! i found the solution: use: ST_Line_Locate_Point(geom_way,closest_point) 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


7

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, ...


7

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. SELECT ST_Envelope(st_Collects(foo.geom)) FROM line_table as foo WHERE foo.type='a'; If you want to retrieve the bounding box for each ...


7

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. (...


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 ...


6

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, ...


6

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


6

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. SELECT routes.* FROM routes ...


6

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))) FROM ...


6

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 ...


6

Skip the trig, create view mypoints as select id, st_makepoint( 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 from mytable; then select geom from mypoints where id = 1; should work fine, for all values of id


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