Re: [postgis-users] ArcGIS GRID data

2011-09-30 Thread pcreso
I have converted such grids to XYZ points using GDAL & stored them as Postgis 
points, but ensure you are clear about your pixel vs grid registration (are the 
X&Y coords at cell origin or centre?)

I'll leave it to you to determine whether upgrading to a version supporting 
PGRASTER is viable or preferable.



--- On Sat, 10/1/11, Puneet Kishor  wrote:

From: Puneet Kishor 
Subject: [postgis-users] ArcGIS GRID data
To: "PostGIS Users Discussion" 
Date: Saturday, October 1, 2011, 2:20 PM

What are my options for storing and displaying GRID data? That is, assuming I 
am using the current stable version of Pg (1.5.x) and don't want to play with 
the bleading edge.


--
Puneet Kishor 

___
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] ArcGIS GRID data

2011-09-30 Thread Puneet Kishor
What are my options for storing and displaying GRID data? That is, assuming I 
am using the current stable version of Pg (1.5.x) and don't want to play with 
the bleading edge.


--
Puneet Kishor 

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


Re: [postgis-users] Convert from character to timestamptz

2011-09-30 Thread Mathieu Basille

Le 30/09/2011 17:49, Sandro Santilli a écrit :

You're right, I'm being too vague (in my defence, error messages are
in French for me!).


See if exporting LANG=C helps there.


Did you mean at the command line or in the SQL query window? I tried 
both with no success.
I also tried to launch pgAdmin with 'LC_ALL=C pgadmin3', but error 
messages were still in French. What's weird is that the whole software 
runs in English!



I was wrong about the syntax, but the idea is that you tell it
how to do the conversion. Maybe it was USING instead of WITH.
The definitive answer is in the PostgreSQL reference manual, under
the SQL section, in the ALTER TABLE syntax.


That's beautiful! I've seen this page previously, but couldn't figure 
out what was the correct command for my case. Now, with:


ALTER TABLE test
ALTER COLUMN date TYPE timestamptz
USING date::timestamptz;

I have now date as a 'timestamptz'! I checked, and the timezone is taken 
into account (winter times are GMT-5, summer times are GMT-4). I think 
I'm starting to understand the mistakes I made and the rationale behind 
this command.


Sandro, thanks a lot!
Mathieu.


--

~$ whoami
Mathieu Basille, Post-Doc

~$ locate
Laboratoire d'Écologie Comportementale et de Conservation de la Faune
+ Centre d'Étude de la Forêt
Département de Biologie
Université Laval, Québec

~$ info
http://ase-research.org/basille

~$ fortune
``If you can't win by reason, go for volume.''
Calvin, by Bill Watterson.
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] Convert from character to timestamptz

2011-09-30 Thread Sandro Santilli
On Fri, Sep 30, 2011 at 12:33:30PM -0400, Mathieu Basille wrote:
> Dear Sandro,
> 
> You're right, I'm being too vague (in my defence, error messages are
> in French for me!).

See if exporting LANG=C helps there.

> Let's try to be more specific. Attached is a
> simple shapefile (4 points). It imports correctly with:
> 
> shp2pgsql -s 26919 -I test.shp test | psql -h localhost -d geodb -U
> caribou -q
> 
> Now, if I try:
> 
> SELECT TIMESTAMP WITH TIME ZONE 'date' FROM test;
> 
> I receive the following error:
> 
> ** Error **
> 
> ERREUR: syntaxe en entrée invalide pour le type timestamp with time
> zone : « date » [~ invalid syntax for the type timestamp with time
> zone]

Right, it's saying that 'date' (the string composed by 4 letters 'd', 'a',
't', 'e') is not a valid "timestamp with time" value...

> ALTER TABLE test
> ALTER COLUMN date SET DATA TYPE timestamptz;
> 
> the error is:
> 
> ** Error **
> 
> ERREUR: la colonne « date » ne peut pas être convertie vers le type
> timestamp with time zone [~ column 'date' can't be converted to type
> type timestamp with time zone]

Right, it wants to know how.

> And if I try what you suggested:
> 
> ALTER TABLE test
> ALTER COLUMN date TYPE timestamptz
> WITH date::timestamptz;
> 
> the error is:
> 
> ** Error **
> 
> ERREUR: erreur de syntaxe sur ou près de « WITH date » [~ syntax
> error on or near 'WITH date']

