Re: [postgis-users] Slow MapAlgebra performance

2020-04-16 Thread Pierre Racine
Hi Kirill, Using the callback version of ST_MapAlgebra() should be much faster but you have to write your own callback function. https://postgis.net/docs/RT_ST_MapAlgebra.html Let us know the difference. Pierre De : postgis-users De la part de ? ?? ?? Envoyé : April 6, 2020

Re: [postgis-users] Point geom, ST_Value, ST_Intersects and out of range raster coordinates

2020-01-09 Thread Pierre Racine
Solution is to filter out NULL returned when using ST_Value() or DISTINCT or GROUP BY multiple values returned when using ST_Intersect(). Using (only) one solution consistently returns consistent results. Pierre -Message d'origine- De : postgis-users De la part de Peter Devoy Envoyé 

Re: [postgis-users] raster2pgsql fail with JPEG encoded image

2019-09-30 Thread Pierre Racine
GDAL is complaining that your image is rotated and that it does not support it yet. What if you erase (or just rename) the .jgw, temporally to remove the rotation? Pierre -Message d'origine- De : postgis-users De la part de Jorge Gustavo Rocha Envoyé : 27 septembre 2019 18:18 À :

Re: [postgis-users] raster regions

2019-07-16 Thread Pierre Racine
ot;... d.geom touch (ndvi2018 < ndvi2019)" where ndvi are raster data. Att. Em 15-07-2019 14:43, Pierre Racine escreveu: Hi, That could translate into something like this in PostGIS: WITH floodareas AS ( SELECT ST_MapAlgebra(rast, ‘1BB’, ‘CASE WHEN [rast] < 10 THEN 1 ELSE

Re: [postgis-users] raster regions

2019-07-15 Thread Pierre Racine
Hi, That could translate into something like this in PostGIS: WITH floodareas AS ( SELECT ST_MapAlgebra(rast, ‘1BB’, ‘CASE WHEN [rast] < 10 THEN 1 ELSE NULL END’) rast FROM elevation ) SELECT d.* FROM districts d, floodareas f WHERE ST_Intersects(g.geom, f.rast) NULL becomes nodata values.

Re: [postgis-users] Strange behavior with empty geometries GROUP BY

2017-09-11 Thread Pierre Racine
wouldn't be asked questions How come ST_Equals says these are equal but geom::text = geom::text says they are not. Seems to me like trading one set of problems for another. Thanks, Regina From: postgis-users [mailto:postgis-users-boun...@lists.osgeo.org] On Behalf Of Pierre Racine Sent: Monday,

Re: [postgis-users] Strange behavior with empty geometries GROUP BY

2017-09-11 Thread Pierre Racine
org> Objet : Re: [postgis-users] Strange behavior with empty geometries GROUP BY BTree = operator Which is bounding box equality From: postgis-users [mailto:postgis-users-boun...@lists.osgeo.org] On Behalf Of Pierre Racine Sent: Monday, September 11, 2017 3:54 PM To: PostGIS Users Discussion &l

Re: [postgis-users] Strange behavior with empty geometries GROUP BY

2017-09-11 Thread Pierre Racine
251250 5243749.86206897) From: postgis-users [mailto:postgis-users-boun...@lists.osgeo.org] On Behalf Of Pierre Racine Sent: Monday, September 11, 2017 3:08 PM To: PostGIS Users Discussion <postgis-users@lists.osgeo.org<mailto:postgis-users@lists.osgeo.org>> Subject: Re: [postgis-users

Re: [postgis-users] Strange behavior with empty geometries GROUP BY

2017-09-11 Thread Pierre Racine
, 251000 5243597.61702128, 251000 5243681.87096774))') geom ) SELECT ST_AsText(geom) FROM polys GROUP BY geom; Pierre De : postgis-users [mailto:postgis-users-boun...@lists.osgeo.org] De la part de Pierre Racine

Re: [postgis-users] ST_Polygonize give different results on same set of linestrings

2017-09-07 Thread Pierre Racine
(geom) geom FROM polys UNION ALL SELECT 3 test, ST_Collect(geom) geom FROM polys ) SELECT test, ST_AsText(ST_Polygonize(geom)) FROM extrings GROUP BY test; De : postgis-users [mailto:postgis-users-boun...@lists.osgeo.org] De la part de Pierre Racine Envoyé : 7 septembre 2017 09:46 À : PostGIS

[postgis-users] ST_Polygonize give different results on same set of linestrings

2017-09-07 Thread Pierre Racine
Hi, Is it normal that ST_Polygonize() gives two different results depending on if the linestrings are ST_Union() before calling it or not? In the following example, test 1 (no union) and 3 (ST_Collect) give the same result, constructing two overlapping polygons. Test 2 (ST_Union) on the other

Re: [postgis-users] Strange behavior with empty geometries GROUP BY

2017-06-29 Thread Pierre Racine
GEOS="3.6.1-CAPI-1.10.1 r4317" PROJ="Rel. 4.9.1, 04 March 2015" GDAL="GDAL 2.1.3, released 2017/20/01" LIBXML="2.7.8" LIBJSON="0.12" RASTER Thanks, Regina From: postgis-users [mailto:postgis-users-boun...@lists.osgeo.org] On Behalf Of Pie

