Re: [postgis-users] Topology: Simplifying Coastlines with Islands

2012-05-28 Thread Michiel J. van Heek
Quoting Sandro Santilli : On Mon, May 28, 2012 at 02:50:43PM +0200, Michiel J. van Heek wrote: Quoting Sandro Santilli : ... >How do your country boundaries look now ? :) They look pretty good. Most remaining trouble edges are relatively short. Three long coastlines remain problematic: arcti

Re: [postgis-users] RE : get unique values from raster intersecting apolygon

2012-05-28 Thread Pierre Racine
In PostGIS you can easily create a grid with ST_MakeEmptyRaster() and ST_PixelAsPolygons() Pierre > -Original Message- > From: postgis-users-boun...@postgis.refractions.net [mailto:postgis-users- > boun...@postgis.refractions.net] On Behalf Of pcr...@pcreso.com > Sent: Monday, May 28, 20

Re: [postgis-users] RE : RE : RE : get unique values from raster intersecting apolygon

2012-05-28 Thread Pierre Racine
If what you want is the mean of all the pixel centroid falling inside the polygon you do a query like this: SELECT (ST_SummaryStatsAgg(ST_Clip(rast, geom))).* FROM clip_build, nclheat WHERE ST_Intersects(rast, geom) If what you want is the area weighted mean of all the raster values inside the

Re: [postgis-users] Topology: Simplifying Coastlines with Islands

2012-05-28 Thread Stephen Woodbridge
On 5/28/2012 3:58 PM, Sandro Santilli wrote: On Mon, May 28, 2012 at 02:50:43PM +0200, Michiel J. van Heek wrote: Quoting Sandro Santilli: ... How do your country boundaries look now ? :) They look pretty good. Most remaining trouble edges are relatively short. Three long coastlines remain p

Re: [postgis-users] Topology: Simplifying Coastlines with Islands

2012-05-28 Thread Sandro Santilli
On Mon, May 28, 2012 at 02:50:43PM +0200, Michiel J. van Heek wrote: > Quoting Sandro Santilli : ... > >How do your country boundaries look now ? :) > > They look pretty good. Most remaining trouble edges are relatively > short. Three long coastlines remain problematic: arctic Canada, > southern/e

Re: [postgis-users] RE : get unique values from raster intersecting apolygon

2012-05-28 Thread pcreso
You could try something like gdal2xyz.py on you raster to create points for each raster cell which can be imported directly into postgis as point geometries, like: psql "create table xyz (id serial,x decimal, y decimal, z decimal)" gdal2xyz.py | psql "copy xyz (x,y,z) from stdin..." psql "selec

Re: [postgis-users] Ubuntu Postgis and Shp2pgsql

2012-05-28 Thread Paolo Cavallini
Il 28/05/2012 19:55, Lee Hachadoorian ha scritto: > I looked in DB Manager and don't see the import functionality. Where is it? Just drag & drop. All the best. -- Paolo Cavallini - Faunalia www.faunalia.eu Full contact details at www.faunalia.eu/pc __

Re: [postgis-users] RE : RE : get unique values from raster intersecting apolygon

2012-05-28 Thread Pierre Racine
What is not clear in your description is: How do you want the value associated to each polygon to be computed from the many pixel the polygon is intersecting with? Do you want: -the raster value corresponding to one point inside the polygon -the mean of all the pixel centroid falling inside the

Re: [postgis-users] Ubuntu Postgis and Shp2pgsql

2012-05-28 Thread Lee Hachadoorian
On Mon, May 28, 2012 at 10:25 AM, Paolo Cavallini wrote: > Il 28/05/2012 16:23, Martin Fafard ha scritto: >> Hi >> >> Quantum GIS is a good way to load shape in Postgis (SPIT extension) > > SPIT is obsolete. Try DB Manager. > All the best. José, PostGIS will install shp2pgsql, a command line imp

[postgis-users] RE : RE : get unique values from raster intersecting apolygon

2012-05-28 Thread Francois Hugues
Thanks but i think the way I made my picture was not really clear and I understand now how you read it ! I already know the existence of st_value for points. Here, the red point on my picture are the values of the raster and not a table of points : if it is build from a DEM, you have the elevat

Re: [postgis-users] Speeding up point-in-polygon search using ST_SimplifyPreserveTopology?

2012-05-28 Thread Stephen Woodbridge
Evan, Here is the old post about tiling polygons. There may be others also. 0Steve On 3/3/2011 7:03 PM, Arnold Helmut Engelmann wrote: If you want to go the tiling route and want to try that: Create a layer of tiles (boxes) at the size you want. Then run the following query: CRE

Re: [postgis-users] Speeding up point-in-polygon search using ST_SimplifyPreserveTopology?

2012-05-28 Thread Stephen Woodbridge
On 5/28/2012 10:08 AM, Evan Martin wrote: Hi all, I have a table of ~350 multi-polygons and ~185,000 points and I need to find which points are inside which multi-polygons. Some polygons are quite large and span the dateline, so I'm using geography ST_DWithin for this (with a tolerance of 100m).

Re: [postgis-users] RE : get unique values from raster intersecting apolygon

2012-05-28 Thread Pierre Racine
I this case the right query looks like this: SELECT gid, ST_Value(rast, geom) val FROM yourraster table, yourpointtable WHERE ST_Intersects(rast, geom) Make sure to tile and index your raster properly (smaller is better). You can do this at import time. The result for cell outside any polygon w

Re: [postgis-users] Ubuntu Postgis and Shp2pgsql

