Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options not deleted user 960

PostgreSQL is an open source object-relational database system.

2 votes

Geometry issues when creating table from existing spatial table

What makes you say your geometries not is populated as expected? What do you get from: SELECT ST_AsText(geom) FROM table_part1; If you are using 1.5 and the problem is that the geometry column not is …
Nicklas Avén's user avatar
2 votes

PostGIS- GROUP BY for continuous data values?

Hallo What I use to do in those cases is creating a table with the classes and joining against them or use a subquery to create a list of classes. I think that gives a more intuitive approach and I …
Nicklas Avén's user avatar
6 votes
Accepted

Find the farthest point

If it would have been a few million points to check distance between you could consider using knn-distance with PostgreSQL 9.1 and PostGIS 2.0. But I think you should do fine with something like? …
Nicklas Avén's user avatar
0 votes

Cut linestings at nearest point junctions

I guess you haven't installed PostGIS in the database. Run Create extension PostGIS; before creating the function
Nicklas Avén's user avatar
1 vote

Estimating direction of travel of road line segment based on long/lat in PostGIS?

You are looking for ST_Azimuth http://postgis.net/docs/manual-2.4/ST_Azimuth.html
Nicklas Avén's user avatar
4 votes
Accepted

Do large vertex counts cause performance issues?

Yes, the geometry type is a varying length data type even if it is just a point. If you will get a performance issue depends on how fast you need things to happen and what you want to do. A few tho …
Nicklas Avén's user avatar
1 vote

postGIS: what is more efficient: single or two-point search

You mention PostGIS. If you want to use PostGIS, with the spatial functions and spatial index that comes with PostGIS you will have to use the PostGIS geometry or geographic data type. If you stor l …
Nicklas Avén's user avatar
2 votes

PostgreSQL PostGIS ST_Point_Inside_Circle() radius in meters

Without reading all the details I think: You should use ST_DWithin instead You should cast to geography type, or just use the geography type instead of geoemtry type which makes ST_DWithin work with …
Nicklas Avén's user avatar
11 votes

How to sum values of points inside polygons?

Edit: field names corresponding to the questions field name SELECT polygons.id , polygons.name , coalesce(sum(points.value),0) AS sum FROM polygons LEFT JOIN points ON ST_Intersects(polygo …
Nicklas Avén's user avatar
1 vote

Finding vertex in comon with most polygons in PostGIS?

WITH points as ( SELECT DISTINCT on (p,id) (ST_DumpPoints(geom)).geom p from the_table ) SELECT count(*) number_of, p FROM points GROUP BY p ORDER BY number_of DESC limit 100; Some notes: The disti …
Nicklas Avén's user avatar
5 votes
Accepted

PostGIS ST_Contains Function Error

Edited Take a look at the doc: http://postgis.net/docs/manual-2.1/ST_Contains.html Sorry, I misread your question first. Interesting that it didn't work with your first syntax but with _st_contain …
Nicklas Avén's user avatar
3 votes
Accepted

how to Find n nearest lines for the given points from a collection of lines?

I think your solution is quite elegant. I guess what you want to do that you don't succeed in doing is getting help from indexes distance ordering. From the query it looks like you are aware that t …
Nicklas Avén's user avatar
4 votes

PostgreSQL : question about SELECT .. WHERE .. = max()

What do you mean by line = length? I guess what you mean is that your subquery will find the id of the shortest line. Then you ask in the outer query for a line with that id and some number less than …
Nicklas Avén's user avatar
8 votes

PostgreSQL : total length of roads in polygon

SELECT wbn_uidn, sum(ST_Length(ST_Intersection(wgo_geom,wbn_geom))) FROM wbn, wgo WHERE ST_Intersects(wgo_geom,wbn_geom) GROUP BY wbn_uidn;
Nicklas Avén's user avatar
3 votes

PostgreSQL : finding all lines intersecting with a polygon

Leave the looping for the database. This is SQL. SELECT polygons.id, lines.id FROM polygons, lines WHERE ST_Intersects(lines.geom,polygons.geom); Put spatial indexes on the geometry columns.
Nicklas Avén's user avatar

15 30 50 per page