Re: [postgis-users] PostGIS ST_EuclideanDistance() not working. Wrong upperleftx and y?

2017-06-22 Thread Pierre Racine
Try setting the ST_MakeEmptyRaster() upperlefty parameter to a negative value (-1). Pierre De : postgis-users [mailto:postgis-users-boun...@lists.osgeo.org] De la part de Vitor Sapucaia Envoyé : 21 juin 2017 04:58 À : postgis-users@lists.osgeo.org Objet : [postgis-users] PostGIS

[postgis-users] Strange behavior with empty geometries GROUP BY

2017-06-20 Thread Pierre Racine
Hi, When I try to count the occurrence of a number of empty geometries like this: SELECT ST_AsText(geom) txt, count(*) FROM ( SELECT 'POINT(0 0)'::geometry geom UNION ALL SELECT 'POINT(0 0)'::geometry geom UNION ALL SELECT 'POINT(0 0)'::geometry geom UNION ALL SELECT 'POINT(0 1)'::geometry geom

Re: [postgis-users] Fwd: PostGIS Out-DB Raster Not Behaving As Expected

2017-04-18 Thread Pierre Racine
[mailto:l...@pcorp.us] Envoyé : 16 avril 2017 00:06 À : 'PostGIS Users Discussion' <postgis-users@lists.osgeo.org> Cc : Pierre Racine <pierre.rac...@sbf.ulaval.ca>; 'Bborie Park' <dustym...@gmail.com> Objet : RE: [postgis-users] Fwd: PostGIS Out-DB Raster Not Behaving A

Re: [postgis-users] Cost weighted distance raster

2017-03-16 Thread Pierre Racine
mars 2017 15:50 To: Pierre Racine <pierre.rac...@sbf.ulaval.ca> Cc: postgis-users@lists.osgeo.org Subject: Re: Cost weighted distance raster Just to follow up: I was able to execute the CREATE FUNCTION scripts with some minor tweaking. When I run ST_CostDistance it chokes on making

Re: [postgis-users] Cost weighted distance raster

2017-03-07 Thread Pierre Racine
In the code page : https://trac.osgeo.org/postgis/wiki/PostGIS_Raster_SoC_Idea_2012/Distance_Analysis_Tools/code There is a ST_CostDistance() function. Pierre From: Spencer Gardner [mailto:spencergard...@gmail.com] Sent: 7 mars 2017 12:35 To: Pierre Racine <pierre.rac...@sbf.ulaval.ca&

Re: [postgis-users] Cost weighted distance raster

2017-03-07 Thread Pierre Racine
There is no .sql. just copy the functions into a .sql text file and execute. From: Spencer Gardner [mailto:spencergard...@gmail.com] Sent: 7 mars 2017 11:16 To: Pierre Racine <pierre.rac...@sbf.ulaval.ca> Cc: postgis-users@lists.osgeo.org Subject: Re: Cost weighted distance raster On Tue,

Re: [postgis-users] Cost weighted distance raster

2017-03-07 Thread Pierre Racine
since a while, not sure the code is working properly. Did you get time to test it? If it work fine, I might take time to add it to the Addons before FOSS4G 2017. Pierre From: Spencer Gardner [mailto:spencergard...@gmail.com] Sent: 6 mars 2017 18:09 To: postgis-users@lists.osgeo.org; Pierre

Re: [postgis-users] Cost weighted distance raster

2017-03-06 Thread Pierre Racine
Hi Spencer, I don’t know if they are still compatible with the newest PostGIS version. They used to work fine but don’t expect very good performance. Pierre From: postgis-users [mailto:postgis-users-boun...@lists.osgeo.org] On Behalf Of Spencer Gardner Sent: 3 mars 2017 15:03 To:

Re: [postgis-users] Raster time-series data

2016-09-02 Thread Pierre Racine
Sounds reasonable to me. You could try splitting the process between your 4 or 8 processors, each importing a selection of files. Maybe this could help, maybe this could make the whole process even slower (depend on what is slow the CPU or the disk)... If you don't necessarily need all the

Re: [postgis-users] Merge rasters with multiple bands

2016-08-15 Thread Pierre Racine
ST_Union works on overlapping rasters as well but maybe you have to provide two 3 bands rasters. If your rasters are tiled, you also have to GROUP BY tiles having the same alignment: GROUP BY ST_UpperleftX(rast), ST_UpperleftY(rast) ST_MapAlgebra() should work also. The expression should be

Re: [postgis-users] Slow query ST_SummaryStatsAgg over tiles

2016-08-15 Thread Pierre Racine
From the ST_SummaryStatsAgg () doc: "By default will sample all pixels. To get faster response, set sample_percent to value between 0 and 1" Pierre > -Original Message- > From: postgis-users [mailto:postgis-users-boun...@lists.osgeo.org] On Behalf > Of matteo rivola > Sent: Wednesday,

Re: [postgis-users] Raster tile size impact results

2016-07-15 Thread Pierre Racine
<postgis-users@lists.osgeo.org> > Subject: Re: [postgis-users] Raster tile size impact results > > Hello, > > Unfortunatly, I don't find a way to print raster results in OpenJump. Can you > explain me how I can do it ? > > Thank you for your help ! > > Pier

Re: [postgis-users] raster question

2016-03-11 Thread Pierre Racine
Tile them! Should be much faster. > -Original Message- > From: postgis-users [mailto:postgis-users-boun...@lists.osgeo.org] On > Behalf Of Stephen Crawford > Sent: Thursday, March 10, 2016 12:05 PM > To: PostGIS Users Discussion > Subject: [postgis-users] raster question > > Hell all, >

Re: [postgis-users] Raster SQL to separate high value areas

2016-03-09 Thread Pierre Racine
Or ST_ReClass() and ST_PixelAsCentroids()? > -Original Message- > From: postgis-users [mailto:postgis-users-boun...@lists.osgeo.org] On > Behalf Of Regina Obe > Sent: Wednesday, March 09, 2016 7:04 AM > To: 'PostGIS Users Discussion' > Subject: Re: [postgis-users] Raster SQL to separate

Re: [postgis-users] Create raster from row-col table

2016-02-29 Thread Pierre Racine
Hi Etienne, > Still, I can't figure how to load an arbitrary number of bands using your > snippet. If I remove WHERE band=1 I still get a unique band. This query will work for many bands and will aggregate all of them in a single raster: WITH rows AS ( SELECT band, colx, array_agg(v ORDER BY

Re: [postgis-users] ST_Mean4ma , ST_StdDev4ma rounding down

2016-02-26 Thread Pierre Racine
The two NOTICE are because there is actually two rasters created by in the dummy_rast table and the first one has no bands. Values are rounded by ST_MapAlgebra() because, by default, ST_MapAlgebra() will try to produce a raster with the same pixel type as the input rasters. If you want the

Re: [postgis-users] Create raster from row-col table

2016-02-26 Thread Pierre Racine
Étienne, The columnx and rowy ST_SetValues() parameters are not references to each pixel values. They are the coordinates only of the first upperleft pixel to be set. Other pixels coordinates are automatically derived from the size of the passed two dimensional array (newvalueset). That means

Re: [postgis-users] loading raster colour heatmap data or converting to a shape file

2016-02-05 Thread Pierre Racine
This all depends on the kind of operations you want to do... Some might be easier keeping rasters as raster. Others are easier if you convert everything to vector. You can easily convert raster loaded in PostGIS to vector using ST_DumpAsPolygons(). The reverse operation is done through a mix

Re: [postgis-users] Storage of tile offset on a raster dataset

2016-01-20 Thread Pierre Racine
James, > When importing a large raster dataset, it is typically tiled and the only > reference in postgis that these tiles form a single dataset is the > raster_columns table. You could also load your rasters with the -f option which add a column with the filename of the original raster file.

Re: [postgis-users] Geoprocessing & BigData

2016-01-19 Thread Pierre Racine
> @Vincent : For ArcGIS Union, please see here. > http://resources.esri.com/help/9.3/arcgisengine/java/gp_toolref/analysis_ > tools/union_analysis_.htm ArcGIS Union resume to removing overlaps from the union of two tables. Look at the ST_DifferenceAgg() example in the PostGIS Addons:

Re: [postgis-users] Help with SQL query?

2015-11-23 Thread Pierre Racine
is a pleasure - albeit the results do not always please me :) Hopefully I can put this to work later tonight. Best wishes Darrel From: postgis-users [mailto:postgis-users-boun...@lists.osgeo.org] On Behalf Of Pierre Racine Sent: 23 November 2015 16:17 To: PostGIS Users Discussion <postgis-u

