[postgis] Adding PostGIS data to a table.

Paul Ramsey pramsey at refractions.net
Sun Jul 22 10:33:58 PDT 2001

Ted Rolle wrote:

> I'd like to see an example of something like what I'm trying to do -- even
> if I have to create it.  I suppose that many potential users have this
> type of data, probably because it's the most familiar description of a
> point on the earth's surface.  Something in the way of familiar examples
> would do much for a new user -- and make it immediately useful.
> Please be patient -- I'll get it eventually... ;->

OK, first of all from a pure SQL point of view...

1) compile install the PostGIS extensions, load the postgis.sql file
the database your are using

2) create the table you will be using

create table mypoints ( pt geometry, name varchar(35), size int4 );

3) insert some data into the table

insert into mypoints ( pt, name, size ) values ( 'POINT(-126.14111
45.123141 87.14)', 'Location A', 14 );
insert into mypoints ( pt, name, size ) values ( 'POINT(-125.31411
45.98142 24.41)', 'Location B', 23 );

4) pull some data out of the table

select * from mypoints where pt && 'BOX3D(-127.0 45.0,-126.0

Secondly from a ESRI Shapefile point of view, using the new shp2pgsql

1) compile the shp2pgsql tool (enter directory and 'make').

2) get a shape file

3) shp2pgsql <shpfile> <tablename> | psql -d dbname

What would be a good way to do this for people? Perhaps some bundled
data and a set of tutorial steps on loading, builing indexes, querying,

------------------------ Yahoo! Groups Sponsor ---------------------~-->
Secure your servers with 128-bit SSL encryption! Grab your copy of
VeriSign's FREE Guide "Securing Your Web Site for Business." Get it now!

To unsubscribe from this group, send an email to:
postgis-unsubscribe at yahoogroups.com


Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 

More information about the postgis-users mailing list