[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
into 
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
46.0)'::box3d;

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

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,
etc?

------------------------ 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!
http://www.verisign.com/cgi-bin/go.cgi?a=n094442340008000
http://us.click.yahoo.com/6lIgYB/IWxCAA/yigFAA/PhFolB/TM
---------------------------------------------------------------------~->

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