[mapserver-users] cannot able to test the mapfile-database eror

Venkat Rao Tammineni vtammineni at roulacglobal.com
Mon Mar 16 03:06:45 EDT 2009


Hi,

 

    The Problem may be either u don't have  geom. Or find out whether geom.
Field is existed or not ? or you have to use SRID.Please check my map file
below I have given

 

MAP

  NAME Test

  STATUS ON

  SIZE 650 400

  UNITS dd

  IMAGECOLOR 102 153 153

  EXTENT 64.881 5.469 97.898 37.762

 

  PROJECTION

    'proj=longlat'

    'ellps=WGS84'

    'datum=WGS84'

    'no_defs'

    ''

  END

 

SYMBOL

  NAME "border"

  TYPE VECTOR

  POINTS

    0 0

    1 0

    1 0.8

    0 0.8

    0 0

  END

  STYLE

    10 6 1 6

  END

  FILLED TRUE

END

 

 

 

  # Background color for the map canvas -- change as desired

 # IMAGECOLOR 192 192 192

  IMAGEQUALITY 95

 

  IMAGETYPE png

          OUTPUTFORMAT

                   NAME jpeg

                   DRIVER "GD/JPEG"

                   MIMETYPE "image/jpeg"

                   IMAGEMODE RGB

                   EXTENSION "jpg"

                END

 

SCALEBAR

INTERVALS 2

UNITS kilometers

STYLE 1

POSITION lc

STATUS embed

  LABEL

    SIZE small

    COLOR 0 0 0

  END

END

  

 

LAYER

    NAME "India"

    TYPE POLYGON

    CONNECTIONTYPE POSTGIS

    CONNECTION "host=localhost   dbname=GIS  password=administrator
user=postgres port=5432"

Data "the_geom from (select
gid,name,pincode,district,address,website,phnumber,areaname,category,longitu
de,latitude,metroname,the_geom from indiaparks) as Foo USING UNIQUE gid
USING 'srid=24047'"  

 

    STATUS ON

    TRANSPARENCY 40

    MinScale 7054330

   LABELITEM "cntry_name" #label Item

   CLASSITEM "cntry_name" 

   TEMPLATE "query.html" 

   CLASS

      NAME 'India' 

       STYLE

         SYMBOL "border"

         SIZE 6

         OUTLINECOLOR 0 0 0

         COLOR 251 252 179

                END

                  LABEL  #label class start

                      POSITION auto #label Position

          FONT sans

                      SIZE SMALL #lable size

              COLOR 0 38 237 # label color

            END           # label end

        

       END

    END

  END

END

 

 

Thanks

Venkat.

 

From: mapserver-users-bounces at lists.osgeo.org
[mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of syed mohseen
Sent: Monday, March 16, 2009 11:01 AM
To: mapserver-users at lists.osgeo.org
Subject: [mapserver-users] cannot able to test the mapfile-database eror

 

hi all,
    i am a new bie to fgs and i want to test one of my mapfile with
connecting to my database.
    here is my mapfile


NAME "test"
SIZE 800 600
IMAGECOLOR 249 245 186
IMAGETYPE png
EXTENT -1.00 -1.00 1.00 1.00
LAYER
    CONNECTIONTYPE postgis
    NAME "test"
    CONNECTION "user=postgres password=hellopostgres dbname=postgres
host=localhost"
    DATA "geom FROM test"
    STATUS ON
    TYPE POINT
   END
END



whenever i test the file as shp2img i get the following error


msDrawMap(): Image handling error. Failed to draw layer named 'test'. <br>
prepare_database(): Query error. Error executing POSTGIS DECLARE (the actual
query) statement: 'DECLARE mycursor BINARY CURSOR FOR SELECT
asbinary(force_collection(force_2d(geom)),'NDR'),OID::text from test WHERE
geom && setSRID('BOX3D(-1.3338898163606 -1,1.3338898163606 1)'::BOX3D,
find_srid('','test','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/documentation/ 

Mappostgis.c - version of Jan 23/2004.
 <br>




   any solutions will be appreciated


   regards
   SyedMohseen

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20090316/7d2c12e0/attachment-0001.html


More information about the mapserver-users mailing list