[Community] PostGIS geometry_columns table question
sgillies at frii.com
Mon Mar 20 17:06:06 EET 2006
On Mar 20, 2006, at 3:53 AM, CP Hennessy wrote:
> On Sunday 19 March 2006 06:34, larryt at winfirst.com wrote:
>> I'm a sysadmin and complete GIS noob trying to set up the dublin
>> of Zope3 PCL/ZCO/PrimaGIS for our GIS folks to look at.
>> Everything is
>> built and working, as far as I can tell without data. That's where
>> I'm stuck.
>> Where does the PostGIS geometry_columns table come from? The PostGIS
>> documentation lists its fields, but I can't discover how to populate
>> them. Is the information in the shape files somewhere? Our shape
>> file sets include dbf, prj, shp, sbn, prj, shp.xml, sbx and shx
>> but neither ogr2ogr or shp2pgsql created geometry_columns. Maybe I
>> didn't provide a necessary option? Few of the documented options
>> meant much to me, not being GIS literate. Or, maybe geometry_columns
>> has to be built by hand. If so, are there instructions somewhere
>> even a sysadmin could follow?
> Hi Larry,
> The geometry_columns table should be created when you run the sql
> which comes with postgis.
Here is a slightly modified version of our database creation makefile
that will smooth out the database creation process:
# --- begin makefile
# Python Cartographic Library. Copyright (C) 2005 Sean C. Gillies
# This program is free software; you can redistribute it and/or
# under the terms of the GNU General Public License as published by
# Software Foundation; either version 2 of the License, or (at your
# any later version.
# This program is distributed in the hope that it will be useful, but
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
# You should have received a copy of the GNU General Public License
# this program; if not, write to the Free Software Foundation, Inc.,
# Place, Suite 330, Boston, MA 02111-1307 USA
# Contact email: sgillies at frii.com
# Make and populate a PostGIS testing database
# Path to the directory containing the PostGIS setup scripts
# lwpostgis.sql and spatial_ref_sys.sql
POSTGIS = /usr/local/pgsql/share/
# Path to the world borders shapefile. Modify accordingly.
WORLD_BORDERS = ./world_borders.shp
# Name for the new database. The standard testing dbname is pcl_test.
DBNAME = pcl_test
shp2pgsql -I -s 4269 $(WORLD_BORDERS) postgis.world_borders > /tmp/
createlang plpgsql $(DBNAME)
psql -d $(DBNAME) -c "CREATE SCHEMA postgis"
psql -d $(DBNAME) -f $(POSTGIS)/lwpostgis.sql
psql -d $(DBNAME) -f $(POSTGIS)/spatial_ref_sys.sql
psql -d $(DBNAME) -f /tmp/wb.sql
# --- end makefile
Or you could use this as a template for running the commands from a
sgillies frii com
More information about the Community