Re: [postgis-users] Basic postgis raster questions

2011-06-15 Thread Bryce L Nordgren
postgis-users-boun...@postgis.refractions.net wrote on 06/15/2011 07:49:15 
PM:

> I totally agree but a wrapper would be convenient for people not 
> familiar with intersection operations on raster. Most are familiar 
> with vector/vector intersections on but not with raster/raster ones.

I'm not against wrappers, particularly if the documentation makes it clear 
what the wrapper is wrapping. Wrappers+documentation can be used as a 
learning tool to show how the raster/raster operations are really the same 
thing as the corresponding vector/vector operation.

BTW: I posted this to the devel list, but anyone on the users list 
interested is also welcome to review and criticize my "philosophy" on 
homogeneous vector/raster operations. This is mostly for my own benefit to 
try and wrap my head around the big picture by teasing out the fundamental 
issues.

https://collab.firelab.org/software/projects/modisfire/wiki/Spatial_Set_Operations_in_PostGIS_Raster

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


Re: [postgis-users] QGIS - PostGIS - ArcGIS Interaction

2011-06-15 Thread David Fawcett
James,

There a couple of SQL plugins for QGIS.  They allow you to visualize
spatial features via 'ad hoc' queries (not whole tables).

I am pretty sure that I used the RT_SQL plugin.  Here is a link to
some info:  
http://underdark.wordpress.com/2010/10/16/visualizing-postgis-queries-in-qgis-using-rt-sql-layer-plugin/

No need to buy a $10,000 proprietary desktop GIS...

David.

On Wed, Jun 15, 2011 at 1:33 PM, James David Smith
 wrote:
> Dear Cristian & David,
>
> Thanks alot for your responses.
>
> Cristian - I don't have money to buy additional software
> unfortunately. With regard to 'view' I actually don't know what this
> is. I'm a bit of a beginner. I wonder if I made a 'view' whether I
> could then query that view with QGIS. Something for me to look into...
>
> David - That looks like a good idea... but when adding data to QGIS
> you can only select the whole table (I think) and then you manually
> enter the 'WHERE' clause in a dialog box. I guess I could run the
> query you suggest in PostgreSQL and save it into another table... and
> then link QGIS to the new table. Though it all starts to get a bit
> convoluted if I have to do that every time I want to look at some data
> in QGIS...
>
> Cheers
>
> James
>
>
>
> On 15 June 2011 19:16, David Fawcett  wrote:
>> This is what is really cool about using a database to store your data...
>>
>> Change your query to:
>>
>> SELECT mycol1,
>>             mycol2,
>>             date_time_of_arrival as dt_arrive,
>>             date_time_of_departure as dt_depart,
>>              the_geom
>> FROM incidents
>> WHERE urgency = 'Immediate'
>> AND date_time_of_arrival - date_time_unit_assigned > '00:12:00'
>>
>> Note: you will need to specify the names of the columns that you are
>> interested in.
>>
>>
>> On Wed, Jun 15, 2011 at 12:58 PM, James David Smith
>>  wrote:
>>> Dear all,
>>>
>>> I appreciate that this is more of a QGIS query, but I think that the
>>> route of the problem might be in PostGIS, so... I have opened QGIS and
>>> ran the query on my PostGIS table as below:
>>>
>>> SELECT * FROM incidents
>>> WHERE urgency = 'Immediate'
>>> AND date_time_of_arrival - date_time_unit_assigned > '00:12:00'
>>>
>>> This gives me 33 points in QGIS. Great. I would now however like to
>>> save this as a ShapeFile for use in ArcGIS with which I am more
>>> familiar, but when I try to SAVE AS from QGIS I am given the following
>>> error
>>>
>>> Export to vector file failed.
>>> Error: trimming attribute name 'date_time_of_arrival' to ten
>>> significant characters produces duplicate column name.
>>>
>>> I am guessing that the problem here is that ESRI shapefiles can only
>>> deal with column names that are ten characters long...? And that as I
>>> also have a column called 'date_time_of_departure', when QGIS trims
>>> this column it ends up with two columns called the same thing?  Is
>>> there a way around this? I realise I could rename the column in QGIS,
>>> but I actually have around 45 columns in the table and this problem
>>> will occur with about 15 pairs of them I think. I guess there is no
>>> simple answer... but thought I'd ask.
>>>
>>> Cheers
>>>
>>> James
>>> ___
>>> 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
>>
> ___
> 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] Basic postgis raster questions

2011-06-15 Thread Pierre Racine
An of course: ST_Union()... But if we get an efficient ST_MapAlgebra(raster, 
raster) I'll do it for you in one day :-)

> -Original Message-
> From: postgis-users-boun...@postgis.refractions.net [mailto:postgis-users-
> boun...@postgis.refractions.net] On Behalf Of Pierre Racine
> Sent: Wednesday, June 15, 2011 3:49 PM
> To: PostGIS Users Discussion
> Subject: Re: [postgis-users] Basic postgis raster questions
> 
> I totally agree but a wrapper would be convenient for people not familiar with
> intersection operations on raster. Most are familiar with vector/vector
> intersections on but not with raster/raster ones. So let's inverse 4) and 5) 
> in my
> previous mail.
> 
> I think the only real major missing pieces are:
> 
> 1) ST_AsRaster(geometry)
> 
> 2) ST_Resample(raster)
> 
> 3) ST_MapAlgebra(raster, raster)
> 
> And then the things we can not do with them.
> 
> Pierre
> 
> > -Original Message-
> > From: postgis-users-boun...@postgis.refractions.net
> > [mailto:postgis-users- boun...@postgis.refractions.net] On Behalf Of
> > Bryce L Nordgren
> > Sent: Wednesday, June 15, 2011 3:38 PM
> > To: PostGIS Users Discussion
> > Subject: Re: [postgis-users] Basic postgis raster questions
> >
> >
> >
> > postgis-users-boun...@postgis.refractions.net wrote on 06/15/2011
> > 07:02:46
> > PM:
> >
> > > > 4. ST_Clip(raster, geometry)
> >
> > If ST_Intersection(raster, geometry) returns a raster having the
> > original pixel values inside the geometry, and nodata outside the
> > geometry, I'm not sure I see the need for a separate "clip" function.
> Semantically and mathematically, "clip"
> > is "intersection": area common to both arguments.
> >
> > Bryce
> ___
> 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] QGIS - PostGIS - ArcGIS Interaction

2011-06-15 Thread Bborie Park

Regina,

I'm doing this against my production PostGIS 1.5 server.

-bborie

On 06/15/2011 12:18 PM, Paragon Corporation wrote:

Bborie,

Does this work for any version of PostGIS or only ESRI sanctioned PostGIS
1.4?

Thanks,
Regina
http://www.postgis.us


-Original Message-
From: postgis-users-boun...@postgis.refractions.net
[mailto:postgis-users-boun...@postgis.refractions.net] On Behalf Of Bborie
Park
Sent: Wednesday, June 15, 2011 3:10 PM
To: doug_newc...@fws.gov
Cc: postgis-users@postgis.refractions.net
Subject: Re: [postgis-users] QGIS - PostGIS - ArcGIS Interaction

