mapfile of connection to postgis .........

Eduardo Arévalo earevaloch at GMAIL.COM
Fri May 12 10:13:55 PDT 2006


thanks for their collaboration solve the problem:
here mapfile:
MAP
  IMAGETYPE      PNG
  EXTENT         -81.328391 -18.351232 -68.653396 -0.038607
  SIZE           400 300
  IMAGECOLOR     255 255 255

  LAYER
    NAME         Peru_dep
    CONNECTIONTYPE      postgis
    CONNECTION  "user=postgres dbname=sighco host=localhost password=*****
port=5432"
    DATA        'the_geom FROM departamentos_tp_perud2002'
    STATUS       ON
    TYPE         POLYGON
    CLASS
        COLOR   232 232 232
    END

     #CLASS
        #NAME       "Departamentos del Perú"
      #STYLE
       # COLOR        232 232 232
        #OUTLINECOLOR 32 32 32
      END
    END
  END
END


2006/5/12, Dirk Jesko <ml.dje at geocontent.de>:
>
> Eduardo,
>
> it seems that there is no spatial extent specified in the mapfile and
> mapserver can not guess it. I guess, that you need to add an EXTEND in
> the MAP part, like
>
> MAP
>   IMAGETYPE      PNG
>   SIZE           400 300
>   IMAGECOLOR     255 255 255
>   EXTENT          3100000 5200000 4100000 6200000
>
> See the mapserver docs, which says
>
> "EXTENT [minx] [miny] [maxx] [maxy]
>     The spatial extent of the map to be created. In most cases you will
>     need to specify this, although mapserver can sometimes (expensively)
>     calculate one if it is not specified."
>
> If your layer is not to large (not to many features), try the bounding
> box of the data. You can get it with the following query:
>
> SELECT box2d("the_geom")
> FROM "departamentos_tp_perud2002";
>
>
> Regards,
> Dirk
>
>
> Eduardo Arévalo wrote:
>
> > Hi list
> > I must mapserver v 4.8.3 and one bases postgres v 8 with postgis 1.0.6
> > on Centos 4.3
> > mapfile of connection is:
> >
> > MAP
> >   IMAGETYPE      PNG
> >   SIZE           400 300
> >   IMAGECOLOR     255 255 255
> >
> >   LAYER
> >     NAME         Peru_dep
> >     CONNECTIONTYPE      postgis
> >     CONNECTION  "user=postgres dbname=sighco host=localhost
> > password=123456 port=5432"
> >     DATA         "the_geom from departamentos_tp_perud2002"
> >     STATUS       ON
> >     TYPE         POLYGON
> >     END
> >
> >      #CLASS
> >         NAME       "Departamentos del Perú"
> >       #STYLE
> >        # COLOR        232 232 232
> >         #OUTLINECOLOR 32 32 32
> >       END
> >     END
> >   END
> > END
> > in order to invoke it:
> >
> http://10.1.6.46/cgi-bin/mapserv?map=/home/earevalo/mapserver-4.8.3/tests/conect.map&layer=Peru_dep&mode=map
> > <
> http://10.1.6.46/cgi-bin/mapserv?map=/home/earevalo/mapserver-4.8.3/tests/conect.map&layer=Peru_dep&mode=map
> >
> >
> > the errors are:
> > msDrawMap(): Image handling error. Unable to initialize image.
> > msCalculateScale(): General error message. Invalid image extent,
> > minx=-1.000000, miny=-1.000000, maxx=-1.000000, maxy=-1.000000.
> > msCalculateScale(): General error message. Invalid image extent,
> > minx=-1.000000, miny=-1.000000, maxx=-1.000000, maxy=-1.000000.
> > mapserv(): Web application error. No way to generate map extent.
> > aid please
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20060512/3546b753/attachment.htm>


More information about the MapServer-users mailing list