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

Dirk Jesko ml.dje at GEOCONTENT.DE
Thu May 11 23:19:27 PDT 2006


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



More information about the MapServer-users mailing list