[Gfoss] ka-map non visualizza la mappa

Alessio Di Lorenzo alessio.dilorenzo at gmail.com
Thu Jan 11 22:45:42 CET 2007


ciao a tutti,
sto provando ad utilizzare ka-map dopo tanto tempo dall'ultima volta e
adesso ad un passo (almeno credo) dal successo sono incappato in questo
problema:

in pratica, quando accedo al visualizzatore di ka-map all'indirizzo
http://localhost/ka-map-1.0.b1/htdocs/ , nell'elenco della finestra a
discesa in alto a sinistra la mia mappa è presente ma nel viewer non c'è
nulla. Se clicco sulla legenda invece vedo che ci sono esattamente i layer e
le classi che  ho inserito nel mapfile. Altra cosa strana è che se uso la
funzione Pan nella finestra del viewer mi accorgo che compaiono per un
attimo i riquadri bianchi con la x rossa tipici di quando un link punta ad
un'immagine che non c'è più... (scusate ma non so come altro spiegarlo).

Il mapfile in modalità localhost/cgi-bin/mapserv?map=....&mode=map genera
correttamente l'immagine sul browser, quindi penso che sia scritto bene...
Ho assegnato con chown ricorsivo tutti i file "coinvolti" nell'operazione
all'utente del webserver www-data (che è anche il proprietario della dir
ka-map-1.0.b1 in /var/www), quindi non dovrebbe essere un problema di
accessibilità...

Di seguito riporto le parti che ho modificato nel config.php di kamap ed il
mapfile, riuscite a dirmi dove sbaglio?:

$aszGMap = array (
         'title' => 'Thailand',
         'path' => '/var/www/ka-map-1.0.b1/include/thai.map',
         'scales' => array( 50000000, 10000000, 5000000, 1000000 ),
         'format' =>'PNG'
         /* Sample authorized_users entry. See auth.php for more details:
          * ,'authorized_users' => array('popplace' => array('user1',
'user2'),
          *                              'park'     => array('user1')
          */
 );


 $aszMapFiles = array( 'Thailand' => $aszGMap

/* Add more elements to this array to offer multiple mapfiles */

);

/******************************************************************************
 * figure out which map file to use and set up the necessary variables for
 * the rest of the code to use.  This does need to be done on every page
load
 * unfortunately.
 *
 * szMap should be set to the default map file to use but can change if
 * this script is called with map=<mapname>.
 */
$szMap = 'Thailand';

/******************************************************************************
 * kaMap! caching
 *
 * this is the directory within which kaMap! will create its tile cache.
The
 * directory does NOT have to be web-accessible, but it must be writable by
the
 * web-server-user and allow creation of both directories AND files.
 *
 * the tile caching system will create a separate subdirectory within the
base
 * cache directory for each map file.  Within the cache directory for each
map
 * file, directories will be created for each group of layers.  Within the
group
 * directories, directories will be created at each of the configured scales
 * for the application (see mapfile configuration above.)
 */
$szBaseCacheDir =  "/var/www/tmp/kacache/";

/* Uncomment the following if you have a web accessible cache */
//$szBaseWebCache = "kacache/";


Ed ecco il mapfile

MAP
 NAME Thailand
 IMAGECOLOR 255 255 255
 SIZE 600 800
 SHAPEPATH "/home/alessio/Desktop/Thailand/data"
 FONTSET "/home/alessio/Desktop/Thailand/fonts/fonts.list"
 SYMBOLSET "/home/alessio/Desktop/Thailand/symbols/symbols.sym"

 PROJECTION
  "init=epsg:4326"
 END

 EXTENT 97.3480 5.6137 105.6430 20.4654
  # lat/lon extents of Thailand

 WEB
  IMAGEPATH "/var/www/tmp/kacache/"
  IMAGEURL "/../../tmp/kacache/"
  METADATA
   "map" "http://localhost/cgi-bin/mapserv/thai.map"
   "ows_schemas_location" "http://schemas.opengeospatial.net"
   "ows_title" "Sample WMS"
   "ows_abstract" "Sample WMS of Thailand"
   "ows_keywordlist" "Thailand,WMS,ITC"
   "ows_onlineresource" "
