[postgis-users] spaces between tiles

2012-05-31 Thread Joan
Hi guys,

I have just run the st_hillshade function. A row of pixels around the
resulting raster are missing, causing spaces between tiles.

What could be the problem?

Regards

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


Re: [postgis-users] spaces between tiles

2012-05-31 Thread Pierre Racine
Joan,

The ST_HillShade function does not support tiled coverage...

Depending on how big is your coverage (how many pixels by how many pixels) you 
could import it non tiled and then use ST_Tile to tile in the DB. 

ST_Tile is not part of PostGIS 2.0. You will find it here:

http://trac.osgeo.org/postgis/browser/trunk/raster/scripts/plpgsql/st_tile.sql

Pierre

 -Original Message-
 From: postgis-users-boun...@postgis.refractions.net [mailto:postgis-users-
 boun...@postgis.refractions.net] On Behalf Of Joan
 Sent: Thursday, May 31, 2012 11:53 AM
 To: PostGIS Users Discussion
 Subject: [postgis-users] spaces between tiles
 
 Hi guys,
 
 I have just run the st_hillshade function. A row of pixels around the 
 resulting
 raster are missing, causing spaces between tiles.
 
 What could be the problem?
 
 Regards
 
 Joan
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] spaces between tiles

2012-05-31 Thread Joan
Pierre,

It is a huge coverage, I am using the function just for evaluation of
postgis raster. So, I can work with the results I have gotten.

Thank you.

Joan

On 31 May 2012 17:57, Pierre Racine pierre.rac...@sbf.ulaval.ca wrote:

 Joan,

 The ST_HillShade function does not support tiled coverage...

 Depending on how big is your coverage (how many pixels by how many pixels)
 you could import it non tiled and then use ST_Tile to tile in the DB.

 ST_Tile is not part of PostGIS 2.0. You will find it here:


 http://trac.osgeo.org/postgis/browser/trunk/raster/scripts/plpgsql/st_tile.sql

 Pierre

  -Original Message-
  From: postgis-users-boun...@postgis.refractions.net [mailto:
 postgis-users-
  boun...@postgis.refractions.net] On Behalf Of Joan
  Sent: Thursday, May 31, 2012 11:53 AM
  To: PostGIS Users Discussion
  Subject: [postgis-users] spaces between tiles
 
  Hi guys,
 
  I have just run the st_hillshade function. A row of pixels around the
 resulting
  raster are missing, causing spaces between tiles.
 
  What could be the problem?
 
  Regards
 
  Joan
 ___
 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] Ubuntu and Postgresql9.1.3-2

2012-05-31 Thread Smaran Harihar
Hi Jeff,

I removed all the packages you asked me to and then reinstalled the
postgis-2.0 from
herehttp://trac.osgeo.org/postgis/wiki/UsersWikiPostGIS20Ubuntu1204#a44BuildPostGIS.
the reason I started there is because, postgres-9.1 was already present.
After re-installing the postgis, I tried using the `psql` command but I am
getting the following error,

psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket /var/run/postgresql/.s.PGSQL.5432?

And when I opened pgadmin3, it said that it could not connect to a server.

Server doesn't listen
The server doesn't accept connections: the connection library reports
could not connect to server: Connection refused Is the server running on
host localhost (127.0.0.1) and accepting TCP/IP connections on port 5432?

 It seems that the geoserver got uninstalled when I executed,

apt-get auto remove

So now, I re-installed it, I am still not able to use psql or pgadmin3. I
also tried restarting the postgres, using

service postgres restart

and I received the following error,

* Error: You must run this program as the cluster owner (postgres)