2012-05-28 Thread Paolo Cavallini
Il 28/05/2012 16:23, Martin Fafard ha scritto: > Hi > > Quantum GIS is a good way to load shape in Postgis (SPIT extension) SPIT is obsolete. Try DB Manager. All the best. -- Paolo Cavallini - Faunalia www.faunalia.eu Full contact details at www.faunalia.eu/pc __

Re: [postgis-users] Ubuntu Postgis and Shp2pgsql

2012-05-28 Thread Martin Fafard
Hi Quantum GIS is a good way to load shape in Postgis (SPIT extension) Martin Le 2012-05-28 10:16, José María Amuedo a écrit : Hello, How can I import shapefiles to PostGIS 2.0 in ubuntu? If I need more extensions, how can I install them? I tried to export it from gvSIG but it always I get

[postgis-users] Ubuntu Postgis and Shp2pgsql

2012-05-28 Thread José María Amuedo
Hello, How can I import shapefiles to PostGIS 2.0 in ubuntu? If I need more extensions, how can I install them? I tried to export it from gvSIG but it always I get the same problem. I don´t know what can I do. Help me, please. Thanks. Jose ___ postg

[postgis-users] Speeding up point-in-polygon search using ST_SimplifyPreserveTopology?

2012-05-28 Thread Evan Martin
Hi all, I have a table of ~350 multi-polygons and ~185,000 points and I need to find which points are inside which multi-polygons. Some polygons are quite large and span the dateline, so I'm using geography ST_DWithin for this (with a tolerance of 100m). My initial query looks like this (simp

[postgis-users] RE : get unique values from raster intersecting apolygon

2012-05-28 Thread Francois Hugues
I want one value per red point (which are raster data). The gid of one polygon will appear as many times as necessary regarding how it intersects the raster. Hugues. Message d'origine De: postgis-users-boun...@postgis.refractions.net de la part de Pierre Racine Date: lun. 28/0

Re: [postgis-users] PostGIS raster completely black

2012-05-28 Thread Salvatore Larosa
Il giorno lun, 28/05/2012 alle 12.17 +0200, Jorge Arevalo ha scritto: > Hi, > > I think it's a GDAL driver problem. Could you test with GDAL 1.8? > > Best regards, I also tested with 1.8, but I have a like problem! Now I get NULL value (R:null, G:null, B:null)! -- Salvatore Larosa linkedIn: ht

Re: [postgis-users] get unique values from raster intersecting a polygon

2012-05-28 Thread Pierre Racine
You want one value per polygon or one value per red point? It is not clear to me from your drawing. Pierre > -Original Message- > From: postgis-users-boun...@postgis.refractions.net [mailto:postgis-users- > boun...@postgis.refractions.net] On Behalf Of Francois Hugues > Sent: Saturday, M

Re: [postgis-users] Topology: Simplifying Coastlines with Islands

2012-05-28 Thread Sandro Santilli
On Mon, May 28, 2012 at 11:56:13AM +0200, Michiel J. van Heek wrote: > Sandro, > > Based on your suggestions, I changed the script in three ways (see > below for the result): > > 1. The number of iterations is now a parameter and running down the > tolerance uses linear steps for each iteration

Re: [postgis-users] PostGIS raster completely black

2012-05-28 Thread Jorge Arevalo
On Mon, May 28, 2012 at 10:45 AM, Salvatore Larosa wrote: > Il giorno lun, 28/05/2012 alle 10.25 +0200, Paolo Cavallini ha scritto: >> Il 27/05/2012 00:21, Salvatore Larosa ha scritto: >> >> > then I try to display it in QGIS, via DBManager plugin and I get a >> > completely black raster (see atta

Re: [postgis-users] Topology: Simplifying Coastlines with Islands

2012-05-28 Thread Michiel J. van Heek
Quoting Sandro Santilli : On Sat, May 26, 2012 at 10:37:14PM +0200, Michiel J. van Heek wrote: So, why not use ST_SimplifyPreserveTopology by default? Or is that function generally a lot slower than ST_Simplify? Is a lot slower. But the script was just an example, you can tweak the heuristic

Re: [postgis-users] PostGIS raster completely black

2012-05-28 Thread Salvatore Larosa
Il giorno lun, 28/05/2012 alle 10.25 +0200, Paolo Cavallini ha scritto: > Il 27/05/2012 00:21, Salvatore Larosa ha scritto: > > > then I try to display it in QGIS, via DBManager plugin and I get a > > completely black raster (see attached image). > > In mapserver get the same! The definition of my

Re: [postgis-users] ST_Aspect artifacts?

2012-05-28 Thread Paolo Cavallini
Il 25/05/2012 19:29, David B�langer ha scritto: > May be you can use gdal_dem with PostGis Raster reader (mode 2) if you want > create > derived product from DEM? http://www.gdal.org/gdaldem.html >

Re: [postgis-users] PostGIS raster completely black

2012-05-28 Thread Paolo Cavallini
Il 27/05/2012 00:21, Salvatore Larosa ha scritto: > then I try to display it in QGIS, via DBManager plugin and I get a > completely black raster (see attached image). > In mapserver get the same! The definition of my mapfile is: stupid question: is it balck because of styling, or because the valu

Re: [postgis-users] PostGis Raster and GDAL 1.9

2012-05-28 Thread Jorge Arevalo
Hi, David, could you please attach the original files? Seems to be a problem with the way the driver gets the origin of the raster coverage, yes. The code in GDAL trunk is under development. Slowness problem is one of the reasons. Best regards, Jorge On Tue, May 22, 2012 at 7:01 PM, David B�lan