[postgis-users] PostGIS 2.0 Alpha

2011-12-19 Thread Bart Chen
Hi All,

Is PostGIS 2.0 Alpha released? Where can I find the installer?

Thanks a lot!
Bart
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] Is st_isvalidreason singular for any polygon, or can multiple errors be returned?

2011-12-19 Thread Ben Madin
No worries - is that just adding a ticket in trac, or is there something more 
sophisticated for documentation?

cheers

Ben

On 19/12/2011, at 11:58 PM, Sandro Santilli wrote:

> On Mon, Dec 19, 2011 at 11:02:49PM +0800, Ben Madin wrote:
> 
>> Either way is fine, but maybe for now we could put a line into the 
>> documentation to that effect:
>> 
>> "Note: By design only the first invalidity in a polygon is reported. After 
>> correcting errors identified by st_isvalidreason it should be run again to 
>> check that there are no further errors."
> 
> Sure, do you feel like producing a patch and attaching it to a ticket on
> http://trac.osgeo.org/postgis ?
> 
> --strk;
> 
>  ,--o-. 
>  |   __/  |Thank you for PostGIS-2.0 Topology !
>  |  / 2.0 |http://www.pledgebank.com/postgistopology
>  `-o--'
> 
> ___
> postgis-users mailing list
> postgis-users@postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users

___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] How to look up state highways with geocoder?

2011-12-19 Thread Aren Cambre
Getting closer.

I checked the *tiger_data.tx_featnames* table's *fullname* column and am
finding many references to *State Hwy 121*, matched using *like %121%*.

To match Denton Tap Rd., I have to use *like %Denton Tap%* in my *select*.
Lower case (*%denton tap%*) produces no results--but not sure if that's
relevant to the *geocode_intersection* issue here.

OK, so I run this query:
*SELECT * FROM geocode_intersection('State Hwy 121', 'Denton Tap', 'TX',
'Coppell');*
...and get no results!

I also tried these:

   - *Denton Tap Rd*
   - *N Denton Tap Rd*
   - *S Denton Tap Rd*

Not clear what's the deal here. One of these ought to match, especially
since there are two TX 121s meeting with Denton Tap.

I also tried omitting the city and still get nothing:
*SELECT * FROM geocode_intersection('State Hwy 121', 'Denton Tap', 'TX');*

Argh.

Aren

On Mon, Dec 19, 2011 at 8:54 PM, Aren Cambre  wrote:

> Here's the query I'm using:
> *SELECT * FROM geocode_intersection('SH 121', 'Denton Tap', 'TX',
> 'Coppell');*
>
> Aren
>
>
> On Mon, Dec 19, 2011 at 7:56 PM, Aren Cambre  wrote:
>
>> I am trying to find an intersection that includes a state highway. It's
>> TX 121 and Denton Tap Rd. in Coppell, TX. This corresponds to 
>> hereor
>> here(one
>>  is TX 121 main route and the other is TX 121 Business).
>>
>> I cannot figure out how to represent a state highway in the TIGER
>> geocoder. I've used all sorts of variants, like:
>>
>>- SH 121
>>- state highway 121
>>- TX 121
>>- Texas state highway 121
>>
>> etc.
>>
>> How are state highways represented in the DB? How can I check road name
>> representations for myself in the future?
>>
>> Aren
>>
>
>
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] How to look up state highways with geocoder?

2011-12-19 Thread Aren Cambre
Here's the query I'm using:
*SELECT * FROM geocode_intersection('SH 121', 'Denton Tap', 'TX',
'Coppell');*

Aren

On Mon, Dec 19, 2011 at 7:56 PM, Aren Cambre  wrote:

> I am trying to find an intersection that includes a state highway. It's TX
> 121 and Denton Tap Rd. in Coppell, TX. This corresponds to 
> hereor
> here(one
>  is TX 121 main route and the other is TX 121 Business).
>
> I cannot figure out how to represent a state highway in the TIGER
> geocoder. I've used all sorts of variants, like:
>
>- SH 121
>- state highway 121
>- TX 121
>- Texas state highway 121
>
> etc.
>
> How are state highways represented in the DB? How can I check road name
> representations for myself in the future?
>
> Aren
>
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


[postgis-users] How to look up state highways with geocoder?

2011-12-19 Thread Aren Cambre
I am trying to find an intersection that includes a state highway. It's TX
121 and Denton Tap Rd. in Coppell, TX. This corresponds to
hereor
here(one
is TX 121 main route and the other is TX 121 Business).

I cannot figure out how to represent a state highway in the TIGER geocoder.
I've used all sorts of variants, like:

   - SH 121
   - state highway 121
   - TX 121
   - Texas state highway 121

etc.

How are state highways represented in the DB? How can I check road name
representations for myself in the future?

Aren
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] DXF to Postgis using ogr

2011-12-19 Thread Guglielmo Raimondi
Hi Bob,
sorry for delay in answering.
Yes, Dxf2PostGis manage blocks like points and I don't plan (for the
moment) to develop extra code to do it in different way.
I'm not expert user of Org2org (I remember also a different name
"ogr2ogr") and I can't help you, sorry.
I can suggest you to explode blocks before use Dxf2PostGIS, if this is
compatible with your requirements.
In any case, good luck!
Please, tell me if you find a workaround to the trouble.
Guglielmo

2011/12/17 Bob Pawley :
> Hi Guglielmo
>
> I tried it a couple of weeks ago but it didn't import the block geometries
> nor the block text. It worked well with the non-block text and geometries.
>
> I've managed to, with Org2org, import the whole DXF file but for some reason
> it appears to turn the block text into linestrings.
>
> Bob
>
> -Original Message- From: Guglielmo Raimondi
> Sent: Saturday, December 17, 2011 1:26 AM
> To: PostGIS Users Discussion
> Subject: Re: [postgis-users] DXF to Postgis using ogr
>
>
> Have you try to use "dxf2postgis"?
> It's a tool for Windows environment that convert DXF files (R11 and
> R12 version) in SQL scripts for PostgreSQL+PostGIS.
> In detail, text are converted in points with special attibutes (text,
> size, rotation, font, etc.) that you can use to replay the AutoCad
> graphic aspect in a desktop GIS like QGis.
> This is a link:
>
> http://www.glasic.it/dxf2postgis.html
>
> Regards,
> Guglielmo Raimondi
>
> 2011/12/16 Bob Pawley :
>>
>> I have imported a dxf file into Postgis using the following command line -
>>
>> set DXF_INLINE_BLOCKS=FALSE&set DXF_MERGE_BLOCK_GEOMETRIES=FALSE&set
>> PGCLIENTENCODING=LATIN1&&ogr2ogr -f "PostgreSQL" PG:"host=localhost
>> user=postgres dbname=dbname password=pass"  W_Works.dxf -nln Import_PID
>> -overwrite –skipfailures
>>
>> All geometries are intact.
>>
>> However, the text is part of the Linestring layer and not in the text
>> column
>> of the Postgresql table.
>>
>> Is this to be expected?
>>
>> Is there some way of screening out the text as text and point geometry?
>>
>> Bob
>>
>>
>> ___
>> postgis-users mailing list
>> postgis-users@postgis.refractions.net
>> http://postgis.refractions.net/mailman/listinfo/postgis-users
>>
>
>
>
> --
> --
> Ing. Guglielmo R. Raimondi
> guglielmo.raimo...@gmail.com
>
> c/o MiPAAF - Ministero delle Politiche Agricole, Alimentari e Forestali
> Gestione Commissariale ex Agensud
> Via Venti Settembre 98/G
> 00187 Roma
> www.agensud.it
> tel.: (+39) 06 47 55
> 
> ___
> postgis-users mailing list
> postgis-users@postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
> ___
> postgis-users mailing list
> postgis-users@postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users



-- 
--
Ing. Guglielmo R. Raimondi
guglielmo.raimo...@gmail.com

c/o MiPAAF - Ministero delle Politiche Agricole, Alimentari e Forestali
Gestione Commissariale ex Agensud
Via Venti Settembre 98/G
00187 Roma
www.agensud.it
tel.: (+39) 06 47 55

___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] Is st_isvalidreason singular for any polygon, or can multiple errors be returned?

2011-12-19 Thread Sandro Santilli
On Mon, Dec 19, 2011 at 11:02:49PM +0800, Ben Madin wrote:

> Either way is fine, but maybe for now we could put a line into the 
> documentation to that effect:
> 
> "Note: By design only the first invalidity in a polygon is reported. After 
> correcting errors identified by st_isvalidreason it should be run again to 
> check that there are no further errors."

Sure, do you feel like producing a patch and attaching it to a ticket on
http://trac.osgeo.org/postgis ?

--strk;

  ,--o-. 
  |   __/  |Thank you for PostGIS-2.0 Topology !
  |  / 2.0 |http://www.pledgebank.com/postgistopology
  `-o--'

