[postgis-users] Missing template_postgis file

2011-08-14 Thread b...@brucecallander.com
I have downloaded and installed PostGIS 1.5 on my MacBook Pro running Snow 
Leopard v10.6.8 (having pre-installed Postgres 9.0, Geo 3, Proj ..)

I am using the Getting Started instructions in Geoserver in order to create a 
PostGIS table, but I have been unable to create a test database using the 
template 'template_postgis'.  The system can't find the template file.  I have 
searched for the file 'template_postgis' using the Unix 'locate' command but 
without success. 

I have searched the web to see if I can download 'template_postgis' on its own 
but found nothing.

Grateful for any advice. Please note that I am relatively new to Unix on the 
Mac so don't assume too much background knowledge.

Bruce Callander

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


[postgis-users] Difficulty importing example file nyc_buildings.sql

2011-08-15 Thread b...@brucecallander.com
I am following the Geoserver Getting Started documentation in order to create 
an example PostGIS table.

I am working on a MacBook running Snow Leopard v10.6.8

Thanks to previous advice from the forum (Nicolas Ribot) I was able to create 
the sample database 'nyc' based on the template 'template_postgis'.

I am now encountering errors in trying to move to the next stage of importing 
the file 'nyc_buildings.sql' into the database.

The Unix command I am using is:

$ /usr/local/pgsql-9.0/bin/psql -f /Users/bacmac/nyc_buildings.sql nyc 

The Geoserver instructions are not explicit about where to put the 
nyc_buildings.sql file so I have left it in my own user directory 'bacmac'.

Execution of the command produces a string of errors beginning with:

CREATE TABLE
psql:/Users/bacmac/nyc_buildings.sql:4: ERROR:  function 
addgeometrycolumn(unknown, unknown, unknown, unknown, unknown, integer) does 
not exist
LINE 1: SELECT AddGeometryColumn('','nyc_buildings','the_geom','2908...
HINT:  No function matches the given name and argument types. You might need to 
add explicit type casts.
psql:/Users/bacmac/nyc_buildings.sql:5: ERROR:  current transaction is aborted, 
commands ignored until end of transaction block
psql:/Users/bacmac/nyc_buildings.sql:6: ERROR:  current transaction is aborted 
... and so on.


I realise that part of my difficulties stem from a lack of conceptual awareness 
of how the various parts of PostGIS fit together (databases, data stores, 
tables, clusters...) and what directory structure the PostGIS installation 
creates. I am very familiar with Access databases but that may be dangerous 
because the basic paradigm for PostGIS may be different. Are there any diagrams 
out there that give a basic conceptual view of Geoserver and PostIGIS? Also, I 
am coming at this from an enterprise SDI policy and implementation end, not 
from an IT/Unix background (probably very obvious!). Trying to construct a 
coherent overall picture based on the predominantly text-based, IT-heavy advice 
online is proving a challenge.

Many thanks 

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


Re: [postgis-users] PostGIS to Web Map?

2011-08-17 Thread b...@brucecallander.com
James - My guess is that the straightforward answer is to use Geoserver or 
similar. Writing the software to extract data from PostGIS and turn it into a 
web service seems like unnecessary pain.

I have come at this from the opposite point of view. I wanted to learn more 
about how WMS, WFS, WCS worked and how different http request formats could be 
tested so installed Geoserver. But I then needed sample data in the background 
on which Geoserver could operate so downloaded PostGIS. Getting that up and 
running is turning out to be a bigger challenge than installing Geoserver.

Bruce Callander
 


On 16 Aug 2011, at 19:11, James David Smith wrote:

> Dear all,
> 
> Bit of a geneal question this rather than something specific, but I've
> been following a few of the other queries on here talking about Open
> Layers, Geoserver and Google Maps, and it's reminded me that I really
> want to try and learn how to connect/convert my local PostGIS database
> into something that renders on a webpage. I realise that this is a big
> question, but wondered if anyone could give me a basic few steps as
> way of pointers - and then perhaps some links to more detail where I
> can go and learn how to do each step myself? I'm very happy to learn -
> just not sure where to start!
> 
> To be clear, at the moment I have a local database on my machine. I
> guess really I need to move this database to an online environment and
> host it somewhere? Then I need to build some webpages with a map, that
> interact with the database? There's no specific project here, just
> something I want to learn in my spare time as it'll be useful for the
> future.
> 
> As you can see my knowledge of how to put all this together is a bit
> vague to say the least. If it helps I have basic experience of Java +
> Javescript including the Google Maps API, am decent at HTML and CSS,
> and am becoming familiar with PostgreSQL and PostGIS - I just don't
> know how to join them all up at the moment - or where the gaps in my
> knowledge are.
> 
> Best wishes
> 
> 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] Difficulty importing example file nyc_buildings.sql

2011-08-17 Thread b...@brucecallander.com
Thanks to Ben Madin for  advice. I removed the apostrophes from the SRID in 
nyc_buildings.sql (using TextEdit) and re-ran the command

/usr/local/pgsql-9.0/bin/psql -f /Users/bacmac/nyc_buildings.sql nyc

Unfortunately it produced the same result:

BEGIN
psql:/Users/bacmac/nyc_buildings.sql:3: NOTICE:  CREATE TABLE will create 
implicit sequence "nyc_buildings_gid_seq" for serial column "nyc_buildings.gid"
psql:/Users/bacmac/nyc_buildings.sql:3: NOTICE:  CREATE TABLE / PRIMARY KEY 
will create implicit index "nyc_buildings_pkey" for table "nyc_buildings"
CREATE TABLE
psql:/Users/bacmac/nyc_buildings.sql:4: ERROR:  function 
addgeometrycolumn(unknown, unknown, unknown, integer, unknown, integer) does 
not exist
LINE 1: SELECT AddGeometryColumn('','nyc_buildings','the_geom',2908,...
   ^
HINT:  No function matches the given name and argument types. You might need to 
add explicit type casts.
psql:/Users/bacmac/nyc_buildings.sql:5: ERROR:  current transaction is aborted, 
commands ignored until end of transaction block
psql:/Users/bacmac/nyc_buildings.sql:6: ERROR:  current transaction is aborted 
… and so on.

I wonder if I need to adjust $PATH so that the function AddGeometryColumn is 
found? Even when I change directory to /usr/local/pgsql-9.0/bin my Mac cannot 
find psql if I type that command on its own. I always have to use the full 
pathname /usr/local/pgsql-9.0/bin/psql. Strange, because typing 'ls' after 
changing the directory brings up the complete list of files including psql.

Bruce Callander

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