Re: [postgis-users] Help with SQL query?

2015-11-23 Thread Pierre Racine
her you again. Darrel From: postgis-users [mailto:postgis-users-boun...@lists.osgeo.org] On Behalf Of Pierre Racine Sent: 23 November 2015 20:30 To: PostGIS Users Discussion <postgis-users@lists.osgeo.org><mailto:postgis-users@lists.osgeo.org> Subject: Re: [postgis-users] Help with S

Re: [postgis-users] Help with SQL query?

2015-11-23 Thread Pierre Racine
Darrel, 1) Create a new raster selecting the right pixels with ST_MapAlgebra(raster, raster) 2) Make sure only intersecting rasters are processed by using their upper left corner X and Y coordinates (with ST_UpperLeftX() and UpperLeftY()) 3) Sum the selected pixels with

Re: [postgis-users] Raster calculation on 3d raster (stack)

2015-11-20 Thread Pierre Racine
Doesn’t the second example (One raster, several bands) similar to your case in the doc? http://postgis.net/docs/RT_ST_MapAlgebra.html Pierre From: postgis-users [mailto:postgis-users-boun...@lists.osgeo.org] On Behalf Of David Haynes Sent: Tuesday, November 17, 2015 9:48 AM To:

Re: [postgis-users] SUM on rasters

