Re: [postgis-users] How to cast a 16BUI to a 32BF raster?

2013-10-23 Thread Pierre Racine
If you are willing to do it you could write a ST_ChangePixelType(raster, newpixeltype) sql function that would automatically define the reclassexpr parameter to ST_Reclass... We could then add it to the API. Pierre -Original Message- From: postgis-users-boun...@lists.osgeo.org

Re: [postgis-users] [Raster] MNT 250 IGNF data import problem

2013-10-22 Thread Pierre Racine
You loaded specifying -b 1 so it's not surprising it complains when you try to display stats about band 2 and 3... You have only one band in the db... -Original Message- From: postgis-users-boun...@lists.osgeo.org [mailto:postgis-users- boun...@lists.osgeo.org] On Behalf Of Yves

Re: [postgis-users] [Raster] MNT 250 IGNF data import problem

2013-10-22 Thread Pierre Racine
Because I did a quick test and copied past previous SQL requests and I did not clean it before! Of course you can remove the next 2 bands which don't exist but the first one should have correct statistic. Thanks Pierre to let me know the logical ;) Sorry I thought you were complaining

Re: [postgis-users] PostGIS Raster Area from a Clip

2013-10-21 Thread Pierre Racine
Marcello, You have two choices: a) load the rasters as rasters and vectorizing INSIDE the database at the same time of doing the intersection or b) load the rasters as rasters, clip the raster tiles with the 'fazendas' and computing the number of with-value pixels in the clipped rasters

Re: [postgis-users] PostGIS Raster Area from a Clip

2013-10-21 Thread Pierre Racine
fazendas f, capacidade_rast c WHERE ST_Intersects(ST_Buffer(f.geom, 0.01), c.rast) AND f.gid = 6 ) AS tmp WHERE ST_Intersects(f.geom, tmp.geom) GROUP BY tmp.pixel_value ORDER BY tmp.pixel_value; Regards 2013/10/21 Pierre

Re: [postgis-users] Adding bands to a PostGIS raster

2013-10-17 Thread Pierre Racine
break up this template raster into tiles for performance gains. Does that sound reasonable? Thanks again, Sebastian On 10/16/2013 04:23 PM, Pierre Racine wrote: Sebastian, Your problem is that you did not manage the tiling properly. 1) You loaded dbe.elevation50km as 3045 tiles

Re: [postgis-users] Adding bands to a PostGIS raster