I was wrong about the syntax, but the idea is that you tell it
how to do the conversion. Maybe it was USING instead of WITH.
The definitive answer is in the PostgreSQL reference manual, under
the SQL section, in the ALTER TABLE syntax.

--strk;

  ()   Free GIS & Flash consultant/developer
  /\   http://strk.keybit.net/services.html
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] Convert from character to timestamptz

2011-09-30 Thread Mathieu Basille

Dear Sandro,

You're right, I'm being too vague (in my defence, error messages are in 
French for me!). Let's try to be more specific. Attached is a simple 
shapefile (4 points). It imports correctly with:


shp2pgsql -s 26919 -I test.shp test | psql -h localhost -d geodb -U 
caribou -q


Now, if I try:

SELECT TIMESTAMP WITH TIME ZONE 'date' FROM test;

I receive the following error:

** Error **

ERREUR: syntaxe en entrée invalide pour le type timestamp with time zone 
: « date » [~ invalid syntax for the type timestamp with time zone]

SQL state: 22007
Character: 33

With the command:

ALTER TABLE test
ALTER COLUMN date SET DATA TYPE timestamptz;

the error is:

** Error **

ERREUR: la colonne « date » ne peut pas être convertie vers le type 
timestamp with time zone [~ column 'date' can't be converted to type 
type timestamp with time zone]

SQL state: 42804

And if I try what you suggested:

ALTER TABLE test
ALTER COLUMN date TYPE timestamptz
WITH date::timestamptz;

the error is:

** Error **

ERREUR: erreur de syntaxe sur ou près de « WITH date » [~ syntax error 
on or near 'WITH date']

SQL state: 42601
Character: 61

Thanks again for your help!
Mathieu.



Le 30/09/2011 12:15, Sandro Santilli a écrit :

On Fri, Sep 30, 2011 at 12:10:00PM -0400, Mathieu Basille wrote:

Dear PostGIS users,

I've been trying for hours with no result... My problem is that I
import a simple shapefile (points) to PostGIS using shp2pgsql. In
the attribute table, there is a 'date' column formatted as
'2005-03-20 00:00:00 EST5EDT'. This column is then imported as a
'character' column into PostGIS. Now, I'd like to convert this
column to a real 'timestamp with time zone'. I tried many things
like:

ALTER TABLE test
 ALTER COLUMN date SET DATA TYPE timestamptz;

or

SELECT TIMESTAMP WITH TIME ZONE 'date' FROM test;

and all return an error


You should report the error, when you get one.
I can just "guess" that the second is invalid syntax as you're
using the literal string 'date' rather than the identifier "date".
And I can "guess" that the first is a syntax error (but I'm not sure).
I'd write the first as:

  ALTER TABLE test
ALTER COLUMN date TYPE timestamptz
WITH date::timestamptz;

Or something like that (but would really first lookup the reference).

--strk;

   ()   Free GIS&  Flash consultant/developer
   /\   http://strk.keybit.net/services.html
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


--

~$ whoami
Mathieu Basille, Post-Doc

~$ locate
Laboratoire d'Écologie Comportementale et de Conservation de la Faune
+ Centre d'Étude de la Forêt
Département de Biologie
Université Laval, Québec

~$ info
http://ase-research.org/basille

~$ fortune
``If you can't win by reason, go for volume.''
Calvin, by Bill Watterson.


test.dbf
Description: application/dbf


test.shp
Description: application/esri-shape


test.shx
Description: application/esri-shape
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] Convert from character to timestamptz

2011-09-30 Thread Sandro Santilli
On Fri, Sep 30, 2011 at 12:10:00PM -0400, Mathieu Basille wrote:
> Dear PostGIS users,
> 
> I've been trying for hours with no result... My problem is that I
> import a simple shapefile (points) to PostGIS using shp2pgsql. In
> the attribute table, there is a 'date' column formatted as
> '2005-03-20 00:00:00 EST5EDT'. This column is then imported as a
> 'character' column into PostGIS. Now, I'd like to convert this
> column to a real 'timestamp with time zone'. I tried many things
> like:
> 
> ALTER TABLE test
> ALTER COLUMN date SET DATA TYPE timestamptz;
> 
> or
> 
> SELECT TIMESTAMP WITH TIME ZONE 'date' FROM test;
> 
> and all return an error