2015-10-14 Thread Pierre Racine
If by "sum" you mean "merge" or "union" use ST_Union(). Be careful as the "sum" can exceed available memory if they are too many rasters in the table. > -Original Message- > From: postgis-users [mailto:postgis-users-boun...@lists.osgeo.org] On > Behalf Of Stephen Crawford > Sent: Monday,

Re: [postgis-users] raster2pgsql wildcards on windows

2015-10-14 Thread Pierre Racine
Copy all your files in a single folder and only use one wildcard. d:\postgis_in_action\ch13_data_code\vietnam\dted\allfiles\*.dt0 From: postgis-users-boun...@lists.osgeo.org [mailto:postgis-users-boun...@lists.osgeo.org] On Behalf Of toni hernández Sent: Tuesday, October 06, 2015 10:49 AM To:

Re: [postgis-users] ST_Clip

2015-08-17 Thread Pierre Racine
I guess the band argument comes before the geom argument in ST_Clip(). You can pass an array for the bands you require. Pierre -Original Message- From: postgis-users-boun...@lists.osgeo.org [mailto:postgis-users- boun...@lists.osgeo.org] On Behalf Of David Haynes Sent: Wednesday,

Re: [postgis-users] raster, stats conditioned to a set of values

2015-07-06 Thread Pierre Racine
Adding a GROUP BY t1.rid, doesn't solve the problem, still get an error. Which error? ___ postgis-users mailing list postgis-users@lists.osgeo.org http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users

Re: [postgis-users] raster, stats conditioned to a set of values

2015-07-06 Thread Pierre Racine
have a way to display the footprints of your rasters tiles? Pierre -Original Message- From: juli g. pausas [mailto:juli.g.pau...@uv.es] Sent: Monday, July 06, 2015 9:58 AM To: Pierre Racine Cc: PostGIS Users Discussion Subject: Re: [postgis-users] raster, stats conditioned to a set

Re: [postgis-users] raster, stats conditioned to a set of values

2015-07-02 Thread Pierre Racine
But my main problem is that I would like to do this (e.g., the query above), but only for the pixels in which Band2 = 0. Any idea? any clue? 1) isolate the pixels with 0. For this you can use ST_MapAlgebra() or ST_Reclass(). I use ST_MapAlgebra() in the following query 2) compute the

Re: [postgis-users] Problem in Clip between geometry and raster table

2015-07-02 Thread Pierre Racine
Why is the first argument to ST_Clip() is a geometry? Should be a raster. -Original Message- From: postgis-users-boun...@lists.osgeo.org [mailto:postgis-users- boun...@lists.osgeo.org] On Behalf Of Marcello Benigno Sent: Wednesday, July 01, 2015 7:12 AM To: PostGIS Users Discussion

Re: [postgis-users] raster, stats conditioned to a set of values

2015-07-02 Thread Pierre Racine
| On Tue, Jun 30, 2015 at 5:29 PM, Pierre Racine pierre.rac...@sbf.ulaval.ca wrote: You can select pixels fulfilling an expression using the one-raster variant of ST_MapAlgebra http://postgis.net/docs/RT_ST_MapAlgebra_expr.html So just do something like

Re: [postgis-users] raster, stats conditioned to a set of values

2015-06-30 Thread Pierre Racine
You can select pixels fulfilling an expression using the one-raster variant of ST_MapAlgebra http://postgis.net/docs/RT_ST_MapAlgebra_expr.html So just do something like: ST_MapAlgebra(rast, '8BUI'::text, '[rast] 0') before computing stats. To count the number of pixels of a certain value

Re: [postgis-users] Using Postgis raster for water elevation

2015-05-27 Thread Pierre Racine
Or ST_Reclass() reclassifying everything 10 to nodata... -Original Message- From: postgis-users-boun...@lists.osgeo.org [mailto:postgis-users- boun...@lists.osgeo.org] On Behalf Of Rémi Cura Sent: Wednesday, May 27, 2015 9:31 AM To: PostGIS Users Discussion Subject: Re:

Re: [postgis-users] What is the Polygon thinning function in PostGIS?

2015-05-20 Thread Pierre Racine
Read this: https://smathermather.wordpress.com/2012/08/10/what-is-the-center-line-of-a-complex-polygon-routing-stream-and-rivers-part-two/ -Original Message- From: postgis-users-boun...@lists.osgeo.org [mailto:postgis-users- boun...@lists.osgeo.org] On Behalf Of Tom van Tilburg Sent:

Re: [postgis-users] create table from existing raster table

2015-05-08 Thread Pierre Racine
What do you mean by proper? How is it? Your query should results in a raster column. Pierre From: postgis-users-boun...@lists.osgeo.org [postgis-users-boun...@lists.osgeo.org] On Behalf Of Ahmet Temiz [ahmettemi...@gmail.com] Sent: Friday, May 08, 2015

Re: [postgis-users] Using ST_Slope in EPSG:4326

2015-05-08 Thread Pierre Racine
You have to project your raster wit ST_Transform() before calling ST_Slope(). You also have to ST_Union() your raster tiles before projecting it. Pierre From: postgis-users-boun...@lists.osgeo.org [postgis-users-boun...@lists.osgeo.org] On Behalf Of

