[mapserver-users] question regarding postgis

Tyler Mitchell TMitchell at lignum.com
Wed Sep 4 12:46:06 EDT 2002


Hi Grant,
The easiest thing to do would be to use the shp2pgsql program which
converts a shapefile into SQL commands to create a layer/table with a
specific name.  I will send you a sample shapefile if you would like one.
run "shp2pgsql --help" to see the syntax.  You can pipe the output to a
text file and look at it there (i.e. "shp2pgsql myshp.shp newtable testdb >
mysql.sql") or pipe it directly to pgsql to load it into the database (i.e.
"shp2pgsql myshp.shp newtable testdb | pgsql testdb").  Let me know if you
need more help.

Tyler

p.s. you can also use the "ogr2ogr" tool (part of the gdal/ogr package) to
convert other formats directly to postgis.




                                                                                                                     
                      Grant Marblestone                                                                              
                      <GrantM at ATSER.com>                  To:       MapServer List                                   
                      Sent by:                             <mapserver-users at lists.gis.umn.edu>                       
                      owner-mapserver-users at lists.        cc:                                                        
                      gis.umn.edu                         Fax to:                                                    
                                                          Subject:  [mapserver-users] question regarding postgis     
                                                                                                                     
                      09/04/2002 08:36 AM                                                                            
                      Please respond to Grant                                                                        
                      Marblestone                                                                                    
                                                                                                                     
                                                                                                                     




Howdy all,

so i have installed postgres 7.2 on my windows box and a linux box... no
big
deal.... now i am thinking about using postgis.

I read thru the documentation and how to add a layer and i understand that
completly.  The problem i have is the database structure itself.  Can
somoene explain to me what the database has to have in it to create a layer
with x,y,z etc?  an example .sql file would eb most excellent.!


Thanks,

Grant








More information about the mapserver-users mailing list