#1 Fri 12 July 2013 18:58
- araking
- Participant actif
- Date d'inscription: 8 Jul 2013
- Messages: 83
[mapserver] projecton
Bonjour ,
Dans mon mapfile je ne trouve pas le problème il me génère une image blanche avec shp2img et une erreur soit avec getmap ou getcapabilities
msLoadMap(): Unable to access file. (home/arafet/projet1/proj.map) malgré que le chemin est juste
voici mon code , j'espère que quelq'un essai ce code et me renvoie la réponse je serai trés reconnaissant .Malheureusement la taille de mon shapefile ne me permet pas de le joindre mais je l'ai téléchargé de ce lien http://gadm.org/data/shp/TUN_adm.zip
Code:
map
name "wms_tunisie"
EXTENT -3.1300151 27.2414696 12.9592606 39.8437949
STATUS ON
PROJECTION
"init=epsg:4326"
END
WEB
METADATA
"wms_title" "WMS_TUNISIA"
"wms_onlineresource" "http://localhost/cgi-bin/mapserv?map=home/arafet/projet1/proj.map&"
"wms_srs" "epsg:4326 epsg:4269 epsg:3978 epsg:3857"
"wms_format" "image/png"
END
END
IMAGETYPE PNG
IMAGECOLOR 240 240 240
STATUS ON
UNITS METERS
SHAPEPATH"/home/arafet/projet1"
size 600 420
size 600 420
OUTPUTFORMAT
NAME "png"
DRIVER AGG/PNG
MIMETYPE "image/png"
IMAGEMODE RGB
EXTENSION "png"
FORMATOPTION "GAMMA=0.75"
END
OUTPUTFORMAT
NAME "jpeg"
DRIVER AGG/JPEG
MIMETYPE "image/jpeg"
IMAGEMODE RGB
EXTENSION "jpg"
FORMATOPTION "GAMMA=0.75"
END
REFERENCE
IMAGE home/arafet/projet1/img.png
EXTENT 454024 3892529 528373 3950102
SIZE 163 122
STATUS ON
COLOR -1 -1 -1
OUTLINECOLOR 0 128 0
END
SCALEBAR
POSTLABELCACHE TRUE
STYLE 0
UNITS kilometers
size 350 3
TRANSPARENT ON
COLOR 77 77 88
IMAGECOLOR 242 255 195
BACKGROUNDCOLOR 222 222 222
LABEL
COLOR 150 150 150
OUTLINECOLOR 255 255 255
FONT "sans"
TYPE Bitmap
SIZE small
ANGLE 90
POSITION AUTO
PARTIALS FALSE
END
END
LEGEND
STATUS ON
KEYSIZE 18 12
END
Layer
NAME "TUNISIA"
METADATA
"wms_title" "TUNSIA"
"wfs_srs" "EPSG:4326"
"gml_include_items" "all" ## Optional (serves all attributes for layer)
"gml_featureid" "ID" ## REQUIRED
"wfs_enable_request" "*"
END
PROJECTION
"init=epsg:3857"
END
data TUN_adm2.shp
status ON
type POLYGON
class
name "TUNISIA"
color 204 250 255
end
LAYER
NAME copyright
transform off
LABELCACHE ON
POSTLABELCACHE TRUE
STATUS ON
# TYPE annotation
TYPE POINT
FEATURE
POINTS
40 590 #this is the position of the text in image coordinates (pixels)
END
TEXT "Geographical data - Prefecture of Chania 2009 ©" #this is your displaying text
# ©
END
CLASS
LABEL #defines the font, colors etc. of the text
FONT "Vera"
TYPE TRUETYPE
SIZE 9
BUFFER 1
COLOR 0 0 0
FORCE TRUE
position cr
END
END
END
ENDDernière modification par araking (Fri 12 July 2013 19:05)
Hors ligne
#2 Sat 13 July 2013 11:00
- araking
- Participant actif
- Date d'inscription: 8 Jul 2013
- Messages: 83
Re: [mapserver] projecton
encore pas de réponse
même une petite indice svp
Hors ligne
#3 Sat 13 July 2013 11:48
Re: [mapserver] projecton
Bonjour,
Une première chose serait de prendre le temps d'écrire le mapfile correctement et pour cela la meilleure méthode est de mettre les paramètres en majuscule et d'indenter le code en fonction des objets comme ceci :
Code:
MAP
NAME "wms_tunisie"
EXTENT -3.1300151 27.2414696 12.9592606 39.8437949
STATUS ON
PROJECTION
"init=epsg:4326"
END
WEB
METADATA
"wms_title" "WMS_TUNISIA"
"wms_onlineresource" "http://localhost/cgi-bin/mapserv?map=home/arafet/projet1/proj.map&"
"wms_srs" "epsg:4326 epsg:4269 epsg:3978 epsg:3857"
"wms_format" "image/png"
END
END
IMAGETYPE PNG
IMAGECOLOR 240 240 240
STATUS ON
UNITS METERS
SHAPEPATH"/home/arafet/projet1"
SIZE 600 420
OUTPUTFORMAT
NAME "png"
DRIVER AGG/PNG
MIMETYPE "image/png"
IMAGEMODE RGB
EXTENSION "png"
FORMATOPTION "GAMMA=0.75"
END
OUTPUTFORMAT
NAME "jpeg"
DRIVER AGG/JPEG
MIMETYPE "image/jpeg"
IMAGEMODE RGB
EXTENSION "jpg"
FORMATOPTION "GAMMA=0.75"
END
REFERENCE
IMAGE home/arafet/projet1/img.png
EXTENT 454024 3892529 528373 3950102
SIZE 163 122
STATUS ON
COLOR -1 -1 -1
OUTLINECOLOR 0 128 0
END
SCALEBAR
POSTLABELCACHE TRUE
STYLE 0
UNITS kilometers
size 350 3
TRANSPARENT ON
COLOR 77 77 88
IMAGECOLOR 242 255 195
BACKGROUNDCOLOR 222 222 222
LABEL
COLOR 150 150 150
OUTLINECOLOR 255 255 255
FONT "sans"
TYPE Bitmap
SIZE small
ANGLE 90
POSITION AUTO
PARTIALS FALSE
END
END
LEGEND
STATUS ON
KEYSIZE 18 12
END
LAYER
NAME "TUNISIA"
METADATA
"wms_title" "TUNSIA"
"wfs_srs" "EPSG:4326"
"gml_include_items" "all" ## Optional (serves all attributes for layer)
"gml_featureid" "ID" ## REQUIRED
"enable_request" "*"
END
PROJECTION
"init=epsg:3857"
END
DATA TUN_adm2.shp
STATUS ON
TYPE POLYGON
CLASS
NAME "TUNISIA"
COLOR 204 250 255
END
END
LAYER
NAME copyright
transform off
LABELCACHE ON
POSTLABELCACHE TRUE
STATUS ON
# TYPE annotation
TYPE POINT
FEATURE
POINTS
40 590 #this is the position of the text in image coordinates (pixels)
END
TEXT "Geographical data - Prefecture of Chania 2009 ©" #this is your displaying text
# ©
END
CLASS
LABEL #defines the font, colors etc. of the text
FONT "Vera"
TYPE TRUETYPE
SIZE 9
BUFFER 1
COLOR 0 0 0
FORCE TRUE
position cr
END
END
END
ENDCa permet de voir que l'objet LAYER de la 12ere couche n'est jamais terminé (d'ailleurs cela a déjà été dit dans un post précédent mais qui a été que récemment).
Ensuite utilise une requête GetCapabilities pour valider ton service, s'il y a des problèmes ceux-ci seront affichés. Quand le getcapabilities fonctionnera correctement tu pourras avancer sur le reste.
Y.
Yves Jacolin, bénévole de l'association GeoRezo.net, agit au nom et pour le compte de l'association - Partageons ce qui nous départage !! - GeoRezo vous aide ? Aidez GeoRezo !
Hors ligne


