[Spanish] configuración mapserver

Albert Salse albertsalse at gmail.com
Mon Apr 29 10:24:13 PDT 2013


Hola,

tengo un problema al mostrar un capa con OpenLayers, servida por mapserver.
Me sale un error que se repite para cada tile:

Resource interpreted as Image but transferred with MIME type text/html: "
http://127.0.0.1/cgi-bin/mapserv?map=%2Fhome%2Fcarpeta%2Fprojectes%2Fb
…421875+2.4609375+43.59375&map_size=256+256&imgx=128&imgy=128&imgxy=256+256".

Parece que se solicita un imagen pero se retorna un html.
He estado probando distintas configuraciones para solucionar el problema
pero no encuentro la solución.

Os dejo aquí una copia de las configuraciones por si me podéis indicar que
es lo que esta mal. Si necesitáis más información no dudéis en pedirla.

En el HTML:

<script type="text/javascript">
var map;
function init() {
var options={
                    numZoomLevels: 20,
                    units: "degrees"};
    var map = new OpenLayers.Map( 'map', options, {
                    controls: [
                        new OpenLayers.Control.Navigation(),
                        new OpenLayers.Control.PanZoomBar(),
                        new
OpenLayers.Control.LayerSwitcher({'ascending':true}),

                        new OpenLayers.Control.ScaleLine(),
                        new OpenLayers.Control.MousePosition(),
                        new OpenLayers.Control.KeyboardDefaults()
                    ],
                } );
    var base = new OpenLayers.Layer.MapServer( "capa base",
      "http://vmap0.tiles.osgeo.org/wms/vmap0", {layers: 'basic'});


    var poligons = new OpenLayers.Layer.MapServer("poligons",
"http://127.0.0.1/cgi-bin/mapserv?",
{map:"/home/carpeta/projectes/mapa.map", transparent: 'true',
layers:'poligons'});

    map.addLayers([base,poligons]);

    map.setCenter(new OpenLayers.LonLat(0.640516, 42.751142), 10);
    map.addControl( new OpenLayers.Control.LayerSwitcher());
}
</script>


En el MAP:

map
  OUTPUTFORMAT
    NAME prova
    DRIVER AGG/PNG
    IMAGEMODE RGB
    FORMATOPTION "INTERLACE=true"
    MIMETYPE "image/png"
  END
  UNITS degrees
  EXTENT -180 -90 180 90
  PROJECTION
    'proj=longlat'
    'ellps=WGS84'
    'datum=WGS84'
    'no_defs'
    ''
  END
  IMAGECOLOR "#B3C6D4"
  IMAGETYPE agg
  SIZE 800 800

  WEB
    METADATA
      "ows_enable_request" "*"
       wms_srs "EPSG:9122 EPSG:4326 EPSG:8901 EPSG:6326 EPSG:7030"
       labelcache_map_edge_buffer "-10"
       wms_title "layer1"
    END
  END

    LAYER
      NAME "poligons"
      STATUS ON
      TYPE POLYGON
      METADATA
        'wms_srs' 'EPSG:4326'
      END
      PROJECTION
    'proj=longlat'
    'ellps=WGS84'
    'datum=WGS84'
    'no_defs'
    ''
  END
      CONNECTIONTYPE postgis
      CONNECTION "user=**** password=**** dbname=**** host=localhost
port=5432"
      DATA "poly from map_poligons"

      PROCESSING "LABEL_NO_CLIP=ON"
      PROCESSING "CLOSE_CONNECTION=DEFER"


    END

end


Y para acabar os dejo la información referente a los poligonos que tengo en
la base de datos:

Layer name: map_poligons
Geometry: Polygon
Feature Count: 2594
Extent: (0.640516, 42.751142) - (0.813759, 42.834505)
Layer SRS WKT:
GEOGCS["WGS 84",
    DATUM["WGS_1984",
        SPHEROID["WGS 84",6378137,298.257223563,
            AUTHORITY["EPSG","7030"]],
        AUTHORITY["EPSG","6326"]],
    PRIMEM["Greenwich",0,
        AUTHORITY["EPSG","8901"]],
    UNIT["degree",0.01745329251994328,
        AUTHORITY["EPSG","9122"]],
    AUTHORITY["EPSG","4326"]]
FID Column = id
Geometry Column = poly
n_polig: Integer (0.0)
descripcio: String (100.0)
area: Real (0.0)


Me he leído documentación y foros pero sin suerte. Creo que tiene algo que
ver con el bounding box, pero se me escapa la solución.

Todo lo que me podáis decir será de ayuda.
Gracias.
------------ pr?xima parte ------------
Se ha borrado un adjunto en formato HTML...
URL: <http://lists.osgeo.org/pipermail/spanish/attachments/20130429/4691f8cd/attachment.html>


More information about the Spanish mailing list