Hey Doug,

ArcMap 10 brought "read-only" access to PostGIS without the need for ArcSDE
or any other extensions.  To do so...

1. Click on File>  Add Data>  Add Query Layer...

2. In the "New Query Layer" window that appears, click on the
"Connections..." button to add a new connection.  Unless you have existing
connnections, click on "New..." in the "Manage Connection(s)"
window.

3. In the "Database Connection" window, select "postgresql" for the DBMS
client, provide your database server IP (or domain name) in "Data Source"
and fill out "Database" with the name of the database you're connecting to.
If need be, add the appropriate authentication information.  For PostgreSQL,
you'll select "Database Authentication"
for Authentication.  Feel free to test your settings with "Test Connection".

4. Once satisfied, click "OK" to close the "Database Connection" window.

5. By now, you should have an entry in the "Manage Connection(s)" window so
click "OK" if you're satisfied.

6. You should be back in "New Query Layer" and the connection you just
created may have already been selected for "Connection".  If not, select the
appropriate connection.  It takes a few seconds for the connection to be
established and the program to retrieve the schema of the database.

7. I usually skip clicking on the "List of Tables" and "Columns" tools as
ArcGIS still doesn't work with 64-bit datatypes (double, bigint,
text???) and go directly to the "Name" and "Query" elements on the window.
Just provide a value for "Name" as that value will be the layer name and use
any valid SQL SELECT statement in the "Query" field.

8. You can click on "Validate" to make sure your query is valid.  Once,
satisfied, click on "Finish"

That's it.

-bborie

On 06/15/2011 11:53 AM, doug_newc...@fws.gov wrote:


bborie,
I would like details on this procedure.  Does it require the
interoperability extension? Ziggis?

Doug

Doug Newcomb
USFWS
Raleigh, NC
919-856-4520 ext. 14 doug_newc...@fws.gov
--
---

The opinions I express are my own and are not representative of the
official policy of the U.S.Fish and Wildlife Service or Dept. of the
Interior.   Life is too short for undocumented, proprietary data formats.

-postgis-users-boun...@postgis.refractions.net wrote: -

To: postgis-users@postgis.refractions.net
From: Bborie Park
Sent by: postgis-users-boun...@postgis.refractions.net
Date: 06/15/2011 06:47PM
Subject: Re: [postgis-users] QGIS - PostGIS - ArcGIS Interaction

James,

If you have ArcGIS 10, you can directly write SELECT queries from
ArcMap to PostGIS.  That's how I visualize my data when I'm running

Windows.


-bborie

On 06/15/2011 10:58 AM, James David Smith wrote:

Dear all,

I appreciate that this is more of a QGIS query, but I think that the
route of the problem might be in PostGIS, so... I have opened QGIS
and ran the query on my PostGIS table as below:

SELECT * FROM incidents
WHERE urgency = 'Immediate'
AND date_time_of_arrival - date_time_unit_assigned> '00:12:00'

This gives me 33 points in QGIS. Great. I would now however like to
save this as a ShapeFile for use in ArcGIS with which I am more
familiar, but when I try to SAVE AS from QGIS I am given the
following error

Export to vector file failed.
Error: trimming attribute name 'date_time_of_arrival' to ten
significant characters produces duplicate column name.

I am guessing that the problem here is that ESRI shapefiles can only
deal with column names that are ten characters long...? And that as I
also have a column called 'date_time_of_departure', when QGIS trims
this column it ends up with two columns called the same thing?  Is
there a way around this? I realise I could rename the column in QGIS,
but I actually have around 45 columns in the table and this problem
will occur with about 15 pairs of them I think. I guess there is no
simple answer... but thought I'd ask.

Cheers

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



--
Bborie Park
Programmer
Center for Vectorborne Diseases
UC Davis
530-752-8380
bkp...@ucdavis.edu
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refraction

Re: [postgis-users] Basic postgis raster questions

2011-06-15 Thread Pierre Racine
I totally agree but a wrapper would be convenient for people not familiar with 
intersection operations on raster. Most are familiar with vector/vector 
intersections on but not with raster/raster ones. So let's inverse 4) and 5) in 
my previous mail.

I think the only real major missing pieces are:

1) ST_AsRaster(geometry)

2) ST_Resample(raster)

3) ST_MapAlgebra(raster, raster)

And then the things we can not do with them.

Pierre

> -Original Message-
> From: postgis-users-boun...@postgis.refractions.net [mailto:postgis-users-
> boun...@postgis.refractions.net] On Behalf Of Bryce L Nordgren
> Sent: Wednesday, June 15, 2011 3:38 PM
> To: PostGIS Users Discussion
> Subject: Re: [postgis-users] Basic postgis raster questions
> 
> 
> 
> postgis-users-boun...@postgis.refractions.net wrote on 06/15/2011 07:02:46
> PM:
> 
> > > 4. ST_Clip(raster, geometry)
> 
> If ST_Intersection(raster, geometry) returns a raster having the original 
> pixel
> values inside the geometry, and nodata outside the geometry, I'm not sure I 
> see
> the need for a separate "clip" function. Semantically and mathematically, 
> "clip"
> is "intersection": area common to both arguments.
> 
> Bryce
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] Basic postgis raster questions

2011-06-15 Thread Bryce L Nordgren
postgis-users-boun...@postgis.refractions.net wrote on 06/15/2011 07:02:46 
PM:

> > 4. ST_Clip(raster, geometry)

If ST_Intersection(raster, geometry) returns a raster having the original 
pixel values inside the geometry, and nodata outside the geometry, I'm not 
sure I see the need for a separate "clip" function. Semantically and 
mathematically, "clip" is "intersection": area common to both arguments.

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


Re: [postgis-users] QGIS - PostGIS - ArcGIS Interaction

2011-06-15 Thread Paragon Corporation
Bborie,

Does this work for any version of PostGIS or only ESRI sanctioned PostGIS
1.4? 

Thanks,
Regina
http://www.postgis.us


-Original Message-
From: postgis-users-boun...@postgis.refractions.net
[mailto:postgis-users-boun...@postgis.refractions.net] On Behalf Of Bborie
Park
Sent: Wednesday, June 15, 2011 3:10 PM
To: doug_newc...@fws.gov
Cc: postgis-users@postgis.refractions.net
Subject: Re: [postgis-users] QGIS - PostGIS - ArcGIS Interaction

Hey Doug,

ArcMap 10 brought "read-only" access to PostGIS without the need for ArcSDE
or any other extensions.  To do so...

1. Click on File > Add Data > Add Query Layer...

2. In the "New Query Layer" window that appears, click on the
"Connections..." button to add a new connection.  Unless you have existing
connnections, click on "New..." in the "Manage Connection(s)" 
window.