http://localhost/cgi-bin/mapserv?map=http://localhost/cgi-bin/mapserv/thai.map&"

   "wms_srs" "EPSG:4326 EPSG:24047"
   "wms_feature_info_mime_type" "application/vnd.ogc.gml"
   "wms_feature_info_mime_type" "text/plain"
   "wms_feature_info_mime_type" "text/html"
   "wms_server_version" "1.1.1"
   "wms_formatlist" "image/png,image/gif,image/wbmp,image/jpeg"
   "wms_format" "image/gif"
  END
 END #web

 LEGEND
  KEYSIZE 16 10
  LABEL
   TYPE BITMAP
   SIZE MEDIUM
   COLOR 0 0 0
  END #label
  STATUS EMBED
  POSITION UR # U=upper R=right
 END #legend

 SCALEBAR
  IMAGECOLOR 255 255 255
  LABEL
   COLOR 0 0 0
   SIZE TINY
  END #label
  STYLE 1
  SIZE 200 10
  COLOR 0 0 0
  UNITS METERS
  INTERVALS 2
  TRANSPARENT FALSE
  STATUS EMBED
  POSITION UL
 END #scalebar

 SYMBOL
   NAME "point"
   TYPE ELLIPSE
   POINTS
     1 1
   END
   FILLED TRUE
 END

 LAYER
  NAME "forest"
  TYPE POLYGON
  STATUS DEFAULT
  DATA "/home/alessio/Desktop/Thailand/data/forest"
  METADATA
   "wms_title" "forest"
  END
  PROJECTION
   "init=epsg:4326"
  END
  CLASSITEM "FOR_TYPE" #attributo forest_type
  CLASS
   NAME "forest Reserve"
   EXPRESSION 'FR'
   COLOR 56 168 0
  END #class
  CLASS
   NAME "National Park"
   EXPRESSION 'NP'
   COLOR 171 205 102
  END
  CLASS
   NAME "Wildlife Sanctuary"
   EXPRESSION 'WS'
   COLOR 245 245 122
  END
  CLASS
   NAME "Not forest"
   EXPRESSION 'NF'
   COLOR 205 170 102
  END
 END #layer forest

 LAYER
  NAME "woterbody"
  TYPE POLYGON
  STATUS DEFAULT
  MAXSCALE 1000000 #il layer waterbody non sarà mostrato prima dello zoom a
livello 1:100000
  DATA "/home/alessio/Desktop/Thailand/data/waterbody"
  METADATA
   "wms_title" "Waterbody"
  END
  PROJECTION
   "init=epsg:4326"
  END
  CLASS
   NAME "Waterbody"
   COLOR 0 0 255
  END
 END #layer waterbody

 LAYER
  NAME airports
  TYPE POINT
  STATUS DEFAULT
  DATA "/home/alessio/Desktop/Thailand/data/airports"
  METADATA
   "wms_title" "Airports"
  END
  PROJECTION
   "init=epsg:4326"
  END
  LABELITEM "NameEnglis" #attributo da usare
  CLASS
   NAME "airports"
   STYLE
    SYMBOL "point"
    COLOR 0 0 0
    SIZE 10
   END #style
   LABEL
    COLOR 0 0 0
    TYPE TRUETYPE
    FONT arial
    MINSIZE 6
    MAXSIZE 12
    POSITION AUTO
    PARTIALS FALSE
    BUFFER 4
   END #label
  END
 END #layer waterbody
END #map

LAYER
 NAME railroad
 TYPE LINE
 STATUS DEFAULT
 DATA "/home/alessio/Desktop/Thailand/data/railroad"
    METADATA
      "wms_title" "railroad"
    END
    PROJECTION
     "init=epsg:4326"
    END
    CLASS
      NAME "railroad"
      STYLE
        COLOR 0 0 0
        WIDTH 2
       END #style
    END #class
  END #layer railroad

END #map

PS
Uso linux, ma credo che dai path si sia già capito...
-------------- parte successiva --------------
Un allegato HTML ? stato rimosso...
URL: http://www.faunalia.com/pipermail/gfoss/attachments/20070111/cba027f0/attachment-0001.htm 


More information about the Gfoss mailing list