You should report the error, when you get one.
I can just "guess" that the second is invalid syntax as you're 
using the literal string 'date' rather than the identifier "date".
And I can "guess" that the first is a syntax error (but I'm not sure).
I'd write the first as:

 ALTER TABLE test
   ALTER COLUMN date TYPE timestamptz
   WITH date::timestamptz;

Or something like that (but would really first lookup the reference).

--strk;

  ()   Free GIS & Flash consultant/developer
  /\   http://strk.keybit.net/services.html
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


[postgis-users] Convert from character to timestamptz

2011-09-30 Thread Mathieu Basille

Dear PostGIS users,

I've been trying for hours with no result... My problem is that I import 
a simple shapefile (points) to PostGIS using shp2pgsql. In the attribute 
table, there is a 'date' column formatted as '2005-03-20 00:00:00 
EST5EDT'. This column is then imported as a 'character' column into 
PostGIS. Now, I'd like to convert this column to a real 'timestamp with 
time zone'. I tried many things like:


ALTER TABLE test
ALTER COLUMN date SET DATA TYPE timestamptz;

or

SELECT TIMESTAMP WITH TIME ZONE 'date' FROM test;

and all return an error, while e.g.:

SELECT TIMESTAMP WITH TIME ZONE '2005-03-20 00:00:00 EST5EDT';

perfectly works... I also tried:

SELECT to_timestamp(date, '-MM-DD HH24:MI:SS TZ') FROM test;

which also returns an error stating that 'TZ'/'tz' are unsupported in 
'to_date' (!). It works without the 'TZ', but I really need the timezone...


I have to admit I'm now totally in the dark and feel I really miss 
something obvious. This might be a strict PostgreSQL question... In this 
case, I apologize, as I couldn't find my answers either after reading 
several times the doc on date/time for PostgreSQL...


Thanks for any hint!

All the best,
Mathieu.


--

~$ whoami
Mathieu Basille, Post-Doc

~$ locate
Laboratoire d'Écologie Comportementale et de Conservation de la Faune
+ Centre d'Étude de la Forêt
Département de Biologie
Université Laval, Québec

~$ info
http://ase-research.org/basille

~$ fortune
``If you can't win by reason, go for volume.''
Calvin, by Bill Watterson.
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] Need help : Getting Started to PostGIS

2011-09-30 Thread Mathieu Basille
You can have a look here for a complete install of PostGIS 2.0, with the 
ability to store/manage rasters:


http://gis4free.wordpress.com/2011/03/10/how-to-install-and-configure-postgis-raster-on-windows/

Mathieu.


Le 30/09/2011 03:02, Ben Madin a écrit :

Wendi

Check the book at this site.

http://www.manning.com/obe/

or google postgisonline

cheers

Ben

On 30/09/2011, at 2:08 PM, Wendi Adrian wrote:


Hi everyone,

I am newbie in using PostGIS database and want to build GIS database
using PostGIS and PostgreSQL.
Can anyone help me what step to build GIS database using PostGIS?
I already downloaded installer.
Please help me,

Regards,

Wendi
___
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


--

~$ whoami
Mathieu Basille, Post-Doc

~$ locate
Laboratoire d'Écologie Comportementale et de Conservation de la Faune
+ Centre d'Étude de la Forêt
Département de Biologie
Université Laval, Québec

~$ info
http://ase-research.org/basille

~$ fortune
``If you can't win by reason, go for volume.''
Calvin, by Bill Watterson.
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] Need help : Getting Started to PostGIS

2011-09-30 Thread Ben Madin
Wendi

Check the book at this site.

http://www.manning.com/obe/

or google postgisonline

cheers

Ben

On 30/09/2011, at 2:08 PM, Wendi Adrian wrote:

> Hi everyone,
> 
> I am newbie in using PostGIS database and want to build GIS database using 
> PostGIS and PostgreSQL.
> Can anyone help me what step to build GIS database using PostGIS?
> I already downloaded installer.
> Please help me,
> 
> Regards,
> 
> Wendi
> ___
> 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