3. In the "Database Connection" window, select "postgresql" for the DBMS
client, provide your database server IP (or domain name) in "Data Source"
and fill out "Database" with the name of the database you're connecting to.
If need be, add the appropriate authentication information.  For PostgreSQL,
you'll select "Database Authentication" 
for Authentication.  Feel free to test your settings with "Test Connection".

4. Once satisfied, click "OK" to close the "Database Connection" window.

5. By now, you should have an entry in the "Manage Connection(s)" window so
click "OK" if you're satisfied.

6. You should be back in "New Query Layer" and the connection you just
created may have already been selected for "Connection".  If not, select the
appropriate connection.  It takes a few seconds for the connection to be
established and the program to retrieve the schema of the database.

7. I usually skip clicking on the "List of Tables" and "Columns" tools as
ArcGIS still doesn't work with 64-bit datatypes (double, bigint,
text???) and go directly to the "Name" and "Query" elements on the window.
Just provide a value for "Name" as that value will be the layer name and use
any valid SQL SELECT statement in the "Query" field.

8. You can click on "Validate" to make sure your query is valid.  Once,
satisfied, click on "Finish"

That's it.

-bborie

On 06/15/2011 11:53 AM, doug_newc...@fws.gov wrote:
>
> bborie,
> I would like details on this procedure.  Does it require the 
> interoperability extension? Ziggis?
>
> Doug
>
> Doug Newcomb
> USFWS
> Raleigh, NC
> 919-856-4520 ext. 14 doug_newc...@fws.gov
> --
> ---
>
> The opinions I express are my own and are not representative of the 
> official policy of the U.S.Fish and Wildlife Service or Dept. of the
> Interior.   Life is too short for undocumented, proprietary data formats.
>
> -postgis-users-boun...@postgis.refractions.net wrote: -
>
> To: postgis-users@postgis.refractions.net
> From: Bborie Park
> Sent by: postgis-users-boun...@postgis.refractions.net
> Date: 06/15/2011 06:47PM
> Subject: Re: [postgis-users] QGIS - PostGIS - ArcGIS Interaction
>
> James,
>
> If you have ArcGIS 10, you can directly write SELECT queries from 
> ArcMap to PostGIS.  That's how I visualize my data when I'm running
Windows.
>
> -bborie
>
> On 06/15/2011 10:58 AM, James David Smith wrote:
>> Dear all,
>>
>> I appreciate that this is more of a QGIS query, but I think that the 
>> route of the problem might be in PostGIS, so... I have opened QGIS 
>> and ran the query on my PostGIS table as below:
>>
>> SELECT * FROM incidents
>> WHERE urgency = 'Immediate'
>> AND date_time_of_arrival - date_time_unit_assigned>'00:12:00'
>>
>> This gives me 33 points in QGIS. Great. I would now however like to 
>> save this as a ShapeFile for use in ArcGIS with which I am more 
>> familiar, but when I try to SAVE AS from QGIS I am given the 
>> following error
>>
>> Export to vector file failed.
>> Error: trimming attribute name 'date_time_of_arrival' to ten 
>> significant characters produces duplicate column name.
>>
>> I am guessing that the problem here is that ESRI shapefiles can only 
>> deal with column names that are ten characters long...? And that as I 
>> also have a column called 'date_time_of_departure', when QGIS trims 
>> this column it ends up with two columns called the same thing?  Is 
>> there a way around this? I realise I could rename the column in QGIS, 
>> but I actually have around 45 columns in the table and this problem 
>> will occur with about 15 pairs of them I think. I guess there is no 
>> simple answer... but thought I'd ask.
>>
>> Cheers
>>
>> James
>> ___
>> postgis-users mailing list
>> postgis-users@postgis.refractions.net
>> http://postgis.refractions.net/mailman/listinfo/postgis-users
>>
>
> --
> Bborie Park
> Programmer
> Center for Vectorborne Diseases
> UC Davis
> 530-752-8380
> bkp...@ucdavis.edu
> ___
> postgis-users mailing list
> 

Re: [postgis-users] QGIS - PostGIS - ArcGIS Interaction

2011-06-15 Thread Bborie Park

Hey Doug,

ArcMap 10 brought "read-only" access to PostGIS without the need for 
ArcSDE or any other extensions.  To do so...


1. Click on File > Add Data > Add Query Layer...

2. In the "New Query Layer" window that appears, click on the 
"Connections..." button to add a new connection.  Unless you have 
existing connnections, click on "New..." in the "Manage Connection(s)" 
window.


3. In the "Database Connection" window, select "postgresql" for the DBMS 
client, provide your database server IP (or domain name) in "Data 
Source" and fill out "Database" with the name of the database you're 
connecting to.  If need be, add the appropriate authentication 
information.  For PostgreSQL, you'll select "Database Authentication" 
for Authentication.  Feel free to test your settings with "Test Connection".


4. Once satisfied, click "OK" to close the "Database Connection" window.

5. By now, you should have an entry in the "Manage Connection(s)" window 
so click "OK" if you're satisfied.


6. You should be back in "New Query Layer" and the connection you just 
created may have already been selected for "Connection".  If not, select 
the appropriate connection.  It takes a few seconds for the connection 
to be established and the program to retrieve the schema of the database.


7. I usually skip clicking on the "List of Tables" and "Columns" tools 
as ArcGIS still doesn't work with 64-bit datatypes (double, bigint, 
text???) and go directly to the "Name" and "Query" elements on the 
window.  Just provide a value for "Name" as that value will be the layer 
name and use any valid SQL SELECT statement in the "Query" field.


8. You can click on "Validate" to make sure your query is valid.  Once, 
satisfied, click on "Finish"


That's it.

-bborie

On 06/15/2011 11:53 AM, doug_newc...@fws.gov wrote:


bborie,
I would like details on this procedure.  Does it require the
interoperability extension? Ziggis?

Doug

Doug Newcomb
USFWS
Raleigh, NC
919-856-4520 ext. 14 doug_newc...@fws.gov
-

The opinions I express are my own and are not representative of the
official policy of the U.S.Fish and Wildlife Service or Dept. of the
Interior.   Life is too short for undocumented, proprietary data formats.

-postgis-users-boun...@postgis.refractions.net wrote: -

To: postgis-users@postgis.refractions.net
From: Bborie Park
Sent by: postgis-users-boun...@postgis.refractions.net
Date: 06/15/2011 06:47PM
Subject: Re: [postgis-users] QGIS - PostGIS - ArcGIS Interaction

James,

If you have ArcGIS 10, you can directly write SELECT queries from ArcMap
to PostGIS.  That's how I visualize my data when I'm running Windows.

-bborie

On 06/15/2011 10:58 AM, James David Smith wrote:

Dear all,

I appreciate that this is more of a QGIS query, but I think that the
route of the problem might be in PostGIS, so... I have opened QGIS and
ran the query on my PostGIS table as below:

SELECT * FROM incidents
WHERE urgency = 'Immediate'
AND date_time_of_arrival - date_time_unit_assigned>'00:12:00'