2013-10-16 Thread Pierre Racine
Sebastian, Your problem is that you did not manage the tiling properly. 1) You loaded dbe.elevation50km as 3045 tiles (with the -t raster2pgsql option) and dbe.elevation20km apparently as 198 tiles (this is odd because there should be more tiles in the lower resolution dataset. Are they

Re: [postgis-users] multipoints to raster

2013-10-10 Thread Pierre Racine
I use ST_MapAlgebraFct for this sort of things. Look at the example in: http://geospatialelucubrations.blogspot.ca/2012/07/a-slow-yet-1000x-faster-alternative-to.html that shows how to extract values from another raster coverage. You will have to modify the SQL query in the

[postgis-users] Looking for a platform for developing web geospatial applications?

2013-10-07 Thread Pierre Racine
Hi PostGIS Community, I'd like to propose you this text about the use of Semantic MediaWiki to develop web crowdsourced applications and the possibility to add more geospatial capacities to it (powered by PostGIS evidently!).

Re: [postgis-users] About 2-dimensional arrays of postgresql

2013-09-27 Thread Pierre Racine
What is this misterious calculation that can't be performed with any version of MapAlgebra? -Original Message- From: postgis-users-boun...@lists.osgeo.org [mailto:postgis-users- boun...@lists.osgeo.org] On Behalf Of Miguel-Angel Manso-Callejo (UPM) Sent: Friday, September 27, 2013

Re: [postgis-users] tile size

2013-09-19 Thread Pierre Racine
You can also have a look at this article from Duncan Golicher if you are doing raster/vector analysis: http://duncanjg.wordpress.com/2012/10/30/tile-size-for-raster-vector-overlays-in-postgis/ -Original Message- From: postgis-users-boun...@lists.osgeo.org [mailto:postgis-users-

Re: [postgis-users] ST_Split fails on a quite simple geometry

2013-08-29 Thread Pierre Racine
/28 Pierre Racine pierre.rac...@sbf.ulaval.ca Hi, This query should return the geometry splitted in two but it returns only one of the two sides. SELECT ST_Split(ST_GeomFromEWKT('POLYGON((252049.803755834 5230978.87794769

Re: [postgis-users] Optimize query

2013-08-21 Thread Pierre Racine
You should check with EXPLAIN if ST_Intersects() is using any index. I'm pretty sure it doesn't. You might want to create an intermediate table with your buffers and index it and perform the ST_Union and ST_Clip in a second query. -Original Message- From:

Re: [postgis-users] raster intersect with polygon resulting in false NULL value

2013-08-21 Thread Pierre Racine
Hailey, Could you post here the definition of ST_SummaryStatsAgg() you are using. I'm pretty sure I fixed this some time ago. I'd like to compare what you have with what I have. Pierre -Original Message- From: postgis-users-boun...@lists.osgeo.org [mailto:postgis-users-

Re: [postgis-users] [postgis-devel] PostGIS 2.1.0 released

2013-08-19 Thread Pierre Racine
Congratulation and thanks everybody for this very significant release of PostGIS and for continuously maintaining it as the number one geospatial database in the world! -Original Message- From: postgis-devel-boun...@lists.osgeo.org [mailto:postgis-devel- boun...@lists.osgeo.org] On

Re: [postgis-users] tiles from table

2013-08-14 Thread Pierre Racine
where each record is a date and an untiled raster, date is unique, one raster per date. Is there a way to SELECT INTO a new table so for each date the raster gets tiled? Look for ST_Tile() in the doc. And for a 2145 x 1377 original raster, can you recommend a size for the tiles? 33 x 27?

[postgis-users] Meaning of Unable to count the values for band at index 1

2013-07-12 Thread Pierre Racine
Hi, I do this query for counting the frequency of values in a raster: SELECT identifian, ST_ValueCount(ST_Clip(rast, geom)) As pvc FROM raster400x400_out, zones WHERE ST_Intersects(rast, geom) and I get many message like: Unable to count the values for band at index 1 What does that mean?

Re: [postgis-users] Raster - is it possible to use names for bands?

2013-05-24 Thread Pierre Racine
That one of the things I would had in PostGIS 3.0. Pierre -Original Message- From: postgis-users-boun...@lists.osgeo.org [mailto:postgis-users- boun...@lists.osgeo.org] On Behalf Of Bborie Park Sent: Friday, May 24, 2013 11:01 AM To: PostGIS Users Discussion Subject: Re:

Re: [postgis-users] Problem with gdalbuildvrt with no data collars on tiles...

2013-05-06 Thread Pierre Racine
Am I doing something wrong? Yes! You are writing to wrong list. Try the GDAL list. Pierre ___ postgis-users mailing list postgis-users@lists.osgeo.org http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users

Re: [postgis-users] Create a new raster

2013-04-25 Thread Pierre Racine
Look at ST_MapAlgebra() and ST_Reclass(). -Original Message- From: postgis-users-boun...@lists.osgeo.org [mailto:postgis-users- boun...@lists.osgeo.org] On Behalf Of Amin Tayyebi Sent: Thursday, April 25, 2013 12:26 PM To: postgis-users@lists.osgeo.org Subject: [postgis-users]

Re: [postgis-users] Best practices for PostGIS raster query and processing from web app

2013-04-09 Thread Pierre Racine
a. How would you turn this pseudocode into a PostGIS SQL query so this action is done quickly (we are not particularly skilled at SQL and new to PostGIS raster processing functions)? That is, should we use an intersection approach or a map algebra approach? What would the SQL look like?

Re: [postgis-users] Best practices for PostGIS raster query and processing from web app

2013-04-09 Thread Pierre Racine
Pixel selection is possible via three options: 1) one raster ST_MapAlgebra 2) ST_Reclass 3) ST_DumpAsPolygons (with a where clause) OK, we will test the different approaches to see what works best/fastest. When a query refers to multiple raster layers (e.g., select

Re: [postgis-users] Nearest Neighbor on Large Datasets

2013-04-08 Thread Pierre Racine
Try this: SELECT grid.pk_uid, point.pk_uid AS el_id, point.elevation FROM grid_rail_lines grid, elev_rail_combined point WHERE point.pk_uid = (SELECT point.pk_uid id2 FROM grid_rail_lines point ORDER BY point.geom - grid.geom LIMIT 1) ORDER BY grid.pk_uid From:

Re: [postgis-users] How to perform st_PixelAsPolygon(rast, geom) ?

2013-04-05 Thread Pierre Racine
You can do: SELECT ST_PixelAsPolygon(rast, ST_WorldToRasterCoordX(rast, ST_X(geom)), ST_WorldToRasterCoordY(rast, ST_Y(geom))) geom FROM yourrast, yourpoints WHERE ST_Intersects(rast, geom) Note that PixelAsPolygon has no s. You will get the vectorization of every pixels having a point inside.

Re: [postgis-users] How can I optimize a raster in postgis 2 for display?

2013-02-28 Thread Pierre Racine
...@lists.osgeo.org] On Behalf Of Pierre Racine Sent: Monday, February 25, 2013 5:51 PM To: PostGIS Users Discussion Subject: Re: [postgis-users] Postgis raster question: how to enable raster type in 2.0 rtpostgis.sql if for loading raster definition and function into the database

Re: [postgis-users] Postgis raster question: how to enable raster type in 2.0

2013-02-25 Thread Pierre Racine
Did you load rtpostgis.sql? Pierre From: postgis-users-boun...@lists.osgeo.org [mailto:postgis-users-boun...@lists.osgeo.org] On Behalf Of Ivan Santiago Sent: Monday, February 25, 2013 1:42 PM To: postgis-users@lists.osgeo.org Subject: [postgis-users] Postgis raster question: how to enable

Re: [postgis-users] Postgis raster question: how to enable raster type in 2.0

2013-02-25 Thread Pierre Racine
=http://www.ogp.gobierno.pr/ 787.725.9420 x 2378 Calle Cruz 254 PO Box 9023228 San Juan, PR 00902-3228 From: postgis-users-boun...@lists.osgeo.org [mailto:postgis-users- boun...@lists.osgeo.org] On Behalf Of Pierre Racine Sent: Monday, February 25, 2013 4:06 PM To: PostGIS Users

Re: [postgis-users] Intepolation

2013-02-20 Thread Pierre Racine
Normally you would want to interpolate a continuous raster surface from a number of points. Unfortunately we still don't have any interpolation algorithm to do that. One way would be to ST_DelaunayTriangles() your points and then to ST_Union(ST_AsRaster()) them to a raster. But we definitely

Re: [postgis-users] Sample usages of analytic functions

2013-02-11 Thread Pierre Racine
I think it would be nice to have a new simple GIS desktop application based only on PostGIS. When you open a shapefile or an image, it is imported in PostGIS. The GUI of the GIS would be just an SQL statement builder sending queries to PostGIS, producing temporary or permanent tables and

Re: [postgis-users] Raster cell size and wrong mean value calculation problem

2013-01-23 Thread Pierre Racine
The raster cells with the same elevation value got merged, why? Because intersecting with every single pixel outline would be just too long. The mean value which based on the actual result cannot be correct. You actually want to compute a weighted mean, not simply a mean. The weighted mean

Re: [postgis-users] out-db

2013-01-21 Thread Pierre Racine
With QuantumGIS (fresh install) i can view the raw image and an in - db image but the out-db image returns the following fault. Problem signature: Problem Event Name: APPCRASH Application Name: qgis.exe Application Version:0.0.0.0 Application Timestamp: 4fdce845

Re: [postgis-users] PostGIS - Simple Raster Point Query

2012-12-18 Thread Pierre Racine
not want to run 40 odd queries if I can do it with one. Since I'm new to PostGIS though, I don't know how to, hence why I'm asking. Thanks, Tim Tim-Hinnerk Heuer Twitter: @geekdenz Blog: http://www.thheuer.com http://www.thheuer.com/ On 18 December 2012 08:53, Pierre Racine

Re: [postgis-users] PostGIS - Simple Raster Point Query

2012-12-14 Thread Pierre Racine
://www.thheuer.com http://www.thheuer.com/ On 9 December 2012 20:24, Pierre Racine pierre.rac...@sbf.ulaval.ca wrote: SELECT ST_Value(rast,ST_SetSRID(ST_Point(1821416, 5649720), 2193)) FROM nzdem3 WHERE ST_Intersects(rast,ST_SetSRID

Re: [postgis-users] Import Raster with 3 bands to PostgreSQL

2012-12-10 Thread Pierre Racine
Which software? The software has to interpret himself the three bands as RGB. I don't think QGIS does that... There is nothing in PostGIS stating that a three bands raster is a TIFF or JPEG file. PostGIS store rasters, not images. Pierre -Original Message- From:

Re: [postgis-users] PostGIS - Simple Raster Point Query

2012-12-08 Thread Pierre Racine
: @geekdenz Blog: http://www.thheuer.com http://www.thheuer.com/ On 9 December 2012 00:49, Pierre Racine pierre.rac...@sbf.ulaval.ca wrote: select st_value(rast,ST_SetSRID(ST_Point(1821416, 5649720), 2193)) from nzdem3 ___ postgis-users

Re: [postgis-users] PostGIS - Simple Raster Point Query

2012-12-08 Thread Pierre Racine
I made the tile size 1200x1200 and used the -R option when doing the raster2pgsql import because the raster is a .img/.ige file which is 26GB. But this query result tells me it got the right geo transform. If your coverage is tiled, your query should look like: SELECT

Re: [postgis-users] ST_MapalgebraExpr() function

2012-11-29 Thread Pierre Racine
I suggest you try ST_Reclass... -Original Message- From: postgis-users-boun...@lists.osgeo.org [mailto:postgis-users- boun...@lists.osgeo.org] On Behalf Of Mahavir Trivedi Sent: Wednesday, November 28, 2012 11:46 PM To: PostGIS Users Discussion Subject: Re: [postgis-users]

Re: [postgis-users] Summarystats (Raster, Polygon)

2012-11-28 Thread Pierre Racine
The function is described in objective FV.20 at http://trac.osgeo.org/postgis/wiki/WKTRaster/SpecificationWorking03 There has been no effort to develop a plpgsql prototype and that would be VERY welcome. Pierre -Original Message- From: postgis-users-boun...@lists.osgeo.org

Re: [postgis-users] Contours of rasters without or with tiles

2012-11-28 Thread Pierre Racine
Mathieu, I see now what you mean. ST_Envelope gives the behaviour you described (i.e. one polygon per tile, which is 9 lines). If I try to ST_Union them, I get the exact same problem I had before with ST_Polygon: not all polygon-tiles are unioned, as can be seen with a ST_Dump: SELECT

Re: [postgis-users] st_union(rast) returning null because of non alignment,

2012-11-08 Thread Pierre Racine
for two of the polygons that are adjacent: Clarendon 698486.043582936 617384.893096908 153 229 250 250 0 0 3448 4 Manchester 683177.872077352 632613.85425893 117 182 250 250 0 0 3448 4 On Wed, Nov 7, 2012 at 6:01 PM, Pierre Racine pierre.rac...@sbf.ulaval.ca wrote

Re: [postgis-users] ST_PixelSixeX(raster) does not exist : error

2012-11-07 Thread Pierre Racine
ST_PixelSizeX(raster) was replaced by ST_ScaleX(raster) since a while. There is a function to convert a raster to polygons: ST_DumpAsPolygons()... Pierre -Original Message- From: postgis-users-boun...@lists.osgeo.org [mailto:postgis-users- boun...@lists.osgeo.org] On Behalf Of

<    1   2