___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] Is st_isvalidreason singular for any polygon, or can multiple errors be returned?

2011-12-19 Thread Ben Madin
Thanks strk,

Either way is fine, but maybe for now we could put a line into the 
documentation to that effect:

"Note: By design only the first invalidity in a polygon is reported. After 
correcting errors identified by st_isvalidreason it should be run again to 
check that there are no further errors."

cheers

Ben

On 19/12/2011, at 9:52 PM, Sandro Santilli wrote:

> On Mon, Dec 19, 2011 at 09:20:09PM +0800, Ben Madin wrote:
> 
>> So my question is - when running st_isvalidreason does it just return
>> the first invalid problem it finds, or do I need a more sophisticated
>> query to return all the problem points? 
> 
> Only the first one. By design. It's being discussed on JTS list if this
> will change in the future. For now it is assumed that first invalidity
> would render later ones hard to detect.
> 
> --strk; 
> 
>  ,--o-. 
>  |   __/  |Thank you for PostGIS-2.0 Topology !
>  |  / 2.0 |http://www.pledgebank.com/postgistopology
>  `-o--'
> 
> ___
> postgis-users mailing list
> postgis-users@postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users

___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] merging dual carriageway motorway lines

2011-12-19 Thread Stephen V. Mather
You might also look to straight skeletons or voronoi polygons (medial axis
transform) to collapse dual lines, which would require R-stat e.g.
http://www.joeconway.com/plr/, unless someone has a script kicking around to
do it in pure postgis.

Some early work on the problem:
http://proceedings.esri.com/library/userconf/proc96/TO400/PAP370/P370.HTM
(mostly useful conceptually)

BTW, these techniques work really well for collapsing smooth lines, like
those made of human built infrastructure.  They do not work as well for
"bumpy" lines like rivers and such.  For these, some filtering is needed,
such as the scale axis transform
http://www.balintmiklos.com/scale-axis/algorithm_siggraph_2010.html.

Best,
Steve

Stephen Mather
Geographic Information Systems (GIS) Manager
(216) 635-3243
s...@clevelandmetroparks.com
clevelandmetroparks.com




-Original Message-
From: postgis-users-boun...@postgis.refractions.net
[mailto:postgis-users-boun...@postgis.refractions.net] On Behalf Of Stephen
Woodbridge
Sent: Monday, December 19, 2011 9:21 AM
To: postgis-users@postgis.refractions.net
Subject: Re: [postgis-users] merging dual carriageway motorway lines

On 12/19/2011 7:12 AM, Lauri Kajan wrote:
> Hi all,
>
> I have a road network loaded to PostGIS.
> Now I'm trying to find a way to merge parallel lines of a dual
> carriageway motorway to single a line?
> Or is there any?

Lauri,

I do not think there is any automated way to do this, but here are some 
thoughts on how you might be able to do this.

1. collect the dual carriageway segments based on a common attribute 
like name

2. for each segment, extract the points of the linestring and tag them 
with the segments uid, you also might want to generate extra points 
along this linestring and tag them with the segments uid also

3. for each point find the nearest point not on this segments uid, and 
probably not on a connected segment within some limit distance and 
insert a point that is the midpoint between the reference point and the 
nearest point into a combine_point table.

4. stringify the combined_point table by connecting nearest points 
within some limit distance.

Problems that you might encounter:

a. ramps backs that might get included by mistake.

b. loops or near loops like mountain switch that might confuse the stringify

c. combine carriageway does not follow mid-point path of dual carriage 
because not all segments were selected or there were not enough points 
generated along the original paths to compute the mid point path.

I have not tried to do this but it is how I would tackle the problem. 
Others might have some good ideas also.

Thanks,
   -Steve
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users



___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] merging dual carriageway motorway lines

2011-12-19 Thread Stephen Woodbridge

On 12/19/2011 7:12 AM, Lauri Kajan wrote:

Hi all,

I have a road network loaded to PostGIS.
Now I'm trying to find a way to merge parallel lines of a dual
carriageway motorway to single a line?
Or is there any?


Lauri,

I do not think there is any automated way to do this, but here are some 
thoughts on how you might be able to do this.


1. collect the dual carriageway segments based on a common attribute 
like name


2. for each segment, extract the points of the linestring and tag them 
with the segments uid, you also might want to generate extra points 
along this linestring and tag them with the segments uid also


3. for each point find the nearest point not on this segments uid, and 
probably not on a connected segment within some limit distance and 
insert a point that is the midpoint between the reference point and the 
nearest point into a combine_point table.


4. stringify the combined_point table by connecting nearest points 
within some limit distance.


Problems that you might encounter:

a. ramps backs that might get included by mistake.

b. loops or near loops like mountain switch that might confuse the stringify

c. combine carriageway does not follow mid-point path of dual carriage 
because not all segments were selected or there were not enough points 
generated along the original paths to compute the mid point path.


I have not tried to do this but it is how I would tackle the problem. 
Others might have some good ideas also.


Thanks,
  -Steve
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] Is st_isvalidreason singular for any polygon, or can multiple errors be returned?

2011-12-19 Thread Sandro Santilli
On Mon, Dec 19, 2011 at 09:20:09PM +0800, Ben Madin wrote:

> So my question is - when running st_isvalidreason does it just return
> the first invalid problem it finds, or do I need a more sophisticated
> query to return all the problem points? 

Only the first one. By design. It's being discussed on JTS list if this
will change in the future. For now it is assumed that first invalidity
would render later ones hard to detect.

--strk; 

  ,--o-. 
  |   __/  |Thank you for PostGIS-2.0 Topology !
  |  / 2.0 |http://www.pledgebank.com/postgistopology
  `-o--'