This gives me 33 points in QGIS. Great. I would now however like to
save this as a ShapeFile for use in ArcGIS with which I am more
familiar, but when I try to SAVE AS from QGIS I am given the following
error

Export to vector file failed.
Error: trimming attribute name 'date_time_of_arrival' to ten
significant characters produces duplicate column name.

I am guessing that the problem here is that ESRI shapefiles can only
deal with column names that are ten characters long...? And that as I
also have a column called 'date_time_of_departure', when QGIS trims
this column it ends up with two columns called the same thing?  Is
there a way around this? I realise I could rename the column in QGIS,
but I actually have around 45 columns in the table and this problem
will occur with about 15 pairs of them I think. I guess there is no
simple answer... but thought I'd ask.

Cheers

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



--
Bborie Park
Programmer
Center for Vectorborne Diseases
UC Davis
530-752-8380
bkp...@ucdavis.edu
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


--
Bborie Park
Programmer
Center for Vectorborne Diseases
UC Davis
530-752-8380
bkp...@ucdavis.edu
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] Basic postgis raster questions

2011-06-15 Thread Pierre Racine
> Pierre,
> 
> Is it safe to assume that what you're looking for is a ST_AsRaster to convert 
> the
> geometry into a raster so that we can do raster on raster filtering?

This is VERY userful but not sufficient.

> I've been wondering as to which method (covert raster to vector or convert
> vector to raster) is more efficient, hence my delay in adding a geometry
> parameter to filter a raster.

I haven't done any test yet but I am pretty sure that geometry to raster is 
much faster. You could easily test test "gdal_rasterize" VS 
"gdal_polygonize.py" even though one is in Python and the other one seems to be 
in C.

> Then again, I've been thinking that there are fundamental functions that 
> should
> be implemented first, including:
> 
> 1. ST_AsRaster(geometry)
> 
> 2. ST_Resample(raster)
> 
> 3. ST_Intersection(raster, raster)
> 
> 4. ST_Clip(raster, geometry)

I think 3) is more or less optional as it could easily be implemented as a 
wrapper around the two rasters version of MapAlgebra. I agree that 
ST_AsRaster(geometry) and ST_Resample(raster) are all very fundamental missing 
pieces.

ST_Clip could be implemented using ST_AsRaster(geometry) and 
ST_MapAlgebra(raster, raster) because ST_Mapalgebra have a 'working extent' 
parameter. If you set it to 'INTERSECTION of both raster' and the computing 
expression is 'rast2' then ST_MapAlgebra(ST_AsRaster(geometry), raster) is 
ST_Clip(raster, geometry)

So in my head:

1) ST_AsRaster(geometry)

2) ST_Resample(raster)

3) ST_MapAlgebra(raster, raster)

4) ST_Clip

5) St_Intersection(raster, raster)

With that we can certainly implement stats restricted to geometry:

ST_SummaryStat(ST_Intersection(raster, ST_AsRaster(geometry)))

But how fast would it be? But we can implement thousands of other things with 
those functions... mostly with ST_Mapalgebra(raster, raster).

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


Re: [postgis-users] QGIS - PostGIS - ArcGIS Interaction

2011-06-15 Thread Bborie Park

James,

If you have ArcGIS 10, you can directly write SELECT queries from ArcMap 
to PostGIS.  That's how I visualize my data when I'm running Windows.


-bborie

On 06/15/2011 10:58 AM, James David Smith wrote:

Dear all,

I appreciate that this is more of a QGIS query, but I think that the
route of the problem might be in PostGIS, so... I have opened QGIS and
ran the query on my PostGIS table as below:

SELECT * FROM incidents
WHERE urgency = 'Immediate'
AND date_time_of_arrival - date_time_unit_assigned>  '00:12:00'

This gives me 33 points in QGIS. Great. I would now however like to
save this as a ShapeFile for use in ArcGIS with which I am more
familiar, but when I try to SAVE AS from QGIS I am given the following
error

Export to vector file failed.
Error: trimming attribute name 'date_time_of_arrival' to ten
significant characters produces duplicate column name.

I am guessing that the problem here is that ESRI shapefiles can only
deal with column names that are ten characters long...? And that as I
also have a column called 'date_time_of_departure', when QGIS trims
this column it ends up with two columns called the same thing?  Is
there a way around this? I realise I could rename the column in QGIS,
but I actually have around 45 columns in the table and this problem
will occur with about 15 pairs of them I think. I guess there is no
simple answer... but thought I'd ask.

Cheers

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



--
Bborie Park
Programmer
Center for Vectorborne Diseases
UC Davis
530-752-8380
bkp...@ucdavis.edu
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] Basic postgis raster questions

2011-06-15 Thread Bborie Park

On 06/15/2011 07:03 AM, Pierre Racine wrote:

I may be missing the boat here, but it seems to me that a version of
ST_Intersection() which returns a raster would eliminate the need for a
separate geometry parameter, and would be more in line with the spirit
of "seamless vector/raster" processing. It also would seem that your
separate geometry parameter would behave very much like a
raster-returning ST_Intersection(), except that it is only usable "vicariously" 
via

the stats functions.

Right. It would even be of greater value for other functionalities even if, I 
think,
it would be slower for the particular case of computing stats .


Sorry but I must come back on this.

This is true when the vector area is small in comparison with the raster area AND if the 
raster coverage is tiled. In this case vectorization is possible and provide results very 
fast. This is true also if the raster is not tiled but is small. This operation provide 
very precise numbers because the intersection is done in vector mode and every pixel are 
cut when necessary. What you get is not a mere count of the pixels intersecting "a 
la Starspan" but true areas.

In the other case (if the vector area is big in comparison the raster area OR the raster 
is big and not tiled) the all vector method is catastrophic as you have to vectorize many 
time large parts of the raster and this become unpracticable. This is why we need a pixel 
counter (ST_Histogram) accepting geometries. The provided result are somewhat coarser 
(take all the pixel or nothing) and provide a "a la Starspan" result, but at 
last, provide a result in reasonable time.

This is why we need ST_Histogram, ST_SummaryStat, etc., accepting a geometry as 
parameter.



Pierre,

Is it safe to assume that what you're looking for is a ST_AsRaster to 
convert the geometry into a raster so that we can do raster on raster 
filtering?


I've been wondering as to which method (covert raster to vector or 
convert vector to raster) is more efficient, hence my delay in adding a 
geometry parameter to filter a raster.


Then again, I've been thinking that there are fundamental functions that 
should be implemented first, including:


1. ST_AsRaster(geometry)

2. ST_Resample(raster)

3. ST_Intersection(raster, raster)

4. ST_Clip(raster, geometry)

-bborie

--
Bborie Park
Programmer
Center for Vectorborne Diseases
UC Davis
530-752-8380
bkp...@ucdavis.edu
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] QGIS - PostGIS - ArcGIS Interaction

2011-06-15 Thread Paragon Corporation
James,

