Ari Jolma | 3 Mar 2008 18:53
Picon

Strange problem in classroom usage of PostGIS and GDAL

Hi,

Sorry for x-posting.

I've been running a course on a Windows classroom, teaching spatial SQL. 
It's mainly based on Paul Ramsey's excellent "Introduction in PostGIS" 
exercises that I've pulled out from Lausanne website. The client the the 
students use is mostly PgAdmin but Quantum GIS and Geoinformatica 
(GDAL+Perl+GTK, my own stack) is used in the last steps instead of 
Mapserver as in Paul's paper. The databases (each student has her own) 
are on a Linux server.

On some cases the data retrieval from the base to the GIS clients 
(PgAdmin seems to be ok) fails. The schema is retrieved (also the number 
of features is ok) ok but the data just does not appear - i.e. the OGR 
Layer is empty. In a couple of cases no data at all is shown, and in 
some cases full layers are ok but layers with SQL do not show. The 
behavior is quite puzzling and I can't explain it. I and the students 
who have been affected have checked rights, srids etc. many times. In a 
case I tried to pull data from my own database with my own user id into 
a student's session, and it did not work. In my own session I haven't 
noticed any problems. The problem seems to be with certain windows-sessions.

In first sessions I hit the max connections limit on the database but 
that was easy to fix.

Are there any situations, where GDAL don't get data from a remote 
PostGIS but it does not issue warnings?

Regards,
(Continue reading)

Stephen Crawford | 3 Mar 2008 21:02
Picon
Gravatar

RE: shp2pgsql not loading table in Postgis

I have had the same problem; it seems having to add the password screws things up.  Instead of making the sql and loading the table all in one step (as you are trying to do), try it in two steps:
 
1) Make the sql:   shp2pgsql.exe -s 4148 c:\province.shp province > province.sql
 
2) log in to psql and then use the \i command to load the table:  \i province.sql
 
 
Steve
 

Stephen Crawford
Center for Environmental Informatics
The Pennsylvania State University

 

 

From: postgis-users-bounces <at> postgis.refractions.net [mailto:postgis-users-bounces <at> postgis.refractions.net] On Behalf Of Intengu Technologies
Sent: Thursday, February 28, 2008 1:47 PM
To: PostGIS Users Discussion
Subject: [postgis-users] shp2pgsql not loading table in Postgis

I am running Windows with Postgis 1.3.2 (installed using Appication Stack Builder) on Postgresql 8.3 on running shp2pgsql.exe -s 4148 c:\province.shp province | psql -d spatialdb -U username and then entering password, the table is not loaded.  What could I be doing wrong.
--
Sindile Bidla
_______________________________________________
postgis-users mailing list
postgis-users <at> postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users
Paul Ramsey | 1 Mar 2008 20:19
Picon
Gravatar

Re: need PostGIS binaries for Fedora 8.x

Paul,

No binaries available -- supporting every Linux distribution would  
quickly become onerous. Fortunately, it is easy to build! Easy!

On Feb 20, 2008, at 10:43 AM, Paul McCullough wrote:

> All,
> I want to run PostgresQL/PostGIS on Fedora 8.3 (or 8.x).
> I see the PostgresQL binaries here
>    http://www.postgresql.org/ftp/binary/v8.3.0/linux/rpms/fedora/
> Do those binaries contain PostGIS? (unable to inspect right now)

1. No, they don't. However, install them, and the -devel variants and  
you can move on the step 2.

> I am concerned about having to do a build.
> Should I be?

2. No! Some of the coolest people in the world build their own  
software from source. Britney Spears, Paris Hilton, that guy from  
Survivor! OK, some people in the world build their own software from  
source. I hear George Clooney is thinking about it.

> Factors in this decision:
> - I am not under hard deadline.

Great!

> - I have zero linux experience

Time to get some!

> - I am enthused about linux

Even better!

> - I will be the linux admin! (I have no expert in house)