___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] BYTE_ORDER in SVN trunk on Solaris/i386

2011-12-19 Thread Sandro Santilli
On Mon, Dec 19, 2011 at 12:00:42PM +, Martin Spott wrote:

> Just by accident I stumbled over this one - apparently they're rolling
> their own:

We used to have our owh byte order detector as well. May still be
there (symbol getMachineEndian). Should do fine.

--strk;

  ,--o-. 
  |   __/  |Thank you for PostGIS-2.0 Topology !
  |  / 2.0 |http://www.pledgebank.com/postgistopology
  `-o--'

___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


[postgis-users] Is st_isvalidreason singular for any polygon, or can multiple errors be returned?

2011-12-19 Thread Ben Madin
I guess the answer to my question is in the question, but I've noticed that if 
I run a statement looking for not isvalid geometries, I get something like :

=#   SELECT gid, ccode, admin1, mapcode, st_mem_size(the_geom), 
st_isvalidreason(the_geom) FROM summ.polbnda WHERE st_isvalid(the_geom) IS 
FALSE ORDER BY 2, 3;
NOTICE:  Ring Self-intersection at or near point 123.055 10.9102
NOTICE:  Ring Self-intersection at or near point 121.007 5.68846
 gid | ccode |  admin1   | mapcode | st_mem_size |  
st_isvalidreason   
-+---+---+-+-+-
 120 | PHL   | NEGROS OCCIDENTAL |3592 |  105387 | Ring 
Self-intersection[123.054838 10.91023]
  84 | PHL   | SULU  |3556 |  212748 | Ring 
Self-intersection[121.007041 5.688462]
(2 rows)

at which time I zoom into the locations in QGIS and remove the offending part 
of the geometry.

After fixing the two, I run the same query, and 

 gid | ccode |  admin1   | mapcode | st_mem_size |   
st_isvalidreason   
-+---+---+-+-+--
 120 | PHL   | NEGROS OCCIDENTAL |3592 |  105339 | Ring 
Self-intersection[123.310249 10.960445]
(1 row)

So again I go in a repair, and so it goes - It ended up taking about 8 
iterations to fix everything.

So my question is - when running st_isvalidreason does it just return the first 
invalid problem it finds, or do I need a more sophisticated query to return all 
the problem points? My motivation is that re-running the query is taking a long 
time (it's a very high resolution set of geometries), so it would be great to 
get all of the offenders so I could work around each polygon once.

This in : POSTGIS="1.5.3" GEOS="3.3.1-CAPI-1.7.1" PROJ="Rel. 4.7.1, 23 
September 2009" LIBXML="2.7.3" USE_STATS

cheers

Ben


___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


[postgis-users] merging dual carriageway motorway lines

2011-12-19 Thread Lauri Kajan
Hi all,

I have a road network loaded to PostGIS.
Now I'm trying to find a way to merge parallel lines of a dual
carriageway motorway to single a line?
Or is there any?

-Lauri
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] BYTE_ORDER in SVN trunk on Solaris/i386

2011-12-19 Thread Martin Spott
Paul Ramsey wrote:
> On Fri, Dec 16, 2011 at 8:58 AM, Martin Spott  wrote:
>> Martin Spott wrote:
>>
>>> at least according to my experience, liblwgeom/lwout_wkb.c (and
>>> probably others as well, but I didn't check) is missing a declaration
>>> of BYTE_ORDER on Solaris platforms.
>>
>>   with GCC,

> Is that define in a different header on Solaris? Or just nonexistent?

As far as I can tell there's no such thing as BYTE_ORDER on Solaris (in
contrast to Linux, which has "endian.h") and it looks like all the
other tools in the chain (PostgreSQL, PROJ.4, GEOS, GDAL) don't make
any use of it.
There's "asm/byteorder.h" on both Linux and Solaris/i386, but I'm
uncertain if it's of any use here.  Neither Solaris/SPARC not AIX are
having either of them  ;-)

I just found out that I'm not the first to face this item  ;-)

  http://postgis.refractions.net/pipermail/postgis-devel/2011-May/013223.html

  but including "" doesn't help.

Just by accident I stumbled over this one - apparently they're rolling
their own:

  http://svn.apache.org/repos/asf/thrift/trunk/lib/py/src/protocol/fastbinary.c

Cheers,
Martin.
-- 
 Unix _IS_ user friendly - it's just selective about who its friends are !
--
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] Raster pixel value

2011-12-19 Thread Andreas Forø Tollefsen
I also as you see tried to divide on 3600 as that was the possible number
of pixel count per geometry polygon (foo2.gid).

Andreas

2011/12/19 Andreas Forø Tollefsen 

> Thanks Tom,
>
> I tried to select WHERE (ss).count > 0 and (ss).sum > 0, but i still got
> the same error. I assume that this is something that need to be changed in
> the script.
>
> I will do some more testing.
>
> Does anyone have an idea for something that could bypass this in my query?
>
> SELECT foo2.gid, (ss).sum / 3600 AS meanttime
> INTO accessgrid FROM (SELECT foo.gid, ST_SummaryStatsAgg(gv) ss
> FROM (SELECT p.gid, ST_Clip(r.rast, p.cell) gv FROM access r,
> priogrid_land p WHERE ST_Intersects(r.rast, p.cell)) foo
> GROUP BY foo.gid) foo2
> ORDER BY foo2.gid;
>
> Thanks!
>
> Andreas
>
> 2011/12/19 Tom van Tilburg 
>
>>  Yes, well found.
>>
>> I'm not familiar with plpgsql, but I'm sure it's easy to include some
>> conditional statement. Just check the postgres documentation.
>> You can also check if you can put the conditional into your SQL query
>> (something like 'WHERE count(rast) > 0') so that you don't feed empty
>> rasters to the function.
>>
>> all the best,
>>  Tom
>>
>>
>> On 19-12-2011 11:13, Andreas Forø Tollefsen wrote:
>>
>> Line 59 to 77 in the st_summarystatsagg.sql.
>> Could it be that line 69: ($1).sum / ($1).count leads to division by zero
>> error if ($1).count is 0?
>> How could i change this so this is not the case?
>>
>> -- raster_summarystatsfinal
>> -- Final function used by the ST_SummaryStatsAgg aggregate
>> CREATE OR REPLACE FUNCTION raster_summarystatsfinal(ss summarystats)
>> RETURNS summarystats
>> AS $$
>> DECLARE
>> ret summarystats;
>> BEGIN
>> ret := (($1).count,
>> ($1).sum,
>> ($1).sum / ($1).count,
>> null,
>> ($1).min,
>> ($1).max
>>)::summarystats;
>> RETURN ret;
>> END;
>> $$
>> LANGUAGE 'plpgsql';
>>
>> 2011/12/19 Andreas Forø Tollefsen 
>>
>>> Updated to latest trunk, and now it works.
>>> However, I ran into a new "division by zero" error. This halts the query.
>>> Could it be that something is divided by integer rather than decimal in
>>> the query, or what else causes this:
>>>
>>> ERROR:  division by zero
>>> CONTEXT:  PL/pgSQL function "raster_summarystatsfinal" line 5 at
>>> assignment
>>>
>>> ** Error **
>>>
>>> ERROR: division by zero
>>> SQL state: 22012
>>> Context: PL/pgSQL function "raster_summarystatsfinal" line 5 at
>>> assignment
>>>
>>> Best,
>>> Andreas
>>>
>>
>>
>> ___
>> postgis-users mailing list
>> postgis-users@postgis.refractions.net
>> http://postgis.refractions.net/mailman/listinfo/postgis-users
>>
>>
>
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] Raster pixel value

2011-12-19 Thread Andreas Forø Tollefsen
Thanks Tom,

I tried to select WHERE (ss).count > 0 and (ss).sum > 0, but i still got
the same error. I assume that this is something that need to be changed in
the script.
I will do some more testing.

Does anyone have an idea for something that could bypass this in my query?

SELECT foo2.gid, (ss).sum / 3600 AS meanttime
INTO accessgrid FROM (SELECT foo.gid, ST_SummaryStatsAgg(gv) ss
FROM (SELECT p.gid, ST_Clip(r.rast, p.cell) gv FROM access r,
priogrid_land p WHERE ST_Intersects(r.rast, p.cell)) foo
GROUP BY foo.gid) foo2
ORDER BY foo2.gid;

Thanks!

Andreas

2011/12/19 Tom van Tilburg 

>  Yes, well found.
>
> I'm not familiar with plpgsql, but I'm sure it's easy to include some
> conditional statement. Just check the postgres documentation.
> You can also check if you can put the conditional into your SQL query
> (something like 'WHERE count(rast) > 0') so that you don't feed empty
> rasters to the function.
>
> all the best,
>  Tom
>
>
> On 19-12-2011 11:13, Andreas Forø Tollefsen wrote:
>
> Line 59 to 77 in the st_summarystatsagg.sql.
> Could it be that line 69: ($1).sum / ($1).count leads to division by zero
> error if ($1).count is 0?
> How could i change this so this is not the case?
>
> -- raster_summarystatsfinal
> -- Final function used by the ST_SummaryStatsAgg aggregate
> CREATE OR REPLACE FUNCTION raster_summarystatsfinal(ss summarystats)
> RETURNS summarystats
> AS $$
> DECLARE
> ret summarystats;
> BEGIN
> ret := (($1).count,
> ($1).sum,
> ($1).sum / ($1).count,
> null,
> ($1).min,
> ($1).max
>)::summarystats;
> RETURN ret;
> END;
> $$
> LANGUAGE 'plpgsql';
>
> 2011/12/19 Andreas Forø Tollefsen 
>
>> Updated to latest trunk, and now it works.
>> However, I ran into a new "division by zero" error. This halts the query.
>> Could it be that something is divided by integer rather than decimal in
>> the query, or what else causes this:
>>
>> ERROR:  division by zero
>> CONTEXT:  PL/pgSQL function "raster_summarystatsfinal" line 5 at
>> assignment
>>
>> ** Error **
>>
>> ERROR: division by zero
>> SQL state: 22012
>> Context: PL/pgSQL function "raster_summarystatsfinal" line 5 at assignment
>>
>> Best,
>> Andreas
>>
>
>
> ___
> postgis-users mailing list
> postgis-users@postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
>
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] Raster pixel value

2011-12-19 Thread Tom van Tilburg

Yes, well found.

I'm not familiar with plpgsql, but I'm sure it's easy to include some 
conditional statement. Just check the postgres documentation.
You can also check if you can put the conditional into your SQL query 
(something like 'WHERE count(rast) > 0') so that you don't feed empty 
rasters to the function.


all the best,
 Tom

On 19-12-2011 11:13, Andreas Forø Tollefsen wrote:

Line 59 to 77 in the st_summarystatsagg.sql.
Could it be that line 69: ($1).sum / ($1).count leads to division by 
zero error if ($1).count is 0?

How could i change this so this is not the case?

-- raster_summarystatsfinal
-- Final function used by the ST_SummaryStatsAgg aggregate
CREATE OR REPLACE FUNCTION raster_summarystatsfinal(ss summarystats)
RETURNS summarystats
AS $$
DECLARE
ret summarystats;
BEGIN
ret := (($1).count,
($1).sum,
($1).sum / ($1).count,
null,
($1).min,
($1).max
   )::summarystats;
RETURN ret;
END;
$$
LANGUAGE 'plpgsql';

2011/12/19 Andreas Forø Tollefsen >


Updated to latest trunk, and now it works.
However, I ran into a new "division by zero" error. This halts the
query.
Could it be that something is divided by integer rather than
decimal in the query, or what else causes this:

ERROR:  division by zero
CONTEXT:  PL/pgSQL function "raster_summarystatsfinal" line 5 at
assignment

** Error **

ERROR: division by zero
SQL state: 22012
Context: PL/pgSQL function "raster_summarystatsfinal" line 5 at
assignment

Best,
Andreas



___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] Raster pixel value

2011-12-19 Thread Tom van Tilburg
Divisions by zero shouldn't happen as far as I know, at most it should 
give you null data as return.


Sounds like a bug.
Perhaps you can check:
http://trac.osgeo.org/postgis/browser/trunk/raster/scripts/plpgsql/st_summarystatsagg.sql

at line 69 it says: "($1).sum / ($1).count"
my guess is that that's where the division by 0 happens.
(it means probably that there is an empty raster somewhere in your 
results that consequently leads to count() = 0 )


You can find the same code in your database functions ofcourse.

Good luck!
 Tom

On 19-12-2011 10:53, Andreas Forø Tollefsen wrote:

Updated to latest trunk, and now it works.
However, I ran into a new "division by zero" error. This halts the query.
Could it be that something is divided by integer rather than decimal 
in the query, or what else causes this:


ERROR:  division by zero
CONTEXT:  PL/pgSQL function "raster_summarystatsfinal" line 5 at 
assignment


** Error **

ERROR: division by zero
SQL state: 22012
Context: PL/pgSQL function "raster_summarystatsfinal" line 5 at assignment

Best,
Andreas


___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] Raster pixel value

2011-12-19 Thread Andreas Forø Tollefsen
Line 59 to 77 in the st_summarystatsagg.sql.
Could it be that line 69: ($1).sum / ($1).count leads to division by zero
error if ($1).count is 0?
How could i change this so this is not the case?

-- raster_summarystatsfinal
-- Final function used by the ST_SummaryStatsAgg aggregate
CREATE OR REPLACE FUNCTION raster_summarystatsfinal(ss summarystats)
RETURNS summarystats
AS $$
DECLARE
ret summarystats;
BEGIN
ret := (($1).count,
($1).sum,
($1).sum / ($1).count,
null,
($1).min,
($1).max
   )::summarystats;
RETURN ret;
END;
$$
LANGUAGE 'plpgsql';

2011/12/19 Andreas Forø Tollefsen 

> Updated to latest trunk, and now it works.
> However, I ran into a new "division by zero" error. This halts the query.
> Could it be that something is divided by integer rather than decimal in
> the query, or what else causes this:
>
> ERROR:  division by zero
> CONTEXT:  PL/pgSQL function "raster_summarystatsfinal" line 5 at assignment
>
> ** Error **
>
> ERROR: division by zero
> SQL state: 22012
> Context: PL/pgSQL function "raster_summarystatsfinal" line 5 at assignment
>
> Best,
> Andreas
>
>
> 2011/12/19 Tom van Tilburg 
>
>>  Andreas,
>>
>> If you got the latest ST_Clip from the repository, I found this
>> information with it:
>>
>>  "Addition of C-based ST_MinPossibleValue to replace the existing
>> ST_MinPossibleVal which uses hard-coded values. Updated dependent functions
>> and scripts/plpgsql to use new function. Deleted
>> scripts/plpgsql/st_minpossibleval.sql to stop people from using it.
>> Associated ticket is #1298 ."
>>
>> Probably this means you need the very newest version of rtpostgis with
>> the minpossiblevalue included in C. Not sure wheter is available for
>> windows yet.
>> At the moment I don't have time to test but I have the feeling this new
>> function in C might make things quicker and perhaps fix the error with
>> nodata values I mentioned earlier. Let me know.
>>
>> Regards,
>>  Tom
>>
>>
>> On 19-12-2011 10:01, Andreas Forø Tollefsen wrote:
>>
>> Hi Tom,
>>
>> I tried both functions. The St_AreaWeightedSummaryStats() works great,
>> but it takes a lot of time to complete.
>>
>> However, the ST_Clip() i cannot manage to get working. Seems like
>> something is broken. Any idea what can cause this error?
>> I installed the latest ST_SummaryStatsAgg() and ST_Clip() from
>> http://trac.osgeo.org/postgis/browser/trunk/raster/scripts/plpgsql
>>
>> The query:
>> SELECT foo2.gid,
>> (ss).count,
>>   (ss).sum,
>>   (ss).mean,
>>   (ss).min,
>>   (ss).max
>> FROM
>> (SELECT foo.gid, ST_SummaryStatsAgg(gv) ss
>>  FROM (SELECT p.gid, ST_Clip(r.rast, p.cell) gv
>>FROM access r, priogrid_land p
>>WHERE ST_Intersects(r.rast, p.cell)
>>   ) foo
>>  GROUP BY foo.gid
>> ) foo2
>>
>> Results in:
>>
>> ERROR:  function st_minpossiblevalue(text) does not exist
>> LINE 1: ...esce(nodata, ST_BandNodataValue(rast, bandstart), ST_MinPoss...
>>  ^
>> HINT:  No function matches the given name and argument types. You might
>> need to add explicit type casts.
>> QUERY:  SELECT coalesce(nodata, ST_BandNodataValue(rast, bandstart),
>> ST_MinPossibleValue(newpixtype))
>> CONTEXT:  PL/pgSQL function "st_clip" line 31 at assignment
>>
>> ** Error **
>>
>> ERROR: function st_minpossiblevalue(text) does not exist
>> SQL state: 42883
>> Hint: No function matches the given name and argument types. You might
>> need to add explicit type casts.
>> Context: PL/pgSQL function "st_clip" line 31 at assignment
>>
>>
>>
>>  2011/12/6 Tom van Tilburg 
>>
>>>  Andreas,
>>>
>>> I didn't have time to reproduce your problem yet. Did you have any
>>> succes by yourself on this issue?
>>> Could it have something to do with counting the non-data values as
>>> value? This is what I experience with a similar function (ST_Clip) that
>>> consequently gave me the value '0' instead of the nodata value. The result
>>> of that is that the mean was often lower than expected.
>>>
>>> Perhaps you could rewrite your previous example to something with
>>> auto-generated values in the script. That saves time in reproducing.
>>>
>>> Cheers,
>>>   Tom
>>>
>>>
>>>
>>> On 25-11-2011 18:11, Andreas Forø Tollefsen wrote:
>>>
>>>  Update:
>>>
>>>  I think my suspicion is correct. If I do a ST_Summarystats().sum and
>>> divide this on 36 my MAX value will be 1.
>>> Hence, I think the number of values counted and the number of
>>> observations counted is not equal.
>>>
>>>  New query:
>>>  DROP TABLE IF EXISTS mountain_phil_cell;
>>>
>>>  SELECT
>>> a.gid As gid,
>>> (ST_SummaryStats((ST_Union(ST_MapAlgebraExpr(ST_AsRaster(a.cell, b.rast,
>>> '32BF'), b.rast, 'rast2', '32BF','INTERSECTION','0','0',0))).rast,
>>> false)).sum / 36 As avgmnt
>>

Re: [postgis-users] Raster pixel value

2011-12-19 Thread Andreas Forø Tollefsen
Updated to latest trunk, and now it works.
However, I ran into a new "division by zero" error. This halts the query.
Could it be that something is divided by integer rather than decimal in the
query, or what else causes this:

ERROR:  division by zero
CONTEXT:  PL/pgSQL function "raster_summarystatsfinal" line 5 at assignment

** Error **

ERROR: division by zero
SQL state: 22012
Context: PL/pgSQL function "raster_summarystatsfinal" line 5 at assignment

Best,
Andreas

2011/12/19 Tom van Tilburg 

>  Andreas,
>
> If you got the latest ST_Clip from the repository, I found this
> information with it:
>
>  "Addition of C-based ST_MinPossibleValue to replace the existing
> ST_MinPossibleVal which uses hard-coded values. Updated dependent functions
> and scripts/plpgsql to use new function. Deleted
> scripts/plpgsql/st_minpossibleval.sql to stop people from using it.
> Associated ticket is #1298 ."
>
> Probably this means you need the very newest version of rtpostgis with the
> minpossiblevalue included in C. Not sure wheter is available for windows
> yet.
> At the moment I don't have time to test but I have the feeling this new
> function in C might make things quicker and perhaps fix the error with
> nodata values I mentioned earlier. Let me know.
>
> Regards,
>  Tom
>
>
> On 19-12-2011 10:01, Andreas Forø Tollefsen wrote:
>
> Hi Tom,
>
> I tried both functions. The St_AreaWeightedSummaryStats() works great, but
> it takes a lot of time to complete.
>
> However, the ST_Clip() i cannot manage to get working. Seems like
> something is broken. Any idea what can cause this error?
> I installed the latest ST_SummaryStatsAgg() and ST_Clip() from
> http://trac.osgeo.org/postgis/browser/trunk/raster/scripts/plpgsql
>
> The query:
> SELECT foo2.gid,
> (ss).count,
>   (ss).sum,
>   (ss).mean,
>   (ss).min,
>   (ss).max
> FROM
> (SELECT foo.gid, ST_SummaryStatsAgg(gv) ss
>  FROM (SELECT p.gid, ST_Clip(r.rast, p.cell) gv
>FROM access r, priogrid_land p
>WHERE ST_Intersects(r.rast, p.cell)
>   ) foo
>  GROUP BY foo.gid
> ) foo2
>
> Results in:
>
> ERROR:  function st_minpossiblevalue(text) does not exist
> LINE 1: ...esce(nodata, ST_BandNodataValue(rast, bandstart), ST_MinPoss...
>  ^
> HINT:  No function matches the given name and argument types. You might
> need to add explicit type casts.
> QUERY:  SELECT coalesce(nodata, ST_BandNodataValue(rast, bandstart),
> ST_MinPossibleValue(newpixtype))
> CONTEXT:  PL/pgSQL function "st_clip" line 31 at assignment
>
> ** Error **
>
> ERROR: function st_minpossiblevalue(text) does not exist
> SQL state: 42883
> Hint: No function matches the given name and argument types. You might
> need to add explicit type casts.
> Context: PL/pgSQL function "st_clip" line 31 at assignment
>
>
>
>  2011/12/6 Tom van Tilburg 
>
>>  Andreas,
>>
>> I didn't have time to reproduce your problem yet. Did you have any succes
>> by yourself on this issue?
>> Could it have something to do with counting the non-data values as value?
>> This is what I experience with a similar function (ST_Clip) that
>> consequently gave me the value '0' instead of the nodata value. The result
>> of that is that the mean was often lower than expected.
>>
>> Perhaps you could rewrite your previous example to something with
>> auto-generated values in the script. That saves time in reproducing.
>>
>> Cheers,
>>   Tom
>>
>>
>>
>> On 25-11-2011 18:11, Andreas Forø Tollefsen wrote:
>>
>>  Update:
>>
>>  I think my suspicion is correct. If I do a ST_Summarystats().sum and
>> divide this on 36 my MAX value will be 1.
>> Hence, I think the number of values counted and the number of
>> observations counted is not equal.
>>
>>  New query:
>>  DROP TABLE IF EXISTS mountain_phil_cell;
>>
>>  SELECT
>> a.gid As gid,
>> (ST_SummaryStats((ST_Union(ST_MapAlgebraExpr(ST_AsRaster(a.cell, b.rast,
>> '32BF'), b.rast, 'rast2', '32BF','INTERSECTION','0','0',0))).rast,
>> false)).sum / 36 As avgmnt
>> INTO mountain_phil_cell
>> FROM
>> priogrid_land a LEFT JOIN
>> mountain_phil b
>> ON ST_Intersects(a.cell, b.rast)
>> GROUP BY a.gid
>> ORDER BY a.gid;
>>
>>
>> 2011/11/25 Andreas Forø Tollefsen 
>>
>>> A small note regarding this issue.
>>>
>>>  My problem is that I never get a mean value of 1 even if all pixels
>>> inside the geometry is one.
>>>
>>>  Could this be because: 6x6 pixels goes into one polygon when visually
>>> controlling. If each pixel has the value 1, then this will be calculated as
>>> 36 / 36 = 1. However, if it calculates the sum to be 36 and divide by a
>>> number higher than 36 pixels, then the result will always be below 1.
>>> What i am thinking is that while it sums up the pixel values correctly,
>>> it does not count only the 36 pixels, but also neighboring pixels.
>>> Therefore: 1+1+1+1...n36 / Number of pixels higher than 3

Re: [postgis-users] Raster pixel value

2011-12-19 Thread Tom van Tilburg

Andreas,

If you got the latest ST_Clip from the repository, I found this 
information with it:


"Addition of C-based ST_MinPossibleValue to replace the existing 
ST_MinPossibleVal which uses hard-coded values. Updated dependent 
functions and scripts/plpgsql to use new function. Deleted 
scripts/plpgsql/st_minpossibleval.sql to stop people from using it. 
Associated ticket is #1298 ."



Probably this means you need the very newest version of rtpostgis with 
the minpossiblevalue included in C. Not sure wheter is available for 
windows yet.
At the moment I don't have time to test but I have the feeling this new 
function in C might make things quicker and perhaps fix the error with 
nodata values I mentioned earlier. Let me know.


Regards,
 Tom

On 19-12-2011 10:01, Andreas Forø Tollefsen wrote:

Hi Tom,

I tried both functions. The St_AreaWeightedSummaryStats() works great, 
but it takes a lot of time to complete.


However, the ST_Clip() i cannot manage to get working. Seems like 
something is broken. Any idea what can cause this error?
I installed the latest ST_SummaryStatsAgg() and ST_Clip() from 
http://trac.osgeo.org/postgis/browser/trunk/raster/scripts/plpgsql


The query:
SELECT foo2.gid,
(ss).count,
  (ss).sum,
  (ss).mean,
  (ss).min,
  (ss).max
FROM
(SELECT foo.gid, ST_SummaryStatsAgg(gv) ss
 FROM (SELECT p.gid, ST_Clip(r.rast, p.cell) gv
   FROM access r, priogrid_land p
   WHERE ST_Intersects(r.rast, p.cell)
  ) foo
 GROUP BY foo.gid
) foo2

Results in:

ERROR:  function st_minpossiblevalue(text) does not exist
LINE 1: ...esce(nodata, ST_BandNodataValue(rast, bandstart), ST_MinPoss...
 ^
HINT:  No function matches the given name and argument types. You 
might need to add explicit type casts.
QUERY:  SELECT coalesce(nodata, ST_BandNodataValue(rast, bandstart), 
ST_MinPossibleValue(newpixtype))

CONTEXT:  PL/pgSQL function "st_clip" line 31 at assignment

** Error **

ERROR: function st_minpossiblevalue(text) does not exist
SQL state: 42883
Hint: No function matches the given name and argument types. You might 
need to add explicit type casts.

Context: PL/pgSQL function "st_clip" line 31 at assignment



2011/12/6 Tom van Tilburg >


Andreas,

I didn't have time to reproduce your problem yet. Did you have any
succes by yourself on this issue?
Could it have something to do with counting the non-data values as
value? This is what I experience with a similar function (ST_Clip)
that consequently gave me the value '0' instead of the nodata
value. The result of that is that the mean was often lower than
expected.

Perhaps you could rewrite your previous example to something with
auto-generated values in the script. That saves time in reproducing.

Cheers,
 Tom



On 25-11-2011 18:11, Andreas Forø Tollefsen wrote:

Update:

I think my suspicion is correct. If I do a ST_Summarystats().sum
and divide this on 36 my MAX value will be 1.
Hence, I think the number of values counted and the number of
observations counted is not equal.

New query:
DROP TABLE IF EXISTS mountain_phil_cell;

SELECT
a.gid As gid,
(ST_SummaryStats((ST_Union(ST_MapAlgebraExpr(ST_AsRaster(a.cell,
b.rast, '32BF'), b.rast, 'rast2',
'32BF','INTERSECTION','0','0',0))).rast, false)).sum / 36 As avgmnt
INTO mountain_phil_cell
FROM
priogrid_land a LEFT JOIN
mountain_phil b
ON ST_Intersects(a.cell, b.rast)
GROUP BY a.gid
ORDER BY a.gid;


2011/11/25 Andreas Forø Tollefsen mailto:andrea...@gmail.com>>

A small note regarding this issue.

My problem is that I never get a mean value of 1 even if all
pixels inside the geometry is one.

Could this be because: 6x6 pixels goes into one polygon when
visually controlling. If each pixel has the value 1, then
this will be calculated as 36 / 36 = 1. However, if it
calculates the sum to be 36 and divide by a number higher
than 36 pixels, then the result will always be below 1.
What i am thinking is that while it sums up the pixel values
correctly, it does not count only the 36 pixels, but also
neighboring pixels. Therefore: 1+1+1+1...n36 / Number of
pixels higher than 36 will always lead to a number lower than 1.

Anyone who knows the functions well could probably answer this.

Best regards,
Andreas


2011/11/25 Andreas Forø Tollefsen mailto:andrea...@gmail.com>>

Could this have to do with the tiling of the raster?
I will try to run the same query with a untiled mountain
raster to see if that changes anything.

Btw. When loading a tiled postgis raster into qgis it
shows up with ma

Re: [postgis-users] Raster pixel value

2011-12-19 Thread Andreas Forø Tollefsen
Hi Tom,

I tried both functions. The St_AreaWeightedSummaryStats() works great, but
it takes a lot of time to complete.

However, the ST_Clip() i cannot manage to get working. Seems like something
is broken. Any idea what can cause this error?
I installed the latest ST_SummaryStatsAgg() and ST_Clip() from
http://trac.osgeo.org/postgis/browser/trunk/raster/scripts/plpgsql

The query:
SELECT foo2.gid,
(ss).count,
  (ss).sum,
  (ss).mean,
  (ss).min,
  (ss).max
FROM
(SELECT foo.gid, ST_SummaryStatsAgg(gv) ss
 FROM (SELECT p.gid, ST_Clip(r.rast, p.cell) gv
   FROM access r, priogrid_land p
   WHERE ST_Intersects(r.rast, p.cell)
  ) foo
 GROUP BY foo.gid
) foo2

Results in:

ERROR:  function st_minpossiblevalue(text) does not exist
LINE 1: ...esce(nodata, ST_BandNodataValue(rast, bandstart), ST_MinPoss...
 ^
HINT:  No function matches the given name and argument types. You might
need to add explicit type casts.
QUERY:  SELECT coalesce(nodata, ST_BandNodataValue(rast, bandstart),
ST_MinPossibleValue(newpixtype))
CONTEXT:  PL/pgSQL function "st_clip" line 31 at assignment

** Error **

ERROR: function st_minpossiblevalue(text) does not exist
SQL state: 42883
Hint: No function matches the given name and argument types. You might need
to add explicit type casts.
Context: PL/pgSQL function "st_clip" line 31 at assignment



2011/12/6 Tom van Tilburg 

>  Andreas,
>
> I didn't have time to reproduce your problem yet. Did you have any succes
> by yourself on this issue?
> Could it have something to do with counting the non-data values as value?
> This is what I experience with a similar function (ST_Clip) that
> consequently gave me the value '0' instead of the nodata value. The result
> of that is that the mean was often lower than expected.
>
> Perhaps you could rewrite your previous example to something with
> auto-generated values in the script. That saves time in reproducing.
>
> Cheers,
>  Tom
>
>
>
> On 25-11-2011 18:11, Andreas Forø Tollefsen wrote:
>
> Update:
>
>  I think my suspicion is correct. If I do a ST_Summarystats().sum and
> divide this on 36 my MAX value will be 1.
> Hence, I think the number of values counted and the number of observations
> counted is not equal.
>
>  New query:
>  DROP TABLE IF EXISTS mountain_phil_cell;
>
>  SELECT
> a.gid As gid,
> (ST_SummaryStats((ST_Union(ST_MapAlgebraExpr(ST_AsRaster(a.cell, b.rast,
> '32BF'), b.rast, 'rast2', '32BF','INTERSECTION','0','0',0))).rast,
> false)).sum / 36 As avgmnt
> INTO mountain_phil_cell
> FROM
> priogrid_land a LEFT JOIN
> mountain_phil b
> ON ST_Intersects(a.cell, b.rast)
> GROUP BY a.gid
> ORDER BY a.gid;
>
>
> 2011/11/25 Andreas Forø Tollefsen 
>
>> A small note regarding this issue.
>>
>>  My problem is that I never get a mean value of 1 even if all pixels
>> inside the geometry is one.
>>
>>  Could this be because: 6x6 pixels goes into one polygon when visually
>> controlling. If each pixel has the value 1, then this will be calculated as
>> 36 / 36 = 1. However, if it calculates the sum to be 36 and divide by a
>> number higher than 36 pixels, then the result will always be below 1.
>> What i am thinking is that while it sums up the pixel values correctly,
>> it does not count only the 36 pixels, but also neighboring pixels.
>> Therefore: 1+1+1+1...n36 / Number of pixels higher than 36 will always lead
>> to a number lower than 1.
>>
>>  Anyone who knows the functions well could probably answer this.
>>
>>  Best regards,
>>  Andreas
>>
>>
>> 2011/11/25 Andreas Forø Tollefsen 
>>
>>> Could this have to do with the tiling of the raster?
>>> I will try to run the same query with a untiled mountain raster to see
>>> if that changes anything.
>>>
>>>  Btw. When loading a tiled postgis raster into qgis it shows up with
>>> many artifacts and no data areas. The same raster untiled does not show up
>>> the same way.
>>> Qgis bug?
>>>
>>>  Andreas
>>>
>>> 2011/11/25 Andreas Forø Tollefsen 
>>>
  Hi,

  Thanks for all of the suggestions. I will do some more testing.
 However, as for suggestion 1 i think the pixel size should be the same as
 the original raster or am I wrong?

  Both the mean_mnt_bin raster and the priogrid_land shapefile can be
 downloaded as zip (2 mb) here:
 http://gisintersect.com/mean_mnt_bin.zip
 http://gisintersect.com/priogrid_land.zip

  Any help on getting the correct values would be very much appreciated.

  My query:
  DROP TABLE IF EXISTS mountain_cell;

  SELECT
 a.gid As id,
 (ST_SummaryStats((ST_Union(ST_MapAlgebraExpr(ST_AsRaster(a.cell,
 b.rast, '32BF'), b.rast, 'rast2', '32BF','INTERSECTION','0','0',0))).rast,
 false)).mean As avgmnt
 INTO mountain_cell
 FROM
 priogrid_land a LEFT JOIN
 mountain b
 ON ST_Intersects(a.cell, b.rast)
 GROUP BY a.gid
 ORDER BY a.gid;
>>

Re: [postgis-users] No liblwgeom after install

2011-12-19 Thread Sandro Santilli
On Sun, Dec 18, 2011 at 05:28:36PM -0800, Paul Ramsey wrote:
> On Thu, Dec 15, 2011 at 4:19 AM, Sandro Santilli  wrote:
> > On Thu, Dec 15, 2011 at 11:53:38AM +0100, Hentschel, Markus wrote:
> >>
> >> fgs install postgis-lib:1.5.0 /home/fgs
> >> 
> >> But now there is no liblwgeom in fgs lib directory. Any hints? I'm using 
> >> the latest FGS 9.5.
> >
> > What is FGS ?
>
> http://www.maptools.org/fgs/index.phtml?page=install.html

Then maybe the right place for this is:
http://www.maptools.org/fgs/index.phtml?page=bugs.html

But thinking about it, PostGIS 1.5.0 didn't install liblwgeom,
why are you expecting to find it ?

--strk;

  ,--o-. 
  |   __/  |Thank you for PostGIS-2.0 Topology !
  |  / 2.0 |http://www.pledgebank.com/postgistopology
  `-o--'

___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users