You can use shp2pgsql command line packaged with PostGIS.  It automatically
renames columns for you by adding digits to the end of duplicated 10char
names

So something like

pgsql2shp -f myshapefile -h myserver -u apguser -P apgpassword mygisdb
"SELECT * FROM incidents WHERE urgency = 'Immediate' AND
date_time_of_arrival - date_time_unit_assigned > '00:12:00' "

http://www.bostongis.com/pgsql2shp_shp2pgsql_quickguide_20.bqg

Leo
http://www.postgis.us 

-Original Message-
From: postgis-users-boun...@postgis.refractions.net
[mailto:postgis-users-boun...@postgis.refractions.net] On Behalf Of James
David Smith
Sent: Wednesday, June 15, 2011 1:58 PM
To: PostGIS Users Discussion
Subject: [postgis-users] QGIS - PostGIS - ArcGIS Interaction

Dear all,

I appreciate that this is more of a QGIS query, but I think that the route
of the problem might be in PostGIS, so... I have opened QGIS and ran the
query on my PostGIS table as below:

SELECT * FROM incidents
WHERE urgency = 'Immediate'
AND date_time_of_arrival - date_time_unit_assigned > '00:12:00'

This gives me 33 points in QGIS. Great. I would now however like to save
this as a ShapeFile for use in ArcGIS with which I am more familiar, but
when I try to SAVE AS from QGIS I am given the following error

Export to vector file failed.
Error: trimming attribute name 'date_time_of_arrival' to ten significant
characters produces duplicate column name.

I am guessing that the problem here is that ESRI shapefiles can only deal
with column names that are ten characters long...? And that as I also have a
column called 'date_time_of_departure', when QGIS trims this column it ends
up with two columns called the same thing?  Is there a way around this? I
realise I could rename the column in QGIS, but I actually have around 45
columns in the table and this problem will occur with about 15 pairs of them
I think. I guess there is no simple answer... but thought I'd ask.

Cheers

James
___
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] QGIS - PostGIS - ArcGIS Interaction

2011-06-15 Thread James David Smith
Dear Cristian & David,

Thanks alot for your responses.

Cristian - I don't have money to buy additional software
unfortunately. With regard to 'view' I actually don't know what this
is. I'm a bit of a beginner. I wonder if I made a 'view' whether I
could then query that view with QGIS. Something for me to look into...

David - That looks like a good idea... but when adding data to QGIS
you can only select the whole table (I think) and then you manually
enter the 'WHERE' clause in a dialog box. I guess I could run the
query you suggest in PostgreSQL and save it into another table... and
then link QGIS to the new table. Though it all starts to get a bit
convoluted if I have to do that every time I want to look at some data
in QGIS...

Cheers

James



On 15 June 2011 19:16, David Fawcett  wrote:
> This is what is really cool about using a database to store your data...
>
> Change your query to:
>
> SELECT mycol1,
>             mycol2,
>             date_time_of_arrival as dt_arrive,
>             date_time_of_departure as dt_depart,
>              the_geom
> FROM incidents
> WHERE urgency = 'Immediate'
> AND date_time_of_arrival - date_time_unit_assigned > '00:12:00'
>
> Note: you will need to specify the names of the columns that you are
> interested in.
>
>
> On Wed, Jun 15, 2011 at 12:58 PM, James David Smith
>  wrote:
>> Dear all,
>>
>> I appreciate that this is more of a QGIS query, but I think that the
>> route of the problem might be in PostGIS, so... I have opened QGIS and
>> ran the query on my PostGIS table as below:
>>
>> SELECT * FROM incidents
>> WHERE urgency = 'Immediate'
>> AND date_time_of_arrival - date_time_unit_assigned > '00:12:00'
>>
>> This gives me 33 points in QGIS. Great. I would now however like to
>> save this as a ShapeFile for use in ArcGIS with which I am more
>> familiar, but when I try to SAVE AS from QGIS I am given the following
>> error
>>
>> Export to vector file failed.
>> Error: trimming attribute name 'date_time_of_arrival' to ten
>> significant characters produces duplicate column name.
>>
>> I am guessing that the problem here is that ESRI shapefiles can only
>> deal with column names that are ten characters long...? And that as I
>> also have a column called 'date_time_of_departure', when QGIS trims
>> this column it ends up with two columns called the same thing?  Is
>> there a way around this? I realise I could rename the column in QGIS,
>> but I actually have around 45 columns in the table and this problem
>> will occur with about 15 pairs of them I think. I guess there is no
>> simple answer... but thought I'd ask.
>>
>> Cheers
>>
>> James
>> ___
>> 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
>
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] QGIS - PostGIS - ArcGIS Interaction

2011-06-15 Thread David Fawcett
This is what is really cool about using a database to store your data...

Change your query to:

SELECT mycol1,
 mycol2,
 date_time_of_arrival as dt_arrive,
 date_time_of_departure as dt_depart,
  the_geom
FROM incidents
WHERE urgency = 'Immediate'
AND date_time_of_arrival - date_time_unit_assigned > '00:12:00'

Note: you will need to specify the names of the columns that you are
interested in.


On Wed, Jun 15, 2011 at 12:58 PM, James David Smith
 wrote:
> Dear all,
>
> I appreciate that this is more of a QGIS query, but I think that the
> route of the problem might be in PostGIS, so... I have opened QGIS and
> ran the query on my PostGIS table as below:
>
> SELECT * FROM incidents
> WHERE urgency = 'Immediate'
> AND date_time_of_arrival - date_time_unit_assigned > '00:12:00'
>
> This gives me 33 points in QGIS. Great. I would now however like to
> save this as a ShapeFile for use in ArcGIS with which I am more
> familiar, but when I try to SAVE AS from QGIS I am given the following
> error
>
> Export to vector file failed.
> Error: trimming attribute name 'date_time_of_arrival' to ten
> significant characters produces duplicate column name.
>
> I am guessing that the problem here is that ESRI shapefiles can only
> deal with column names that are ten characters long...? And that as I
> also have a column called 'date_time_of_departure', when QGIS trims
> this column it ends up with two columns called the same thing?  Is
> there a way around this? I realise I could rename the column in QGIS,
> but I actually have around 45 columns in the table and this problem
> will occur with about 15 pairs of them I think. I guess there is no
> simple answer... but thought I'd ask.
>
> Cheers
>
> James
> ___
> 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] QGIS - PostGIS - ArcGIS Interaction

2011-06-15 Thread Cristian Olguín Avila
some ideas...

- create a view with name column length as you want.

- looking for software ziggis, with this you can connect arcmap to Postgres
Geodatabase

bye...

Cristian O.
www.digitalbee.cl


On Wed, Jun 15, 2011 at 1:58 PM, James David Smith <
james.david.sm...@gmail.com> wrote:

> Dear all,
>
> I appreciate that this is more of a QGIS query, but I think that the
> route of the problem might be in PostGIS, so... I have opened QGIS and
> ran the query on my PostGIS table as below:
>
> SELECT * FROM incidents
> WHERE urgency = 'Immediate'
> AND date_time_of_arrival - date_time_unit_assigned > '00:12:00'
>
> This gives me 33 points in QGIS. Great. I would now however like to
> save this as a ShapeFile for use in ArcGIS with which I am more
> familiar, but when I try to SAVE AS from QGIS I am given the following
> error
>
> Export to vector file failed.
> Error: trimming attribute name 'date_time_of_arrival' to ten
> significant characters produces duplicate column name.
>
> I am guessing that the problem here is that ESRI shapefiles can only
> deal with column names that are ten characters long...? And that as I
> also have a column called 'date_time_of_departure', when QGIS trims
> this column it ends up with two columns called the same thing?  Is
> there a way around this? I realise I could rename the column in QGIS,
> but I actually have around 45 columns in the table and this problem
> will occur with about 15 pairs of them I think. I guess there is no
> simple answer... but thought I'd ask.
>
> Cheers
>
> James
> ___
> 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


[postgis-users] QGIS - PostGIS - ArcGIS Interaction

2011-06-15 Thread James David Smith
Dear all,

I appreciate that this is more of a QGIS query, but I think that the
route of the problem might be in PostGIS, so... I have opened QGIS and
ran the query on my PostGIS table as below:

SELECT * FROM incidents
WHERE urgency = 'Immediate'
AND date_time_of_arrival - date_time_unit_assigned > '00:12:00'

This gives me 33 points in QGIS. Great. I would now however like to
save this as a ShapeFile for use in ArcGIS with which I am more
familiar, but when I try to SAVE AS from QGIS I am given the following
error

Export to vector file failed.
Error: trimming attribute name 'date_time_of_arrival' to ten
significant characters produces duplicate column name.

I am guessing that the problem here is that ESRI shapefiles can only
deal with column names that are ten characters long...? And that as I
also have a column called 'date_time_of_departure', when QGIS trims
this column it ends up with two columns called the same thing?  Is
there a way around this? I realise I could rename the column in QGIS,
but I actually have around 45 columns in the table and this problem
will occur with about 15 pairs of them I think. I guess there is no
simple answer... but thought I'd ask.

Cheers

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


Re: [postgis-users] ST_Intersects

2011-06-15 Thread Mahesh Ghule
Thanks again.
I did the same but thought if there was any better way.

Regards,
Mahesh

On 15 June 2011 17:10, Paul Ramsey  wrote:

> It seems to me that the only way out of this conundrum (people with
> "boxes" they drew on projected maps) is to provide some densification
> functions so they can force their geometries to be closer to what they
> want by filling in points.  Both geometry and geography could use some
> densification routines.
>
> P.
>
> On Tue, Jun 14, 2011 at 2:11 AM, Mahesh Ghule 
> wrote:
> > Thanks a bunch Paul.
> > I did arrive those findings after I posted the query.
> > Now I am thinking how to do what I want to do if I want the polygon to be
> > with the great circles in postgis.
> > Any pointers.
> > Regards,
> > Mahesh
> > On 13 June 2011 17:49, Paul Ramsey  wrote:
> >>
> >> And relatedly, here's why Google Earth gives the wrong visual answer.
> >>
> >> http://blog.opengeo.org/2010/08/10/shape-of-a-polygon/
> >>
> >> P.
> >>
> >> On Mon, Jun 13, 2011 at 9:47 AM, Paul Ramsey 
> wrote:
> >> > You're thinking in straight lines, not great circles. Here's what your
> >> > "box" actually looks like
> >> >
> >> >
> >> >
> http://www.gcmap.com/mapui?P=10N+170E-10N+0E%2C%0D%0A10N+170E-5N+170E%2C%0D%0A5N+170E-5N+0E%2C%0D%0A5N+0E-10N+0E&MS=wls&DU=mi
> >> >
> >> > I can see how that could hit your Russian foot print.
> >> >
> >> > P.
> >> >
> >> > On Mon, Jun 13, 2011 at 6:54 AM, Mahesh Ghule  >
> >> > wrote:
> >> >> Hello Guys,
> >> >> After lot of head scratching I have decided to post this email.
> >> >> We have a PostGIS 1.5.1 on PostgreSQL 8.4
> >> >> select
> >> >>
> >> >>
> ST_AsText('010520E610010001020002009FAEEE586C8C5240029CDEC5FBF94D406B44300E2EDB5140D591239D81D14C40'::geography)
> >> >> as TextFootPrint,
> >> >>
> >> >>
> >> >>
>  
> ST_Intersects('010520E610010001020002009FAEEE586C8C5240029CDEC5FBF94D406B44300E2EDB5140D591239D81D14C40'::geography,
> >> >> ST_GeographyFromText('POLYGON((0 10,170 10,170 5,0 5,0 10))')) as
> >> >> Intersects;
> >> >> yields following result
> >> >> TextFootPrint
> >> >>   |  Intersects
> >> >>
> >> >>
> ---
> >> >> MULTILINESTRING((74.194113 59.952996,71.424686 57.636768))  |
> >> >>t
> >> >>
> >> >> Which as I understand is not correct. The footprint is a line string
> >> >> somewhere over Russia and the Polygon is a band in north hemisphere
> >> >> just
> >> >> above equator.
> >> >> Also when I visualise the both geographies as KML in google earth I
> can
> >> >> see
> >> >> them thousands of miles apart.
> >> >> This is just one example footprint where I have tens of thousand more
> >> >> in my
> >> >> DB like this.
> >> >> Please help me understand what is going on?
> >> >>
> >> >> Regards,
> >> >> Mahesh
> >> >>
> >> >> ___
> >> >> 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
> >
> >
> > ___
> > 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
>
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] ST_ConvexHull with millions of records...

2011-06-15 Thread Paul Ramsey
Of you have a relatively uniform primary key on the table just take
every record mod 100 or something.

P.

On Wed, Jun 15, 2011 at 6:37 AM, Martin Ouellet  wrote:
> Hi,
>
> The ST_ConvexHull function generates exactly the geometry that I need to
> get the area covered by each of my tables. By cons, some of
> them have millions of records and the operation crash.
>
> Is there a way to generate a geometry using
> the function ST_ConvexHull but by reducing the precision or by a
> process of aggregation?
>
> The accuracy is not required in my case, only to get an idea of the scope of
> data foreach table.
>
> regards,
>
> MartinO
> ___
> 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] ST_Intersects

2011-06-15 Thread Paul Ramsey
It seems to me that the only way out of this conundrum (people with
"boxes" they drew on projected maps) is to provide some densification
functions so they can force their geometries to be closer to what they
want by filling in points.  Both geometry and geography could use some
densification routines.

P.