On Wed, May 30, 2012 at 11:32 AM, Jeff Meyer j...@gwhat.org wrote:

 Hi Smaran -

 You actually do have geonode installed if you installed opengeo-suite.
 The link I pointed you to below shows all of the packages installed with
 opengeo-suite  geonode is the second item listed:
 http://apt.opengeo.org/ubuntu/dists/lucid/main/binary-amd64/Packages

 Geonode is really the heart of the entire opengeo suite.

 Here's what I did:
 ** removed the opengeo repository link in /etc/apt/sources.list
 then
 sudo apt-get remove opengeo-suite
 sudo apt-get remove postgresql-8.4
 sudo apt-get remove opengeo-postgis

 Then, I went in and reinstalled postgis 2.0 using the instructions on the
 wiki (the instructions you used before).

 Then, I installed the alpha version of Geonode, using the link provided
 below. (http://geonode.org/)

 Hack away at that a little bit  I bet you can get going again.

 Good luck!
 Jeff




   --
 *From:* Smaran Harihar smaran.hari...@gmail.com
 *To:* Jeff Meyer j...@gwhat.org
 *Sent:* Wednesday, May 30, 2012 9:47 AM

 *Subject:* Re: [postgis-users] Ubuntu and Postgresql9.1.3-2

 Hi Jeff,

 Hi Smaran -
 Can you double-check your version of gdal?
 What happens when you type:
 # gdal-config
 ?

 gdal version - 1.9.0

 At present I am not using Geonode.

 Also you were right I think opengeo has overwritten my postgis. Here is
 the output.


  dpkg -s postgis
 Package: postgis
 Status: install ok installed
 Priority: optional
 Section: misc
 Installed-Size: 2092
 Maintainer: Debian GIS Project pkg-grass-de...@lists.alioth.debian.org
 Architecture: amd64
 Version: 1.5.4-1+opengeo
 Depends: libatk1.0-0 (= 1.29.3), libc6 (= 2.4), libcairo2 (= 1.2.4),
 libfontconfig1 (= 2.8.0), libfreetype6 (= 2.2.1), libglib2.0-0 (=
 2.16.0), libgtk2.0-0 (= 2.8.0), libpango1.0-0 (= 1.14.0), libpq5 (=
 8.4~0cvs20090328)
 Suggests: postgresql-8.4-postgis
 Description: geographic objects support for PostgreSQL -- common files
  PostGIS adds support for geographic objects to the PostgreSQL
 object-relational
  database. In effect, PostGIS spatially enables the PostgreSQL server,
  allowing it to be used as a backend spatial database for geographic
 information
  systems (GIS), much like ESRI's SDE or Oracle's Spatial extension. PostGIS
  follows the OpenGIS Simple Features Specification for SQL.
  .
  This package contains the PostGIS userland binaries, common files and
  documentation.
 Homepage: http://postgis.refractions.net/

 So what should i do now?

 Thanks  Regards,
 Smaran Harihar


 On Wed, May 30, 2012 at 8:30 AM, Jeff Meyer j...@gwhat.org wrote:

 Hi Smaran -
 Can you double-check your version of gdal?
 What happens when you type:
 # gdal-config
 ?

 Keep in mind, the latest version of PostGIS wants you to be using GDAL 1.9.

 Also, on the Geonode web page, it says that past versions of Geonode -
 that is, the one that comes with opengeo suite - is not compatible with
 Ubuntu 12.04. See: http://geonode.org/

 GeoNode 1.2 will be the first release compatible with Ubuntu 11.10 and
 12.04 (while maintaining compatibility with Ubuntu releases after 10.04).
 Please note that this alpha in particular has only been tested in 12.04, we
 appreciate your feedback in identifying potential issues in other
 distributions. Issue reports may be filed on the GeoNode Github 
 projecthttp://github.com/geonode/geonodeor reported on the GeoNode users
 forum https://groups.google.com/forum/#%21forum/geonode-users.

 Also - double-check which version of postgis is running - opengeo-suite
 may have overwritten PostGIS 2.0... it did for me. : )

 jeffme@jeffme-vbox:~$ dpkg -s postgis
 Package: postgis
 Status: install ok installed
 Priority: optional
 Section: misc
 Installed-Size: 2092
 Maintainer: Debian GIS Project 

[postgis-users] Can't figure out query to find lat/lon (numeric types) in time zone (geometry type). New to GIS.

2012-05-31 Thread Scott Chapman
I have the following table for time zone data:

CREATE TABLE tz_world
(
  gid serial NOT NULL,
  tzid character varying(30),
  the_geom geometry,
  CONSTRAINT tz_world_pkey PRIMARY KEY (gid ),
  CONSTRAINT enforce_dims_the_geom CHECK (st_ndims(the_geom) = 2),
  CONSTRAINT enforce_geotype_the_geom CHECK (geometrytype(the_geom) =
'MULTIPOLYGON'::text OR the_geom IS NULL),
  CONSTRAINT enforce_srid_the_geom CHECK (st_srid(the_geom) = (-1))
)

and a location table:

CREATE TABLE locations
(
  id bigserial NOT NULL,
  latitude numeric,
  longitude numeric,
)

Given a location id, I want to know what time zone it's in.  I'm brand new
to GIS and have not been able to figure out this query. I have PostgreSQL
9.1 and PostGIS 1.5.3 installed and set up, and the timezone data imported
using the shape file import wizard.

Can someone please give me an example of how to query lat/lon in the_geom?

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


Re: [postgis-users] Can't figure out query to find lat/lon (numeric types) in time zone (geometry type). New to GIS.

2012-05-31 Thread Paul Ramsey
select tz.tzid
from tz_world tz, locations locs
where st_contains(tz.the_geom, st_makepoint(locs.longitude, locs.latitude))
and loc.id = ?;