Re: [postgis-users] Computation of quantiles in Polygon-Raster

2015-05-05 Thread Pierre Racine
I guess you have two options: 1) clip and union your tiles BEFORE computing the quantile 2) use the ST_Quantile variant taking table and column names. I don't know if these function aggregates the results though. Pierre -Original Message- From: postgis-users-boun...@lists.osgeo.org

Re: [postgis-users] Calculate area of raster/polygon intersections in PostGIS

2015-04-16 Thread Pierre Racine
1 - What's the best way to do raster/polygon intersections? I read about two different approaches, one using ST_Intersection and the other one using ST_Clip. The second one apparently is faster and more efficient, but i don't know about its precision. The precision depends on the sizes of

Re: [postgis-users] Problem to visualize raster data from PostGIS inQGIS

2015-03-31 Thread Pierre Racine
Just SELECT (ST_DumpAsPolygons(rast)).* FROM deforested_areas -–WHERE rid = 1 -Original Message- From: postgis-users-boun...@lists.osgeo.org [mailto:postgis-users- boun...@lists.osgeo.org] On Behalf Of Hugues François Sent: Tuesday, March 31, 2015 10:05 AM To: PostGIS Users

Re: [postgis-users] raster2pgsql creates tables without values

2015-03-25 Thread Pierre Racine
How do you check that your rasters only nodata value? You know, very often, raster and geometries are not displayed in the pgAdmin table result when they are too large. What's the result of SELECT postgis_full_version() on both machines? Pierre -Original Message- From:

Re: [postgis-users] raster2pgsql: -t TILE_SIZE

2015-03-16 Thread Pierre Racine
If you're storing the raster in the database, I have no specific suggestions. The reason for no suggestion is that it really depends on the characteristics of the raster (number of bands, pixel type of each band) and the server environment. You normally want to store in-db because you want to

[postgis-users] ST_Clip on a raster without band crashes the server

2015-02-24 Thread Pierre Racine
Hi, I have: POSTGIS=2.1.5 r13152 GEOS=3.4.2-CAPI-1.8.2 r0 PROJ=Rel. 4.8.0, 6 March 2012 GDAL=GDAL 1.11.1, released 2014/09/24 LIBXML=2.7.8 LIBJSON=UNKNOWN RASTER and SELECT ST_Clip(ST_MakeEmptyRaster(42, 42, 0, 0, 1.0, 1.0, 0, 0, 4269), ST_MakeEnvelope(0, 0, 20, 20, 4269)); crashed my

Re: [postgis-users] ST_Clip on a raster without band crashes the server

2015-02-24 Thread Pierre Racine
, 2015 at 6:50 AM, Pierre Racine pierre.rac...@sbf.ulaval.ca wrote: Hi, I have: POSTGIS=2.1.5 r13152 GEOS=3.4.2-CAPI-1.8.2 r0 PROJ=Rel. 4.8.0, 6 March 2012 GDAL=GDAL 1.11.1, released 2014/09/24 LIBXML=2.7.8 LIBJSON=UNKNOWN RASTER and SELECT ST_Clip

Re: [postgis-users] Elevation profiles from rasters

2014-08-28 Thread Pierre Racine
rasters Thanks, I'm using the technique described at http://blog.mathieu- leplatre.info/drape-lines-on-a-dem-with-postgis.html What would be small tiles in this context? 256x256? The raster I was testing against was ~1200x1200. -ra On 27 Aug 2014, at 16:19, Pierre Racine pierre.rac

Re: [postgis-users] Elevation profiles from rasters