See above!

> - I have a solid unix user background (non-admin)

Could you be any better looking? Are you seeing someone? Call me.

> - I am a competant java developer

OK, well, five out of six ain't bad.

3. You need to get the libraries PostGIS depends on first.  Your first  
compilation will be a baptism of FIRE! Download GOES from http://geos.refractions.net 
. Download Proj4 from http://proj.maptools.org.

4. Let's go Proj4 first.
- tar xvfz proj-4.6.0.tar.gz
- cd proj-4.6.0
- ./configure
- make
- su
- make install
- exit

5. Take a shot!

6. Let's go some GEOS!
- bunzip2  geos-3.0.0.tar.bz2
- tar xvf geos-3.0.0.tar
- cd geos-3.0.0
- ./configure
- make
- su
- make install
- exit

7. Take a shot!

8. You see how this is going now...

9. PostGIS time!
- tar xvfz postgis-1.3.1.tar.gz
- cd postgis-1.3.1
- ./configure --with-pgsql=pg_config --with-geos=/usr/local/bin/geos- 
config --with-proj=/usr/local
- make
- su
- make install
- exit

10. Take a shot!

11. Make a database!
- createdb mydatabase
- createlang plpgsql mydatabase
- psql -f /usr/local/pgsql/share/contrib/lwpostgis.sql -d mydatabase
- psql -f /usr/local/pgsql/share/contrib/spatial_ref_sys.sql -d  
mydatabase
- psql mydatabase

12. Finish the bottle!

13. Sleep it off. Take an aspirin in the morning and have a glass of  
orange juice.

Yours,

Paul
Paul Ramsey | 3 Mar 2008 20:21
Picon
Gravatar

Re: shp2pgsql not loading table in Postgis

Sometimes the pipe operation ain't great on Windows, try doing it in two steps

shp2psql > file.sql
psql -f file.sql

On 2/28/08, Intengu Technologies <sindile.bidla <at> gmail.com> wrote:
> I am running Windows with Postgis 1.3.2 (installed using Appication Stack
> Builder) on Postgresql 8.3 on running shp2pgsql.exe -s 4148 c:\province.shp
> province | psql -d spatialdb -U username and then entering password, the
> table is not loaded.  What could I be doing wrong.
>  --
> Sindile Bidla
> _______________________________________________
>  postgis-users mailing list
>  postgis-users <at> postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
>
Simon Schneider | 2 Mar 2008 09:51
Picon
Picon

How to select the highest y-value within all stored objects

Hi,

I have a table storing polygon objects and I'm looking for a way to get 
the highest y-coordinate within all these objects.

I know which polygon contains this value but I'm wondering whether there 
is a way to build a query which delivers only coordinates and not the 
polygon itself.

Cheers,
Simon
Nicolas Ribot | 3 Mar 2008 08:30
Picon

Re: problem on srid

> hello
>
>  how can I correct this situation:
>
>  bzk2=# select srid(geom) from shey91 limit 1;
>   srid
>  -------
>   32767
>  (1 row)
>
>  bzk2=# update shey91 set geom=ST_TRANSFORM(setsrid(geom,32767),32636);
>  ERROR:  AddToPROJ4SRSCache: Cannot find SRID (32767) in spatial_ref_sys
>

Check if spatial_ref_sys table contains entries, if not, re-run
spatial_ref_sys.sql on your database to populate it.

Nicolas
Paul Ramsey | 3 Mar 2008 20:50
Picon
Gravatar

Re: Wiki is broken

It's back, FYI, having some fun w/ servers this week.

On 2/28/08, Colin Wetherbee <cww <at> denterprises.org> wrote:
> FYI, the wiki is broken.
>
>  http://postgis.refractions.net/support/wiki/
>
>  "Cannot establish connection to database, giving up."
>
>  Just when I was going to add something, too. ;)
>
>  Colin
>  _______________________________________________
>  postgis-users mailing list
>  postgis-users <at> postgis.refractions.net
>  http://postgis.refractions.net/mailman/listinfo/postgis-users
>
Steven De Vriendt | 3 Mar 2008 22:19
Picon