On Thu, May 31, 2012 at 12:57 PM, Scott Chapman sc...@mischko.com wrote:
 I have the following table for time zone data:

 CREATE TABLE tz_world
 (
   gid serial NOT NULL,
   tzid character varying(30),
   the_geom geometry,
   CONSTRAINT tz_world_pkey PRIMARY KEY (gid ),
   CONSTRAINT enforce_dims_the_geom CHECK (st_ndims(the_geom) = 2),
   CONSTRAINT enforce_geotype_the_geom CHECK (geometrytype(the_geom) =
 'MULTIPOLYGON'::text OR the_geom IS NULL),
   CONSTRAINT enforce_srid_the_geom CHECK (st_srid(the_geom) = (-1))
 )

 and a location table:

 CREATE TABLE locations
 (
   id bigserial NOT NULL,
   latitude numeric,
   longitude numeric,
 )

 Given a location id, I want to know what time zone it's in.  I'm brand new
 to GIS and have not been able to figure out this query. I have PostgreSQL
 9.1 and PostGIS 1.5.3 installed and set up, and the timezone data imported
 using the shape file import wizard.

 Can someone please give me an example of how to query lat/lon in the_geom?

 Thanks!
 Scott

 ___
 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] Can't figure out query to find lat/lon (numeric types) in time zone (geometry type). New to GIS.

2012-05-31 Thread Scott Chapman
Thanks Paul!

On Thu, May 31, 2012 at 1:12 PM, Paul Ramsey pram...@opengeo.org wrote:

 select tz.tzid
 from tz_world tz, locations locs
 where st_contains(tz.the_geom, st_makepoint(locs.longitude, locs.latitude))
 and loc.id = ?;


 On Thu, May 31, 2012 at 12:57 PM, Scott Chapman sc...@mischko.com wrote:
  I have the following table for time zone data:
 
  CREATE TABLE tz_world
  (
gid serial NOT NULL,
tzid character varying(30),
the_geom geometry,
CONSTRAINT tz_world_pkey PRIMARY KEY (gid ),
CONSTRAINT enforce_dims_the_geom CHECK (st_ndims(the_geom) = 2),
CONSTRAINT enforce_geotype_the_geom CHECK (geometrytype(the_geom) =
  'MULTIPOLYGON'::text OR the_geom IS NULL),
CONSTRAINT enforce_srid_the_geom CHECK (st_srid(the_geom) = (-1))
  )
 
  and a location table:
 
  CREATE TABLE locations
  (
id bigserial NOT NULL,
latitude numeric,
longitude numeric,
  )
 
  Given a location id, I want to know what time zone it's in.  I'm brand
 new
  to GIS and have not been able to figure out this query. I have PostgreSQL
  9.1 and PostGIS 1.5.3 installed and set up, and the timezone data
 imported
  using the shape file import wizard.
 
  Can someone please give me an example of how to query lat/lon in
 the_geom?
 
  Thanks!
  Scott
 
  ___
  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] Proposal for a new function ST_GeogFromLatLon

2012-05-31 Thread Javier de la Torre
Hi all,

We are having lot of new web developers coming to use PostGIS and thats great! 
One of the first barries I know some people have is how complicate is to create 
a point on PostGIS. Basically you need to know:

1) In PostGIS first comes Longitude, then Latitude
2) You have to specify an srid, which most people havent heard of

So what I would consider a trivial query looks like this:

SELECT * FROM mytable WHERE the_geom  ST_SetSRID(ST_MakePoint(-123.0,34),4326)

I propose to have a wrapper function called ST_GeogFromLatLon or something 
similar so that we can do:

SELECT * FROM mytable WHERE the_geom  ST_GeogFromLatLon(34,-123.0)

The ST_GeogFromLatLon will imply 4326 SRID. And the return could be geography, 
as it cast well to geometry, so it will work in most cases.

I know is not such a big difference, but I think it will help a lot new people 
and will also make our queries look much better in some scenarios. In my 
experiences when teaching postgis this is kind of annoying having to go through 
it.

Does this break the entire GIS world? :D
Just kidding.

Javier de la Torre
@jatorre

Vizzuality
148 Lafayette St. PH, New York, 10013,USA
+1 347 320 7715
www.vizzuality.com

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


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

2012-05-31 Thread David B�langer

Hi Jorge,
Did you receive my email with the files requested? I used an other adresse to 
send you the files.