On Tue, Jun 14, 2011 at 2:11 AM, Mahesh Ghule  wrote:
> Thanks a bunch Paul.
> I did arrive those findings after I posted the query.
> Now I am thinking how to do what I want to do if I want the polygon to be
> with the great circles in postgis.
> Any pointers.
> Regards,
> Mahesh
> On 13 June 2011 17:49, Paul Ramsey  wrote:
>>
>> And relatedly, here's why Google Earth gives the wrong visual answer.
>>
>> http://blog.opengeo.org/2010/08/10/shape-of-a-polygon/
>>
>> P.
>>
>> On Mon, Jun 13, 2011 at 9:47 AM, Paul Ramsey  wrote:
>> > You're thinking in straight lines, not great circles. Here's what your
>> > "box" actually looks like
>> >
>> >
>> > http://www.gcmap.com/mapui?P=10N+170E-10N+0E%2C%0D%0A10N+170E-5N+170E%2C%0D%0A5N+170E-5N+0E%2C%0D%0A5N+0E-10N+0E&MS=wls&DU=mi
>> >
>> > I can see how that could hit your Russian foot print.
>> >
>> > P.
>> >
>> > On Mon, Jun 13, 2011 at 6:54 AM, Mahesh Ghule 
>> > wrote:
>> >> Hello Guys,
>> >> After lot of head scratching I have decided to post this email.
>> >> We have a PostGIS 1.5.1 on PostgreSQL 8.4
>> >> select
>> >>
>> >> ST_AsText('010520E610010001020002009FAEEE586C8C5240029CDEC5FBF94D406B44300E2EDB5140D591239D81D14C40'::geography)
>> >> as TextFootPrint,
>> >>
>> >>
>> >>  ST_Intersects('010520E610010001020002009FAEEE586C8C5240029CDEC5FBF94D406B44300E2EDB5140D591239D81D14C40'::geography,
>> >> ST_GeographyFromText('POLYGON((0 10,170 10,170 5,0 5,0 10))')) as
>> >> Intersects;
>> >> yields following result
>> >> TextFootPrint
>> >>                   |          Intersects
>> >>
>> >> ---
>> >> MULTILINESTRING((74.194113 59.952996,71.424686 57.636768))      |
>> >>    t
>> >>
>> >> Which as I understand is not correct. The footprint is a line string
>> >> somewhere over Russia and the Polygon is a band in north hemisphere
>> >> just
>> >> above equator.
>> >> Also when I visualise the both geographies as KML in google earth I can
>> >> see
>> >> them thousands of miles apart.
>> >> This is just one example footprint where I have tens of thousand more
>> >> in my
>> >> DB like this.
>> >> Please help me understand what is going on?
>> >>
>> >> Regards,
>> >> Mahesh
>> >>
>> >> ___
>> >> 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
>
>
> ___
> 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] Viewer plugins of PostGIS --HELP

2011-06-15 Thread David Fawcett
I have used RT SQL for the exact case that you have outlined.  I have
a vector 'grid' that I connect to a very large data set.  It allows me
to store the geometry in one place and then connect the features with
the values for one analytical parameter for a particular date for
visualization.

I have also done a similar thing with MapServer.  I have a simple Web
app that passes parameters for the date and the analyte to MapServer,
which writes the query, hits PostGIS, and then renders the image.

David.

On Wed, Jun 15, 2011 at 4:04 AM, Paolo Cavallini  wrote:
> Il giorno mer, 15/06/2011 alle 16.29 +0800, Ben Madin ha scritto:
>> This may not help, but I guess I find QGIS quite simple for actually
>> visualising data. Maybe not so good for complex queries. There are now
>> a number of PostGIS plug-ins though.
>
> Confirmed. You can also run complex queries via the RT SQL layer plugin,
> and others.
> All the best.
> --
> Paolo Cavallini: http://www.faunalia.it/pc
>
> ___
> 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 table extent

2011-06-15 Thread Stephen Crawford

That did the trick, thanks.

On 6/15/2011 9:51 AM, Pierre Racine wrote:

If you imported all of your rasters with one raster2pgsql command the "extent" column in 
the "raster_column" table should correspond to the global extent.

If you imported with many commands, added or deleted tiles afterward, "extent" 
is not up to date.

You can play with the ST_Extent aggregate.

SELECT ST_Extent(rast)
FROM your table

That would be the preferred way to get an uptodate extent. If it's slow, create 
an index on your raster column.

Pierre


-Original Message-
From: postgis-users-boun...@postgis.refractions.net [mailto:postgis-users-
boun...@postgis.refractions.net] On Behalf Of Stephen Crawford
Sent: Tuesday, June 14, 2011 7:04 PM
To: PostGIS Users Discussion
Subject: [postgis-users] raster table extent

Is there a function that can provide the extent for an entire raster table?  I 
see
there is BOX2D for each raster in a table, but how about the entire table?
Basically I think I loaded my raster in a way that the extent isn't where it 
should
be, but I'm having trouble proving it.

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


--
Stephen Crawford
Center for Environmental Informatics
The Pennsylvania State University
src...@psu.edu
814.865.9905


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


Re: [postgis-users] Basic postgis raster questions

2011-06-15 Thread Pierre Racine
> >I may be missing the boat here, but it seems to me that a version of
> >ST_Intersection() which returns a raster would eliminate the need for a
> >separate geometry parameter, and would be more in line with the spirit
> >of "seamless vector/raster" processing. It also would seem that your
> >separate geometry parameter would behave very much like a
> >raster-returning ST_Intersection(), except that it is only usable 
> >"vicariously" via
> the stats functions.
> 
> Right. It would even be of greater value for other functionalities even if, I 
> think,
> it would be slower for the particular case of computing stats .

Sorry but I must come back on this.

This is true when the vector area is small in comparison with the raster area 
AND if the raster coverage is tiled. In this case vectorization is possible and 
provide results very fast. This is true also if the raster is not tiled but is 
small. This operation provide very precise numbers because the intersection is 
done in vector mode and every pixel are cut when necessary. What you get is not 
a mere count of the pixels intersecting "a la Starspan" but true areas.

In the other case (if the vector area is big in comparison the raster area OR 
the raster is big and not tiled) the all vector method is catastrophic as you 
have to vectorize many time large parts of the raster and this become 
unpracticable. This is why we need a pixel counter (ST_Histogram) accepting 
geometries. The provided result are somewhat coarser (take all the pixel or 
nothing) and provide a "a la Starspan" result, but at last, provide a result in 
reasonable time.

This is why we need ST_Histogram, ST_SummaryStat, etc., accepting a geometry as 
parameter.

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


Re: [postgis-users] raster table extent

2011-06-15 Thread Pierre Racine
If you imported all of your rasters with one raster2pgsql command the "extent" 
column in the "raster_column" table should correspond to the global extent.

If you imported with many commands, added or deleted tiles afterward, "extent" 
is not up to date.

You can play with the ST_Extent aggregate.

SELECT ST_Extent(rast)
FROM your table

That would be the preferred way to get an uptodate extent. If it's slow, create 
an index on your raster column.

Pierre