Re: shp2pgsql not loading table in Postgis

Another addition to this (bit off topic, though): sometimes you have to run a command twice in
order to get a command executed. It happens that when the initial
command is executed, Postgres/PostGIS throws an error. When running
the command for the second time, all is ok..
:-)


On Mon, Mar 3, 2008 at 10:09 PM, Steven De Vriendt <gisaalter <at> gmail.com> wrote:
In addition to that, using the latest release of Postgres I had to rename
libiconv2.dll to libiconv-2.dll in order to use shp2pgsql in Windows Vista.
Whitout renaming, shp2pgsql crashes on this dll

Steven


On Mon, Mar 3, 2008 at 8:21 PM, Paul Ramsey <pramsey <at> cleverelephant.ca> wrote:
Sometimes the pipe operation ain't great on Windows, try doing it in two steps

shp2psql > file.sql
psql -f file.sql

On 2/28/08, Intengu Technologies <sindile.bidla <at> gmail.com> wrote:
> I am running Windows with Postgis 1.3.2 (installed using Appication Stack
> Builder) on Postgresql 8.3 on running shp2pgsql.exe -s 4148 c:\province.shp
> province | psql -d spatialdb -U username and then entering password, the
> table is not loaded.  What could I be doing wrong.
>  --
> Sindile Bidla
> _______________________________________________
>  postgis-users mailing list
>  postgis-users <at> postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
>
_______________________________________________
postgis-users mailing list
postgis-users <at> postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


_______________________________________________
postgis-users mailing list
postgis-users <at> postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users
Mark Cave-Ayland | 3 Mar 2008 22:32
Picon

Re: Wiki is broken

On Monday 03 March 2008 19:50:58 Paul Ramsey wrote:
> It's back, FYI, having some fun w/ servers this week.

Does that include rebuilding them so that we can use trac as the PostGIS
bugtracker? ;)

ATB,

Mark.

--

-- 
Mark Cave-Ayland
Sirius Corporation - The Open Source Experts
http://www.siriusit.co.uk
T: +44 870 608 0063
Martin Davis | 3 Mar 2008 22:31
Favicon

Re: Projection for Calculating Area

Andrew,

Dang... we were hoping no-one would bring that up...

You're absolutely right, in a theoretical sense.  If you need to process 
global-scale data, the cleanest way to do it is to process the data 
using pure geographic coordinates (this is usually called a "geodetic" 
model). 

The reason that a lot of systems still use a planar assumption is that 
the algorithms for geodetic are substantially more complex to design and 
implement, and there are even fewer sources for these algorithms than 
for planar algorithms.  Spatial databases are only just starting to 
offer geodetic as a fully-featured datatype.  Oracle, IBM and MS 
SqlServer all provide this now (with varying degrees of usability). 

The hope is that PostGIS will support geodetic as well at some point - 
but unless some big sugar-daddy pops up with a whack of funding, this is 
likely to be later rather than sooner.

J. Andrew Rogers wrote:
>
>
> Isn't this largely a fundamental issue because, for good historical 
> reasons, we do geometry computations on 2-dimensional projections of a 
> complex object in 3-space?  Your point is absolutely correct, but I 
> have always been interested in the reasons why geospatial is still 
> computed almost purely from projections in the computer age.  (Not to 
> hijack the thread, but I have always been genuinely curious about 
> this; most of the underlying rationale seems suspect for an increasing 
> number of computer-based applications.)
>
> Cheers,
>
> J. Andrew Rogers
>
> _______________________________________________
> postgis-users mailing list
> postgis-users <at> postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>

--

-- 
Martin Davis
Senior Technical Architect
Refractions Research, Inc.
(250) 383-3022

Gmane