2014-08-27 Thread Pierre Racine
Elevation profile should be quite fast depending on how you tile your raster coverage. Smaller tiles make computation faster. Index them and make sure your query is actually using the index. Pierre -Original Message- From: postgis-users-boun...@lists.osgeo.org [mailto:postgis-users-

Re: [postgis-users] PostGIS Raster Performance

2014-08-21 Thread Pierre Racine
You should use the raster stats functions instead of ST_DumpAsPolygon to get values or summary stats from the clipped rasters. http://postgis.net/docs/RT_reference.html#RasterBand_Stats Pierre From: postgis-users-boun...@lists.osgeo.org

Re: [postgis-users] Summary Statistics (vector, raster)

2014-06-13 Thread Pierre Racine
...@postgis.refractions.net; Pierre Racine Subject: Re: [postgis-users] Summary Statistics (vector, raster) POSTGIS begginer here: I think I'm having a similar problem as described in this post. I tryed following Pierre's sucgestion (second post), but I'm not able to find or install the SummarystatsAgg

Re: [postgis-users] ST_SelectByValue

2014-06-05 Thread Pierre Racine
Try ST_Reclass(). -Original Message- From: postgis-users-boun...@lists.osgeo.org [mailto:postgis-users- boun...@lists.osgeo.org] On Behalf Of David Haynes Sent: Friday, May 30, 2014 10:49 AM To: postgis-users@lists.osgeo.org Subject: [postgis-users] ST_SelectByValue Hello, I

Re: [postgis-users] raster support

2014-06-05 Thread Pierre Racine
These variables are system variables, not PostgreSQL variables. to know how to set them in your system search for set environment variable os x. Pierre -Original Message- From: postgis-users-boun...@lists.osgeo.org [mailto:postgis-users- boun...@lists.osgeo.org] On Behalf Of John

Re: [postgis-users] ST_SelectByValue

2014-06-05 Thread Pierre Racine
, June 05, 2014 3:34 PM To: PostGIS Users Discussion Subject: Re: [postgis-users] ST_SelectByValue reclass would allow me to change the values of the pixel. ST_SelectByValue is supposed to like a map algebra or in ArcGIS Terms select by attribute. On Thu, Jun 5, 2014 at 1:38 PM, Pierre

Re: [postgis-users] getting raster values for point from st_value

2014-05-14 Thread Pierre Racine
To: PostGIS Users Discussion; Pierre Racine Subject: Re: [postgis-users] getting raster values for point from st_value Hi Pierre, Thanks so much for super quick response. You will have to forgive me I am fairly new to postgis. Creating the table is no problem but how would I check

Re: [postgis-users] add foreign-key constraint on raster import

2014-05-14 Thread Pierre Racine
You can add the filename as a new column with the -f option. Then you can extract whatever you want from this column to build a key. Does this works for you? Pierre -Original Message- From: postgis-users-boun...@lists.osgeo.org [mailto:postgis-users- boun...@lists.osgeo.org] On

Re: [postgis-users] add foreign-key constraint on raster import

2014-05-14 Thread Pierre Racine
before importing in the DB. Pierre -Original Message- From: Max Demars [mailto:burton449...@gmail.com] Sent: Wednesday, May 14, 2014 11:19 AM To: PostGIS Users Discussion Cc: Pierre Racine Subject: Re: [postgis-users] add foreign-key constraint on raster import I was thinking

Re: [postgis-users] Postgis raster tutorial

2014-05-13 Thread Pierre Racine
Done! http://geospatialelucubrations.blogspot.ca/2014/05/a-guide-to-rasterization-of-vector.html Pierre -Original Message- From: postgis-users-boun...@lists.osgeo.org [mailto:postgis-users- boun...@lists.osgeo.org] On Behalf Of georgew Sent: Monday, April 21, 2014 6:37 PM To:

Re: [postgis-users] getting raster values for point from st_value

2014-05-13 Thread Pierre Racine
Create a new table with the extents of the raster tiles and check if it overlaps with your points: CREATE TABLE rastextets AS SELECT rast::geometry FROM tbl_raster Pierre -Original Message- From: postgis-users-boun...@lists.osgeo.org [mailto:postgis-users- boun...@lists.osgeo.org]

Re: [postgis-users] Dted elevations

2014-05-09 Thread Pierre Racine
What happened when you remove and st_value (dted_elevations.rast, f.geom) is not null? You get null values? Do you have many nodata values in your raster? How is your raster tiled? Did you build a spatial index on the raster tiles? Pierre -Original Message- From:

[postgis-users] Raster ST_Union memory limit

2014-05-06 Thread Pierre Racine
Hi, What maximum size the result of a ST_Union(rast) can be if it is embedded in a ST_Tile() call? SELECT ST_Tile(ST_Union(rast), 100, 100) rast FROM ... The RAM available to PostgreSQL or the maximum size of a PostgreSQL field (1GB)? Thanks, Pierre

Re: [postgis-users] Raster ST_Union memory limit

2014-05-06 Thread Pierre Racine
6, 2014 at 6:35 AM, Pierre Racine pierre.rac...@sbf.ulaval.ca wrote: Hi, What maximum size the result of a ST_Union(rast) can be if it is embedded in a ST_Tile() call? SELECT ST_Tile(ST_Union(rast), 100, 100) rast FROM ... The RAM available to PostgreSQL

Re: [postgis-users] Raster ST_Union memory limit

2014-05-06 Thread Pierre Racine
...@lists.osgeo.org] On Behalf Of Bborie Park Sent: Tuesday, May 06, 2014 10:03 AM To: PostGIS Users Discussion Subject: Re: [postgis-users] Raster ST_Union memory limit I think your query will explode... On Tue, May 6, 2014 at 7:01 AM, Pierre Racine pierre.rac...@sbf.ulaval.ca wrote

Re: [postgis-users] Postgis raster tutorial

2014-04-21 Thread Pierre Racine
There are two strategies to convert a table composed of many geometries to a raster coverage: 1) ST_AsRaster each geometries, ST_Union them and then ST_Tile them. 2) Use ST_ExtractToRaster() from the PostGIS Add-ons. I plan to blog about this as soon as I get 400 times 5 minutes... Pierre

Re: [postgis-users] ST_AsRaster vs raster2pgsql

2014-03-04 Thread Pierre Racine
It's not because the entries in raster_columns are different that the actual tables are different. Info in raster_columns is generated from constraints set by raster2pgsql. A better way to compare the two tables is to use ST_Metadata() and ST_BandMetadata(). You can also set the constraints on