> -Original Message-
> From: postgis-users-boun...@postgis.refractions.net [mailto:postgis-users-
> boun...@postgis.refractions.net] On Behalf Of Stephen Crawford
> Sent: Tuesday, June 14, 2011 7:04 PM
> To: PostGIS Users Discussion
> Subject: [postgis-users] raster table extent
> 
> Is there a function that can provide the extent for an entire raster table?  
> I see
> there is BOX2D for each raster in a table, but how about the entire table?
> Basically I think I loaded my raster in a way that the extent isn't where it 
> should
> be, but I'm having trouble proving it.
> 
> 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


[postgis-users] ST_ConvexHull with millions of records...

2011-06-15 Thread Martin Ouellet
Hi,

The ST_ConvexHull function generates exactly the geometry that I need to get
 the area covered by each of my tables. By cons, some of them have millions
of records and the operation crash.

Is there a way to generate a geometry using the function ST_ConvexHull but by
reducing the precision or by a process of aggregation?

The accuracy is not required in my case, only to get an idea of the scope of
data foreach table.

regards,

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


Re: [postgis-users] Viewer plugins of PostGIS --HELP

2011-06-15 Thread Paolo Cavallini
Il giorno mer, 15/06/2011 alle 11.05 +0100, James David Smith ha
scritto: 
> Can you give me more information about the 'RT SQL layer plugin' you
> mention please? I use GQIS to visualise my data from PostGIS
> sometimes, but do find the query tool a bit limited and wonder whether
> this might be the solution...?

The plugin enables users without permissions (other than SELECT) to
build their queries and to save them client-side.
You should not have any major limitation.
Please let us know how it goes.
All the best.
-- 
Paolo Cavallini: http://www.faunalia.it/pc

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


[postgis-users] Constrained Delaunay Triangulation

2011-06-15 Thread Brian Sanjeewa Rupasinghe
Hi,

Could you please let me know how constrained delunay triangulation is
implemented through GEOS?

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


Re: [postgis-users] Viewer plugins of PostGIS --HELP

2011-06-15 Thread James David Smith
Dear Paolo,

Can you give me more information about the 'RT SQL layer plugin' you
mention please? I use GQIS to visualise my data from PostGIS
sometimes, but do find the query tool a bit limited and wonder whether
this might be the solution...?

Thanks

James

On 15 June 2011 10:04, Paolo Cavallini  wrote:
> Il giorno mer, 15/06/2011 alle 16.29 +0800, Ben Madin ha scritto:
>> This may not help, but I guess I find QGIS quite simple for actually
>> visualising data. Maybe not so good for complex queries. There are now
>> a number of PostGIS plug-ins though.
>
> Confirmed. You can also run complex queries via the RT SQL layer plugin,
> and others.
> All the best.
> --
> Paolo Cavallini: http://www.faunalia.it/pc
>
> ___
> 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] Viewer plugins of PostGIS --HELP

2011-06-15 Thread Paolo Cavallini
Il giorno mer, 15/06/2011 alle 16.29 +0800, Ben Madin ha scritto: 
> This may not help, but I guess I find QGIS quite simple for actually
> visualising data. Maybe not so good for complex queries. There are now
> a number of PostGIS plug-ins though.

Confirmed. You can also run complex queries via the RT SQL layer plugin,
and others.
All the best. 
-- 
Paolo Cavallini: http://www.faunalia.it/pc

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


Re: [postgis-users] Viewer plugins of PostGIS --HELP

2011-06-15 Thread ΑΠΟΣΤΟΛΟΣ ΛΕΛΕΝΤΖΗΣ
Ben,

I know that the qGIS - OpenJump - uDig are very good solutions for
visualizing the spatial data of postgis, but.. i want to try and explore
these plug-ins.
Anyway, thanks for your reply!

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


Re: [postgis-users] Viewer plugins of PostGIS --HELP

2011-06-15 Thread Ben Madin
Apostolis,

This may not help, but I guess I find QGIS quite simple for actually 
visualising data. Maybe not so good for complex queries. There are now a number 
of PostGIS plug-ins though.

Download. Install. Run. Add PostGIS Layer...

cheers

Ben



On 15/06/2011, at 4:19 PM, ΑΠΟΣΤΟΛΟΣ ΛΕΛΕΝΤΖΗΣ wrote:

> Hi list
> 
> For another time, i ask your help and your valuable experience!!
> My problem is related with ad-hoc solutions for viewing spatial data of a 
> postgis database.
> I was searching a lot in the internet, and i found the following links which 
> indicate the installation and the usability of a postgis-viewer plugin.
> 
> [1] 
> http://www.postgresonline.com/journal/archives/180-pgAdmin113plugins_postgis.html
> [2] 
> http://geotux.tuxfamily.org/index.php?option=com_myblog&task=view&id=277&Itemid=59&lang=en
> 
> Regarding with the first plugin[1], i have execute all the necessary guides 
> for the installation, but it doesn't work.
> Specifically, i select a geometric table or i type a spatial SQL query, but 
> when i switch the postgis viewer then the new window don't visualize the 
> relevant table or the spatial outputs.
> So, could anyone help me?? Maybe, someone else has used this tool??
> 
> Concerning with the second plugin [2], i have installed it, very easy and 
> quickly, but it doesn't work because it requires the installation of OSGeo4W 
> environment.
> The postgis_viewer.bat file contains some variables which correspond to 
> OSGeo4W paths. Because, i have installed seperate all these programs which 
> are contained at OSGeo4W,  i must change these paths for the good operation 
> of plugin. So, could anyone to show me how to configure the 
> postgis_viewer.bat file???
> 
> Any suggestion is accepted!
> Thanks in advance
> 
> Apostolis
> ___
> 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


[postgis-users] Viewer plugins of PostGIS --HELP

2011-06-15 Thread ΑΠΟΣΤΟΛΟΣ ΛΕΛΕΝΤΖΗΣ
Hi list

For another time, i ask your help and your valuable experience!!
My problem is related with ad-hoc solutions for viewing spatial data of a
postgis database.
I was searching a lot in the internet, and i found the following links which
indicate the installation and the usability of a postgis-viewer plugin.

[1]
http://www.postgresonline.com/journal/archives/180-pgAdmin113plugins_postgis.html
[2]
http://geotux.tuxfamily.org/index.php?option=com_myblog&task=view&id=277&Itemid=59&lang=en

Regarding with the first plugin[1], i have execute all the necessary guides
for the installation, but it doesn't work.
Specifically, i select a geometric table or i type a spatial SQL query, but
when i switch the postgis viewer then the new window don't visualize the
relevant table or the spatial outputs.
So, could anyone help me?? Maybe, someone else has used this tool??

Concerning with the second plugin [2], i have installed it, very easy and
quickly, but it doesn't work because it requires the installation of OSGeo4W
environment.
The postgis_viewer.bat file contains some variables which correspond to
OSGeo4W paths. Because, i have installed seperate all these programs which
are contained at OSGeo4W,  i must change these paths for the good operation
of plugin. So, could anyone to show me how to configure the
postgis_viewer.bat file???

Any suggestion is accepted!
Thanks in advance

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