Re: [postgis-users] ST_Force3D and null/unknown altitude

2016-03-19 Thread Sandro Santilli
On Thu, Mar 17, 2016 at 08:35:54AM +0100, Denis Rouzaud wrote: > My preferred approach would be that Postgis handle null altitudes natively. > > If not possible, I think a native Postgis function ST_Force3D(geom, > null_value) would help. > > Anyway, doing it myself is not a big deal, but I

Re: [postgis-users] Slow performance when selecting a geometry column

2016-03-19 Thread Paul Ramsey
Aah! PgAdminIII. Watch your CPU meter and see how busy PgAdmin is vs PostgreSQL. See how long this runs in: SELECT ST_Area(geom) FROM mytable; Still has to rip every geometry off disk, and has to do a *calculation* on it, before returning the result to the client. P On Fri, Mar 18, 2016 at

Re: [postgis-users] Slow performance when selecting a geometry column

2016-03-19 Thread Paul Ramsey
SELECT Sum(ST_NPoints(geom)) FROM thetable; On Thu, Mar 17, 2016 at 5:57 PM, David Robison wrote: > I am having an issue with a postgis database with the time it takes to > query the geometry column. The query selects 8000 records. The time to > retrieve the records

Re: [postgis-users] Slow performance when selecting a geometry column

2016-03-19 Thread David Robison
Actually the timing test was done on the same machine using PGAdmin-III. What is interesting is that if I return the geometry using something like ST_Simplify(the_geom, 0.1, false) then it returns in just a few hundred milliseconds. David From: postgis-users

Re: [postgis-users] split line at polygon edge

2016-03-19 Thread François Hugues
Hi, Empty geometries are returned when there is no intersection and I think we forgot something obvious. When you want to intersect geometries you need to add WHERE ST_Intersects (a.geom,b.geom). Things should work better and faster. HugThanks Remi-C and Hugues for your suggestions, they

[postgis-users] split line at polygon edge

2016-03-19 Thread Garret W
Hi Ive been looking for a way to take several hundred lines and split them where they intersect a polygon while also giving them the ID of the polygon they fall in. Ive seen many posts on splitting polygons. But its been difficult for me to adapt those examples. Ive been able to get an output

Re: [postgis-users] Slow performance when selecting a geometry column

2016-03-19 Thread Nordgren, Bryce L -FS
What kind of network separates client and server? Conservatively assuming that each point is only two 64-bit binary floats, your 56 points equals 9MB of additional payload. If you did something like “ST_AsText(geom)”, the additional payload is much, MUCH larger. I’d also be interested to

Re: [postgis-users] split line at polygon edge

2016-03-19 Thread François Hugues
Hello, Dis you take a look at the query result ? I think you should first try to see what is the type of geometry returned using ST_GeometryType(). You may have some geometrycollections and I’m not sure QGis can handle it. In this case you could extract lines using ST_CollectionExtract().

Re: [postgis-users] split line at polygon edge

2016-03-19 Thread Garret W
Thanks Remi-C and Hugues for your suggestions, they got me what I needed! I first tried Remi-C's example, since I was curious about how it would turn out. It gave me an error mentioning that it could not convert GeometryCollection to LineString. This error brought me back to what Hugues

Re: [postgis-users] split line at polygon edge

2016-03-19 Thread Rémi Cura
Hey, two things : recent version of QGIS are boringly strict about geometry type, so if you want to be able to add the corresponding postgis layer to qgis, you may have to explicitely cast the result. QGIS also require a unique identifier per row, which you can fabricate with row_number() for