postgis error
Shashi Gireddy
gireddy at GMAIL.COM
Fri Feb 4 14:23:37 PST 2005
I have a geometry table called counties (generated from census.shp)
and it works fine when i census table as my source table. However i
have another table called "care" where i have some data which i want
to map onto maps, both tables have a common column called name(name of
counties), so i created another table with both the tables as sources.
here is the error message:
Warning: [MapServer Error]: msDrawMap(): Failed to draw layer named
'Counties'. in c:\inetpub\wwwroot\mapExamples\allPlaces.php on line 58
Warning: [MapServer Error]: prep_DB(): Error executing POSTGIS DECLARE
(the actual query) statement: 'DECLARE mycursor BINARY CURSOR FOR
SELECT youth::text,asbinary(force_collection(force_2d(the_geom)),'NDR'),OID::text
from Counties WHERE the_geom && setSRID('BOX3D(-89.085 30.23,-84.295
35.02)'::BOX3D, find_srid('','Counties','the_geom') )'
Postgresql reports the error as 'ERROR: find_srid() - couldnt find the
corresponding SRID - is the geometry registered in the
GEOMETRY_COLUMNS table? Is there an uppercase/lowercase missmatch? '
More Help:
Error with POSTGIS data variable. You specified '<check your .map file>'.
Standard ways of specifiying are :
(1) 'geometry_column from geometry_table'
(2) 'geometry_column from (<sub query>) as foo using unique <column
name> using SRID=<srid#>'
Make sure you put in the 'using unique <column name>' and 'using
SRID=#' clauses in.
For more help, please see http://postgis.refractions.net/doc in
c:\inetpub\wwwroot\mapExamples\allPlaces.php on line 58
Fatal error: Call to a member function on a non-object in
c:\inetpub\wwwroot\mapExamples\allPlaces.php on line 59
here are these three tables:
CREATE TABLE counties
(
gid serial NOT NULL,
fips varchar,
name varchar,
n1 int4,
median_age float8,
total_hous int4,
......
the_geom geometry,
CONSTRAINT counties_pkey PRIMARY KEY (gid),
CONSTRAINT enforce_geotype_the_geom CHECK (geometrytype(the_geom) =
'MULTIPOLYGON'::text OR the_geom IS NULL),
CONSTRAINT enforce_srid_the_geom CHECK (srid(the_geom) = -1)
)
WITH OIDS;
ALTER TABLE counties OWNER TO root;
CREATE TABLE care1
(
slno numeric(11),
name varchar(50),
alc numeric(11),
comveh numeric(11),
youth numeric(11)
)
WITH OIDS;
ALTER TABLE care1 OWNER TO root;
So i created table care from care1 and counties
CREATE TABLE care
(
gid int4 NOT NULL,
fips varchar,
slno numeric(11),
name varchar(50),
alc numeric(11),
comveh numeric(11),
youth numeric(11),
the_geom geometry,
CONSTRAINT care_pkey PRIMARY KEY (gid),
CONSTRAINT enforce_geotype_the_geom CHECK (geometrytype(the_geom) =
'MULTIPOLYGON'::text OR the_geom IS NULL),
CONSTRAINT enforce_srid_the_geom CHECK (srid(the_geom) = -1)
)
WITH OIDS;
ALTER TABLE care OWNER TO root;
and here is my map file
LAYER
NAME "Counties"
CONNECTIONTYPE postgis
CONNECTION "user=root password=c3n5u5 dbname=census host=localhost"
DATA "the_geom from counties"
STATUS DEFAULT
TYPE POLYGON
STATUS ON
CLASSITEM "youth"
CLASS
NAME "Class1"
EXPRESSION ([youth]<200)
TEMPLATE void
COLOR 164 164 255
OUTLINECOLOR 0 0 0
#END
END
END
Cany anybody please help me with this, thanks a million in advance.
--
Shashi Kiran Reddy. Gireddy,
Graduate Assistant,
CBER, University of Alabama.
http://www.cs.ua.edu/shashi
Home: 205-752-5137 Cell: 205-657-1438
More information about the MapServer-users
mailing list