# Tagged Questions

A sequence of point coordinates referring to the line segments connecting them, as used to represent a one-dimensional feature or object.

589 views

### OpenLayers: How to get *real* centroid of a Line Geometry/Feature?

I have declared a line geometry as: var lineString = new OpenLayers.Geometry.LineString([source,target]); then I am trying to get the centroid of this lineString as lineString.getCentroid(). But ...
293 views

### OpenLayers - Add points at vertices of line while drawing line

I would like to create points while I draw a line on my map in OpenLayers. That is, at each vertices of a line and at the end points there is a shape like a square, circle, or diamond. I have this ...
508 views

### Find the closest line vertex from the linestring using PostGIS

How to find the closest line vertex from a linestring? ST_ClosestPoint will give a point which is not from the linestring.
115 views

### ValueError when instantiating LineString from a mix of tuples and Point objects

I'm new to Shapely, and tried instantiating a LineString object from a mix of tuples and Point objects like this: >>> LineString([Point(1,2),(2,3),Point(3,4),(5,5)]) I get the following ...
415 views

### Distance Between Two Points vs Length of Linestring

So I have two points that I want to calculate the distance between. If I use: SELECT ST_Distance_Spheroid(point_a, point_b, 'SPHEROID["GRS 1980",6378137,298.257222101]') / 1000 FROM ( ...
676 views

### Merge multiple linestring features into a single multilinestring

Using QGis or ogr2ogr how do I convert a vector file containing multiple linestrings features into a single multilinestring feature? At the moment I've been doing this manually by converting the data ...
349 views

### Calculate distance between point and linestring and how to represent that on QGIS?

I have loaded my data with osm2pgrouting and I have my network with ways (Linestring) and nodes (Point). The problem is : I have a database of doctors addresses (point) and I should calculate the ...
628 views

### How to extend a straight line in postgis?

I have a postgis table of simple linestrings, each one is a straight line with just two points. I want to select every linestring, but extended from both sides by 1 meter. So i have lines, that are ...
32 views

### Geometry conversion problem.Data loss

I was trying to convert a roadnetwork table.Its geometry contains both MULTILINESTRING and LINESTRING.I converted all the MULTILINE string to Linestring using the query update all_india_merge set ...
300 views

### PostGIS: How to distinguish overlapping routes (i.e., LineStrings) based on their direction?

I have a set of routes which are represented by LineStrings in my PostGIS database. These routes represent journeys that people make. I want to come up with routes that (a) overlap, and (b) have the ...
253 views

### OSM linestring shown as point

I have loaded the following file http://openstreetmapdata.com/data/coastlines to postgreSQL. In visual studio with gdal/ogr and geos enabled: SELECT geom FROM waterpoly WHERE geom IS NOT NULL LIMIT ...
1k views

### How to group connected linestrings in PostGIS?

I have a table of streets I've selected based on a set of attributes (let's say it's speed_limit < 25). There are groups of streets that are locally contiguous; I'd like to group these sets of ...
286 views

### How to transform a set of street-segments into city-blocks, with PostGIS2?

Theoretically is possible to obtain the polygons of city blocks (urban blocks) from streets, when streets are represented by street axis (LineStrings). The urban blocks are bounded by streets, so ...
401 views

### How to cluster similar lines in PostGIS?

In PostGIS I have a large database of linestrings which I have obtained using ST_makeline function. I would like to cluster similar lines based on where the lines start and end. Here is an example ...
767 views

### Calculating “travelled distance” of a GPS track without including “stops”

I have a set of GPS tracks from a cycling event and I want to correlate their distance along the route. Problem is: when a rider stops, generally by entering a covered place, GPS keeps logging (low ...
451 views

### How to speed up a query for nearest linestring to point data

I have processed a Strahler stream order layer with a lot of river linestrings (type: Multilinestring) and their corresponding strahler number (see information here). Besides I have a point layer. I ...
399 views

### Switch coordinates in linestring

I made a silly mistake: when creating linestrings in my PostGis database i inverted the lon and lat values. Which isn't a problem for postgis itself, but for my visualization and intersections. ;) Of ...
45 views

### violates check constraint

I try to add a constraint based on geometry type to a "street" table that prevents anything except Linestring geometry or Null. alter table streets add constraint streets_geom_linestring_chk check(...
125 views

### Why are some OSM GPX line string endpoints connected?

I am working with GPX files from OpenStreetMap to render the public transportation lines of Berlin. I converted them to GeoJSON using the togeojson script. For some reason some of the lines are ...
629 views

### How to use makeline() function for more than 2 points in spatialite?

Is it possible to use makeline() function to make linestring geometries in spatialite for connecting more than 2 sequence points? Suppose I have four sequence points P1, P2, P3, P4. Or are there any ...
111 views

### Can I use Point as the geom type in pgrouting?

in my table i have the field geom(POINT, srid) and its populated, this table also have the source an target field witch is blank(just like pgrouting guide). I tried the function pgr_createTopology() ...
305 views

### Select linestrings containing points with duplicating M coordinates in postgis

I have a table of LineStringM geometries. Some of lines have points with same measure (M coordinate). This is a bug in initial data, that I want to clean somehow. So I need to: 1. Select all records, ...
98 views

### Simplify table of linestrings

I have a PostGIS table of linestrings representing a road network. I want to simplify the geometries such that only lines that connect road junctions are stored. At the moment the table has a large ...
1k views

### How to perform SIA or Bezier line smoothing in PostGIS?

Can anyone provide an example SQL for smoothing linestrings from postgis table using Bezier curves or Iterative Averaging (SIA) algorithm?
79 views

### Line style width property not being applied in QGIS 2.0.1

I change the line width of my style and click apply, but the property does not seem to be applying to my line data.
143 views

### Separating distinct lines in PostGIS

I have a table of linestring segments in Postgis. These segments make up distinct non-intersecting lines as shown by the diagram. To add confusion the direction of the linestrings are not uniform. I ...
348 views

### Linked point geometries to linestrings in Spatialite

I have been parsing Canada's radio system frequency open data. It's a single large table per province, containing point geometries for each station callsign. Where a point-to-point link is defined, ...
1k views

### PostGIS: Calculate the length of just the portion of linestring that intersect with a polygon

I want to calculate the portion of the linestring that lies within the limits of a polygon. Better with an image What is the length of the portion of linestring within Province A? and within ...
472 views

### Defining a WHERE clause from a subquery for a query to create a handy view

It is about my implementation from an answer of this question. It is more an postgresql issue than a GIS issue, whereas it is about geometries and spatial queries. I want to create a view from the ...
101 views

### PostGIS | Get degrees clockwise from north of a linestring's beginning and end

I have a table full of linestrings in PostGIS. I would like to know the degrees clockwise from north of the starting point of the linestring and also of the end point. I was thinking that maybe ...
768 views

### How to calculate the azimuth of a line of a multilinestring in PostGIS?

I have two spatially enabled tables in PostgreSQL with a geometry in each: First table is with POINT type, second is with MULTILINESTRING. I need to calculate the azimuth of the LINESTRING part of a ...
722 views

### How to calculate the “depth” of a linestring using postgis

I have linestring features, which look like bent linestrings, hemicycles or convex or concave linestrings. In the moment I can select the distance between the startpoint and endpoint of each feature. ...
425 views

### PostGIS: Using a polygon to 'mask' linestrings returns both multi and linestrings

I have a table of linestrings (OSM roads, in fact) that I'm displaying on a map. I want to filter them so that only those within a certain area are displayed- I've already done this with the coastline ...
1k views

### How to create linestrings with a definite angle and length, that are fixed to a point

I want to create linestrings with a definite angle (e.g. 160°) and length (e.g. 2m) that are fixed to a number of points of another linestring. So, I want to use the ST_DumpPoints function to find the ...
900 views

### Extract a LineString from LineString by two Points

I am using PostGIS2.0 and PostgreSQL9.3. I have LineString in Spatial-Ref 4326 like geom:= ST_GEOMETRYFROMTEXT('LINESTRING(60.7014631515719 56.8441322356241,60.7023117507097 56.8445673405349,60....
375 views

### Mapserver - label at beginning of line string (WMS)

I am creating a WMS service made up of linestrings pulled from a POSTGIS database I want to label the start of each line with a sequence number. At present I can label the centre of each with:- ...
884 views

### How to create a efficent linestring out of geography points using postgis

I'm trying to create a linestring out of geography points. At the moment I'm doing it like this: select ST_GeographyFromText(ST_Makeline(a.record_point)) from ( select (record_point::geometry) from ...
1k views

### How to create a MultiLineString feature with a postgis layer in QGIS

I have troubles handling with MultiLineStrings in QGIS. I added the table where I defined a column as geometry(MultiLineString, 31468) as a postgis layer in QGIS. Now I want to create features with ...
227 views

### Frequency of partially or fully overlapping lines

Let L be a set of line-segments (lines) in a two-dimensional (2D) Euclidean space that are randomly (say, using uniform random function) distributed, that is, some may overlap other(s). Overlapping ...
2k views

### How to find the intersection point of polygon geometry and multilinestring geometry in postgis

I have a polygon geometry and multilinestring geometry. How do i find the intersection of both these geometries. Both the geometries are in same reference system. Does st_intersection gives me the ...
1k views

### From a trajectory of GPS points to a multiline segment

Given a trajectory as a sequence of GPS points I would like to create a smooth linestring representing a path where a car drove. The data is stored in postgresql: the input trajectory in a table, ...
1k views

### how to split a line by a point which is on the line but not in the linestring itself?

i need some help with the following: i have a linestring - geom i have \$lat,\$lon (using some php syntax) i have an osm table with the roads geom, i am trying to get closest point, and then split ...
773 views

### ArcGIS Kernel Density with polyline, search radius / bandwidth calculation

I'm conducting a density analysis of a series of polylines and I'm hung up on determining an appropriate search radius. The default calculation performed by arcgis is to take the shorter dimension ...
615 views

### Find polygon that contains all linestring records in PostGIS table

I'm still pretty new to this stuff, so bear with me. In PostGIS how could I find a polygon that would contain all the linestring records in a given table?
183 views

### Diferent Line color and Diferent Markers at the same time

i'm about to develop a GIS Track App, but until now, i'm testing with some codes, that i've been creating, but for my project we are going to use XML as data records, today, i am able to create a ...
628 views

### How to split a linestring every 1000 points in postgis

To assume compatibility with my survey software, I would like to lighten geometries of my linestrings by cutting them every 1000 points without creating or interpolating points. I transformed a ...
619 views

### How to Blink a line on a map similarly like a point blinking on map through lat lon points

how to blink a line on a map which is formed by lat lon points through linestring from database the points(lat,lon) comes which is stored in form of MultiLineString. similarly like how a point ...
287 views

### Openlayers Linestring over edge of map

im trying to create a route displayer for ships. But im struggling with the edges of the map. When going from ie. 179* to 2* it displays a line across the entire map, instead of displaying it on the ...