David

 From: jorgearev...@libregis.org
 Date: Mon, 28 May 2012 10:07:09 +0200
 To: postgis-users@postgis.refractions.net
 Subject: Re: [postgis-users] PostGis Raster and GDAL 1.9
 
 Hi,
 
 David, could you please attach the original files? Seems to be a
 problem with the way the driver gets the origin of the raster
 coverage, yes.
 
 The code in GDAL trunk is under development. Slowness problem is one
 of the reasons.
 
 Best regards,
 Jorge
 
 On Tue, May 22, 2012 at 7:01 PM, David B�langer belanger_da...@live.ca 
 wrote:
  Hi,
  I did tests and all gave the result expected. It seem to be a problem with
  the origin of the result file (see attached file). The application has taken
  the origin of the file 056n05_0100_deme.tif instead of the origin of the
  file 056n05_0100_demw.tif. What do you think ?
 
  For your information the files are in geographic coordinate system.
 
  David
 
  From: pierre.rac...@sbf.ulaval.ca
  To: postgis-users@postgis.refractions.net
  Date: Tue, 22 May 2012 11:37:03 -0400
 
  Subject: Re: [postgis-users] PostGis Raster and GDAL 1.9
 
  I would maybe do some tests:
 
  1) Remove the -a_nodata -32767 parameter. Why did you have to set it? Is
  the nodata set properly in PostGIS for all rows?
 
  2) Extract one file at a time with mode=2 and then with mode=1
 
  Pierre
 
   -Original Message-
   From: postgis-users-boun...@postgis.refractions.net
   [mailto:postgis-users-
   boun...@postgis.refractions.net] On Behalf Of David B?langer
   Sent: Tuesday, May 22, 2012 10:25 AM
   To: postgis-users@postgis.refractions.net
   Subject: Re: [postgis-users] PostGis Raster and GDAL 1.9
  
   Hi Pierre,
   Yes I have a unique rid (Integer) with sequential number. I used the
   tool
   raster2pgsql.exe to upload the data in the database. I uploaded 2 files
  
   056n05_0100_deme.tif
   056n05_0100_demw.tif
  
   C:\Program Files\PostgreSQL\9.1\bin\raster2pgsql.exe -I -e -Y -F -s
   4269
   e:\dir\*.tif dbelange.elevationTest | psql.exe -U myuser -d myDB -h
   myhost -p
   14070
  
   I used this command to extract data:
   C:\Program Files\GDAL\gdal_translate -a_nodata -32767 -of GTIFF
   PG:host=myhost port=14070 dbname='myDB' user='myuser'
   password='mypassword' schema='dbelange' table='elevationTest' mode=2
   where=\filename LIKE \'%056n05%\'\  056N05_testGDAL1.9.tif
  
   Like I said it’s working very well with gdal 1.8
  
   I can send you the 2 files If you want to try on your side.
  
   Do you have another idea?
  
   David
  
  
From: pierre.rac...@sbf.ulaval.ca
To: postgis-users@postgis.refractions.net
Date: Sat, 19 May 2012 13:55:47 -0400
Subject: Re: [postgis-users] PostGis Raster and GDAL 1.9
   
Hi David,
   
Do you have a rid column in your table with unique values?
   
Pierre
   
 -Original Message-
 From: postgis-users-boun...@postgis.refractions.net
 [mailto:postgis-users-
 boun...@postgis.refractions.net] On Behalf Of David B?langer
 Sent: Thursday, May 17, 2012 8:13 PM
 To: postgis-users@postgis.refractions.net
 Subject: [postgis-users] PostGis Raster and GDAL 1.9

 Hi,
 I stored DEM raster data in PostGIS 2.0 and I used gdal_translate
 (with
   mode=2)
 to extract a mosaic of tiles. When I’m using GDAL 1.8 is working but
 when
   I’m
 using GDAL 1.9 I can see the values of pixel for just one tile. For
 example I
 uploaded in the database a tile with an attribute filename=056n05_w
 and an
 other tile with an filename=056n05_e and I executed the command with
   GDAL
 1.8 and GDAL 1.9:

 gdal_translate -a_nodata -32767 -of GTIFF PG:host=myhost
 port=14070
 dbname='mybd' user='myuser' password='mypassword'
 schema='myschema'table='Elevation' mode=2 where=\filename LIKE
 \'%056n05%\'\  056N05.tif

 With GDAL 1.8 I obtained a mosaic of 2 tiles (the result expected)
 but with
   GDAL
 1.9, I obtained a raster with the same extent but only the values of
 the tile
 056n05_w are present. The pixels of the tile 056n05_w have a value
 0.

 I tried the stable version 1.9 MSVC2008 (Win32) and development
 version
 available today at http://www.gisinternals.com/sdk/

   https://email.nrcan.gc.ca/owa/redir.aspx?C=OzXx4wlk90m3TV7W8fzG7_FxObj

   PB88I1bAwXOtZColSmDyhIvj_1yhbCVJUJ0vrnCWWTuivB9Y.URL=http://www.g
 isinternals.com/sdk/ and I have still the same problem. For your
   information,
 I'm running GDAL on windows7 and PostGIS 2.0 is installed on a Linux
 server.
   I
 tried many version of GDAL 1.9 and I always have the same problem.
 The
   version
 1.8 is working very well but I would like to take advantage of the
   improvements
 in the last version because I'm working on a project where
 processing time is
 very important.