[Mapserver-users] Query in PostGIS-Layer

Elstermann, Mike Mike.Elstermann at itc-halle.de
Mon Sep 15 08:10:17 EDT 2003


hi,

i have a query-problem in the postgis-layer. browsing is ok.

********* a part of my shape *******************
--
-- PostgreSQL database dump
--

\connect - postgres

SET search_path = public, pg_catalog;

--
-- TOC entry 2 (OID 10809501)
-- Name: alk_fo; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE alk_fo (
    gid integer,
    oska character varying,
    obj_name character varying,
    the_geom geometry,
    CHECK ((srid(the_geom) = -1)),
    CHECK (((geometrytype(the_geom) = 'MULTIPOLYGON'::text) OR (the_geom IS
NULL)))
);


--
-- Data for TOC entry 4 (OID 10809501)
-- Name: alk_fo; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY alk_fo (gid, oska, obj_name, the_geom) FROM stdin;
0       1/233F  FS152242002001730820    SRID=-1;MULTIPOLYGON(((4501669.499
5709748.204,4501675.062 5709777.471,4501704.35 5709931.566,4501730.122
5710067.164,4501791.656 5710031.931,4501759.111 5709879.103,4501758.345
5709875.51,4501749.271 5709835.991,4501736.677 5709781.139,4501733.151
5709765.076,4501710.582 5709662.274,4501709.254 5709656.223,4501834.958
5709623.099,4501890.499 5709605.753,4501961.241 5709574.961,4501959.668
5709564.041,4501960.469 5709557.201,4501916.978 5709574.771,4501810.47
5709584.677,4501785.159 5709591.225,4501756.872 5709599.978,4501730.561
5709608.119,4501651.709 5709654.602,4501669.499 5709748.204)))
1       1/233F  FS152242002000770030    SRID=-1;MULTIPOLYGON(((4501596.821
5709695.393,4501573.408 5709709.578,4501604.349 5709859.874,4501584.323
5709941.019,4501582.783 5709947.258,4501616.521 5710127.319,4501636.239
5710117.165,4501615.97 5710016.618,4501635.273 5710014.316,4501651.39
5710109.724,4501691.417 5710088.476,4501614.866 5709681.982,4501596.821
5709695.393)))
2       1/233F  FS152242002000560010    SRID=-1;MULTIPOLYGON(((4501632.971
5709235.362,4501562.797 5709264.698,4501615.466 5709543.545,4501625.184
5709594.992,4501637.453 5709659.944,4501650.09 5709651.376,4501706.389
5709617.123,4501702.566 5709597.245,4501632.971 5709235.362))) .....


************ my map-file ****************
LAYER
  NAME alk
  TYPE POLYGON
  STATUS OFF
  HEADER "halgis_alk_header.html"
  FOOTER "halgis_alle_footer.html"
  CONNECTIONTYPE postgis
  CONNECTION "user=postgres password=postgres dbname=gisdb"
  DATA 'the_geom from alk_fo'  # <-- i think, that's ok?
  #MINSCALE 2000
  MAXSCALE 5000
  CLASS
    NAME 'ALK - FST'
    EXPRESSION ('[OSKA]'='1/233F' OR '[OSKA]'='1/234F'  OR '[OSKA]'='1/239F'
OR '[OSKA]'='1/246F' )
    TEMPLATE "halgis_alk.html"
    SYMBOL dickelinie
    SIZE 1
    COLOR 220 220 255
    OUTLINECOLOR 100 100 200
  END
END

************ the error ******************

<BODY BGCOLOR="#FFFFFF">
msPOSTGISLayerGetShape(): Query error. Error executing POSTGIS  SQL
statement (in FETCH ALL): EXPLAIN VERBOSE SELECT * FROM alk_fo
-
Error with POSTGIS data variable. You specified ''.<br>
Standard ways of specifiying are : <br>
(1) 'geometry_column from geometry_table' <br>
(2) 'geometry_column from (&lt;sub query&gt;) as foo using unique &lt;column
name&gt; using SRID=&lt;srid#&gt;' <br><br>

Make sure you put in the 'using unique  &lt;column name&gt;' and 'using
SRID=#' clauses in.

<br><br>For more help, please see
http://postgis.refractions.net/documentation.php 

<br><br>Mappostgis.c - version of Nov 15/2002.

***** how can help me? **********************


::: mfg. Mike Elstermann [mikeE.], Teamleiter GIS/RIS, e-Solutions
::: IT-Consult Halle GmbH, Bornknechtstraße 5, 06108 Halle (Saale)
::: Sitz: Große Nikolaistraße 8
::: Tel.: +49 345 221 4237, Fax: +49 345 221 4236, mobil: +49 160 71 545 02
::: mike.elstermann at itc-halle.de ::: http://www.itc-halle.de
::: GeoDaten Online? -> http://www.itcgis.de




More information about the mapserver-users mailing list