Re: [postgis-users] ST_AsRaster vs raster2pgsql

2014-03-04 Thread Pierre Racine
You can set the pixeltype and the extent in ST_AsRaster(). You seems also to have a different nodata value that you can also set in ST_AsRaster(). So a bit of reading about ST_AsRaster() and experiment and you'll should get what you want. Pierre -Original Message- From:

Re: [postgis-users] import raster

2014-02-28 Thread Pierre Racine
Importing a big raster as a coverage with a huge number of small tiles always takes a long time. Two options: -Increase the size of your tiles. They don't have to be that small to get good performance with intersections. -Do you really need the raster to be inside the database? Try adding the

Re: [postgis-users] ST_MapAlgebraExpr 2 rasters problem with resultant raster

2014-02-25 Thread Pierre Racine
What is the exact query you do when trying to compute the sum or the max of the resulting raster? -Original Message- From: postgis-users-boun...@lists.osgeo.org [mailto:postgis-users- boun...@lists.osgeo.org] On Behalf Of g.si...@utwente.nl Sent: Monday, February 24, 2014 3:44 PM

Re: [postgis-users] Masking raster values

2014-02-12 Thread Pierre Racine
Guido, no masks (you can create a mask as a band) means that a mask is nothing different than a normal band. It's just a band that is mostly used to intersect (mask) another band having normal values. You can do that with... ... ST_Intersection(raster, raster) So first you want to

Re: [postgis-users] Removing tiny polygons

2014-01-28 Thread Pierre Racine
Give a try to ST_TrimMulti() in the PostGIS Add-ons: http://geospatialelucubrations.blogspot.ca/2013/11/launching-postgis-add-ons-new-postgis.html https://github.com/pedrogit/postgisaddons/releases/tag/1.21 Pierre -Original Message- From: postgis-users-boun...@lists.osgeo.org

Re: [postgis-users] ST_ConcaveHull giving up too soon, aka too convex

2014-01-14 Thread Pierre Racine
Try this: SELECT ST_Buffer(ST_Union(ST_Buffer(geom, 0.0001)), -0.8) FROM points -Original Message- From: postgis-users-boun...@lists.osgeo.org [mailto:postgis-users- boun...@lists.osgeo.org] On Behalf Of Ivan Price Sent: Tuesday, January 14, 2014 8:36 AM To: PostGIS Users

Re: [postgis-users] point to raster conversion

2013-12-19 Thread Pierre Racine
You did not paste your code... ST_ExtracToRaster() should work on a geometry table. If you want it to work on point cloud table you have to add a set of methods to the ST_ExtractPixelValue4ma() function. Sorry that was not clear. you could start by converting your patches to geometries to test

Re: [postgis-users] point to raster conversion

2013-12-19 Thread Pierre Racine
MEAN_OF_VALUES_AT_PIXEL_CENTROID, which is the default ST_ExtractToRaster() method, search for geometries intersecting with the centroid of the pixel (a point). That's the method you use both calls to ExtractToRaster(). As it's almost impossible that a point intersects a point, this is

Re: [postgis-users] point to raster conversion

2013-12-19 Thread Pierre Racine
Can you please confirm if there is or isn't a method to set/get several pixels at a time? I don't know any... ___ postgis-users mailing list postgis-users@lists.osgeo.org http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users

Re: [postgis-users] point to raster conversion

2013-12-19 Thread Pierre Racine
2013/12/19 Pierre Racine pierre.rac...@sbf.ulaval.ca MEAN_OF_VALUES_AT_PIXEL_CENTROID, which is the default ST_ExtractToRaster() method, search for geometries intersecting with the centroid of the pixel (a point). That's the method you use both calls

Re: [postgis-users] point to raster conversion

2013-12-18 Thread Pierre Racine
I would rather use the user custom function mapalgebra technique used in ST_ExtracToRaster() in the PostGIS Add-ons to extract a mean value for the group of point intersecting with each pixel. This should work well if 1) most pixels have points inside so there is no need to interpolate 2) it is

Re: [postgis-users] PostGIS ST_MapAlgebra Assistance

2013-12-16 Thread Pierre Racine
Assuming your three rasters would be in three different tables and not tiled, it could look like this: WITH solandcov AS (SELECT ST_MapAlgebra(a.rast, b.rast, '([rast1] = 1491 and [rast2] = 70)::int', 4BUI) FROM sol_gain_clipped a, can_cov_01 b), creek AS (SELECT ST_MapAlgebra(a.rast, b.rast,

Re: [postgis-users] biggest rectangle contained within another polygon

2013-12-04 Thread Pierre Racine
You will have to define biggest more precisely. Biggest in terms of area? There might be many inner rectangles having the same biggest area. How to choose one over the other? Pierre -Original Message- From: postgis-users-boun...@lists.osgeo.org [mailto:postgis-users-

Re: [postgis-users] biggest rectangle contained within another polygon

2013-12-04 Thread Pierre Racine
Of Pierre Racine Sent: Wednesday, December 04, 2013 9:42 AM To: PostGIS Users Discussion Subject: Re: [postgis-users] biggest rectangle contained within another polygon You will have to define biggest more precisely. Biggest in terms of area? There might be many inner rectangles having the same

Re: [postgis-users] [postgis] Optimal tile size for Raster

2013-12-04 Thread Pierre Racine
You are getting fast result because you are not operating at the pixel level. Only at the raster extent level (converted to geometry). A more usual query would be to intersect a raster with some polygons: SELECT (ST_Intersection(r.rast, q.geom)).* FROM ilatlon32x32 as r, geometrytable as q

Re: [postgis-users] [postgis] Optimal tile size for Raster

2013-12-04 Thread Pierre Racine
- From: postgis-users-boun...@lists.osgeo.org [mailto:postgis-users- boun...@lists.osgeo.org] On Behalf Of Pierre Racine Sent: Mittwoch, 4. Dezember 2013 17:43 To: PostGIS Users Discussion Subject: Re: [postgis-users] [postgis] Optimal tile size for Raster You are getting fast result because

Re: [postgis-users] Postgis raster : jfif? jp2?

2013-11-25 Thread Pierre Racine
Laurent, The list of available drivers is dependent on your installation. Normally if you can gdalinfo a raster, raster2psgql should be able to load it. So the first thing is: Does gdalinfo works fine? If not then you should refer to the gdal list. I yes then it might be a raster2pgsql problem

Re: [postgis-users] The first release of the PostGIS Add-ons is out!

2013-11-20 Thread Pierre Racine
Not really the same thing as I said... ;-) I would prefer You just DO WHAT THE FUCK YOU WANT TO as long as it stay open... -Original Message- From: postgis-users-boun...@lists.osgeo.org [mailto:postgis-users- boun...@lists.osgeo.org] On Behalf Of Mateusz Loskot Sent: Wednesday,

Re: [postgis-users] ST_SetValue problem

2013-11-19 Thread Pierre Racine
The result is that I change raster values in only 1 of the 81 polygon cells that I have in schema.data_vector. What am I missing here? Thanks for your help! Keep up the great work! UPDATE schema.data_raster SET rast = ST_SetValue(rast,1, geom, 100) FROM schema.data_vector I don't fully

Re: [postgis-users] The first release of the PostGIS Add-ons is out!

2013-11-19 Thread Pierre Racine
] The first release of the PostGIS Add-ons is out! Le 11/18/2013 12:25 PM, Stephen Woodbridge a écrit : On 11/18/2013 12:20 PM, Mateusz Loskot wrote: On 18 November 2013 17:13, Pierre Racine pierre.rac...@sbf.ulaval.ca wrote: I'm a license ignorant. Release it into the public domain

Re: [postgis-users] The first release of the PostGIS Add-ons is out!

2013-11-19 Thread Pierre Racine
] On Behalf Of Pierre Racine Sent: Tuesday, November 19, 2013 1:45 PM To: PostGIS Users Discussion Subject: Re: [postgis-users] The first release of the PostGIS Add-ons is out! I knew we would fall into a license nightmare... So far we've got suggestions for No rights reserved, BSD, Creative Common

Re: [postgis-users] The first release of the PostGIS Add-ons is out!

2013-11-19 Thread Pierre Racine
IMHO, It's fine (actually wonderful) that postgis is in the GPL, it protects the project and does not really limit its use in any substantive way. It's big enough to stand on its own. But re: #2 GPL would limit the wide use of these scripts. How would GPL limit the wide use of these

[postgis-users] The first release of the PostGIS Add-ons is out!

2013-11-18 Thread Pierre Racine
Hey! I'm glad today to launch the PostGIS Add-ons. This new PostGIS extension aims at providing a quick, more Agile way to release pure PL/pgSQL functions developed by the PostGIS user community. It includes 15 new functions. Among them, two functions to aggregate raster/vector overlay

Re: [postgis-users] The first release of the PostGIS Add-ons is out!

2013-11-18 Thread Pierre Racine
Sent: Monday, November 18, 2013 11:49 AM To: PostGIS Users Discussion Subject: Re: [postgis-users] The first release of the PostGIS Add-ons is out! Very cool idea. I have a lot of plpgsql functions. One more detail : what about licenses? Cheers, Rémi-C 2013/11/18 Pierre Racine

Re: [postgis-users] The first release of the PostGIS Add-ons is out!

2013-11-18 Thread Pierre Racine
Humm.. Lots of requirements... Sorry for the license, I needed a clear answer :-) I personnaly would prefere LGPL, like postgres. Doesn't seems like a good idea to make it different than PostGIS. How is LGPL different from LPG? I'm a license ignorant. can you consider to use a template doc

Re: [postgis-users] The first release of the PostGIS Add-ons is out!

2013-11-18 Thread Pierre Racine
Rémi, About license : if you use GPL function, your code becomes GPL, this might be a problem if using it inside company. If you use LGPL, you can do basically what you want. I think about going like Mateusz and Stephen suggested. What do you think? Using PostGIS everyday, I already find

  1   2   >