Nous utilisons des cookies pour vous garantir la meilleure expérience sur notre site. Si vous continuez à utiliser ce dernier, nous considèrerons que vous acceptez l'utilisation des cookies. J'ai compris ! ou En savoir plus !.
banniere

Le portail francophone de la géomatique


Toujours pas inscrit ? Mot de passe oublié ?
Nom d'utilisateur    Mot de passe              Toujours pas inscrit ?   Mot de passe oublié ?

Annonce

Printemps des cartes 2024

#1 Fri 11 June 2004 17:49

Gilles Montgaillard
Invité

RASTER mapserver OGR

Bonjour,

Je cherche a ouvrir une couche RASTER de mapinfos avec mapserver,
j'utilise donc le .tab via une connection OGR mais je n'arrive a rien
contrairement au couche de type POLYGON ou line.
Je cherche donc un bou de .map ou des infos pour afficher ma couche
RASTER a partir d'un .tab.

Merci d'avance

Gilles Montgaillard
DGA/SDSI/CERIT/DIG
B.P. 68 - 31326 Castanet-Tolosan Cedex
Tel. 05.61.28.92.76

 

#2 Fri 11 June 2004 18:23

Bernd Deckert
Invité

Re: RASTER mapserver OGR

Bonsoir Gilles,

OGR est une librairie specialisee dans les donnees vecteur et ne s'applique
pas aux donnees rasters.
La librairie pour le raster est plutot GDAL.
A ma connaissance on ne peut pas utiliser directement les ficher de calage
(de georeferencement) de mapinfo .tab .

Exemple 1 : Image Tiff unique (si vous voulez telecharger
http://www.01map.com/download/mapserver … xemple.zip )
Pour le georeferencement de l'image il est necessaire d'utiliser une
worldfile qui nous provient du monde d'ESRI (a moins d'utiliser du
Geotiff ).
On peu facilement l'editer a la main. Cherchez sur Internet comment l'editer
ou jetez un coup d'oeil sur l'annexe en fin de mail si vous maitrisez
l'anglais.

La worldfile associee a l'image mnt_couleur_LR.tif s'appelle
mnt_couleur_LR.tfw (tf pour tiff et w pour worlfile; pour du jpeg ce
serait jgw) et sont contenu peut ressembler a ca :

Contenu du .tfw

50.00588000000000
0.00000000000000
0.00000000000000
-49.98823000000000
547000.00000000000000 //Coordonnee x min; ici lambert II (Coordonnee en haut
a gauche de l'image)
1997900.00000000000000 //Coordonnee y max; ici lambert II

Voici une map :
MAP
NAME DirenLR
STATUS ON
EXTENT 541435 1700000 810058 2000000
SIZE 400 300
SHAPEPATH C:/Apache/htdocs/mapserver/direnlr/data/
SYMBOLSET C:/Apache/htdocs/mapserver/direnlr/etc/symbols.sym
FONTSET C:/Apache/htdocs/mapserver/direnlr/etc/fonts.txt
IMAGECOLOR 255 255 255
UNITS METERS
WEB
MINSCALE 5000
IMAGEPATH C:/Apache/htdocs/temp_mapserver/
IMAGEURL /temp_mapserver/
END

LAYER
NAME mnt_color
GROUP 3
STATUS ON
DATA mnt_couleur_LR.tif
TYPE RASTER
UNITS METERS
SIZEUNITS PIXELS
MINSCALE 150000
TOLERANCE 0
TOLERANCEUNITS PIXELS
END

END #fin map

Exemple 2 : Utilisation d'un catalogue d'images
Utiliser l'utilitaire en ligne de commande gdaltindex pour creer un
catalogue image (tuilage d'images).
La creation du fichier d'indexation necessite la presence des fameux
worldfile a cote des images
http://gdal.maptools.org/gdal_utilities.html (le lien traditionnel
http://www.remotesensing.org/gdal/gdal_utilities.html ne marchait pas a
l'heure ou j'ecris)
Placez le catalogue (ici scan25.shp ) dans le repertoire correspondant au
SHAPEPATH.

MAP
NAME DirenLR
STATUS ON
EXTENT 541435 1700000 810058 2000000
SIZE 400 300
SHAPEPATH C:/Apache/htdocs/mapserver/direnlr/data/
SYMBOLSET C:/Apache/htdocs/mapserver/direnlr/etc/symbols.sym
FONTSET C:/Apache/htdocs/mapserver/direnlr/etc/fonts.txt
IMAGECOLOR 255 255 255
UNITS METERS
WEB
MINSCALE 5000
IMAGEPATH C:/Apache/htdocs/temp_mapserver/
IMAGEURL /temp_mapserver/
END

LAYER
NAME Ign25
GROUP 3
STATUS ON
TYPE RASTER
TILEINDEX scan25.shp
TILEITEM Location
UNITS METERS
SIZEUNITS PIXELS
MINSCALE 5000
MAXSCALE 30000
TOLERANCE 0
TOLERANCEUNITS PIXELS
END

END #fin map

ANNEXE
Fontionnement d'une Worlfile
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++
World file contents

The contents of the world file will look something like this:

20.17541308822119
0.00000000000000
0.00000000000000
-20.17541308822119
424178.11472601280548

4313415.90726399607956

When this file is present, ArcView performs the image-to-world
transformation. The image-to-world transformation is a six-parameter affine
transformation in the form of:

x1 = Ax + By + C

y1 = Dx + Ey + F

where

x1 = calculated x-coordinate of the pixel on the map
y1 = calculated y-coordinate of the pixel on the map
x = column number of a pixel in the image
y = row number of a pixel in the image
A = x-scale; dimension of a pixel in map units in x direction
B, D = rotation terms
C, F = translation terms; x,y map coordinates of the center of the
upper-left pixel
E = negative of y-scale; dimension of a pixel in map units in y direction

Note The y-scale (E) is negative because the origins of an image and a
geographic coordinate system are different. The origin of an image is
located in the upper-left corner, whereas the origin of the map coordinate
system is located in the lower-left corner. Row values in the image increase
from the origin downward, while y-coordinate values in the map increase from
the origin upward.

The transformation parameters are stored in the world file in this order:

20.17541308822119 - A
0.00000000000000 - D
0.00000000000000 - B
-20.17541308822119 - E
424178.11472601280548 - C

4313415.90726399607956 - F

Note  ArcView does not rotate, or warp, images. If your world file has
non-zero rotation terms (D and B parameters), the image may change its
position relative to vector data in the same view when you zoom or pan. Use
the ARC/INFO RECTIFY command to properly rotate the image.

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++

Bonne chance et faitez-moi savoir si ca a marche, Bernd

PS : Si vous voulez tester avec un exemple concret je vous ai depose un zip
sur http://www.01map.com/download/mapserver … xemple.zip

---------->>>
To:
Sent: Friday, June 11, 2004 4:20 PM
Subject: [cartonet_dev] RASTER mapserver OGR

Bonjour,

Je cherche a ouvrir une couche RASTER de mapinfos avec mapserver,
j'utilise donc le .tab via une connection OGR mais je n'arrive a rien
contrairement au couche de type POLYGON ou line.
Je cherche donc un bou de .map ou des infos pour afficher ma couche
RASTER a partir d'un .tab.

Merci d'avance

Gilles Montgaillard
DGA/SDSI/CERIT/DIG
B.P. 68 - 31326 Castanet-Tolosan Cedex
Tel. 05.61.28.92.76

 

#3 Fri 11 June 2004 00:18

Stéphane MOREL
Invité

Re: RASTER mapserver OGR

je ne pense pas qu'il soit possible d'afficher les rasters mapinfo .
Pour pouvoir affciher des rasters il faut leur adjoindre un fichier de
calage tfw.
On peut trouver cette info sur le site de Mapserver :
http://mapserver.gis.umn.edu/doc40/rast … ml#formats
---------------------------------------------------------------------------------------------------------------------------------------------------

Georeference with World Files

World files are a simple mechanism for associating georeferencing (world
coordinates) information with raster files. ESRI was the first company
to propagate the use of world files, and they often used with TIFF
instead of embedding georeferencing information in the file itself.

The world file contents look like the following. The first coefficient
is the X pixel size. The second and third are rotational/shear
coefficients (and should normally be 0.0). The fourth is the Y pixel
size, normally negative indicating that Y decreases as you move down
from the top left origin. The final two values are the X and Y location
of the center of the top left pixel. This example is for an image with a
2m x 2m pixel size, and a top left origin at (356800E, 5767999N).

2
0.0000000000
0.0000000000
-2
356800.00
5767999.00

The name of the world file is based on the file it relates to. For
instance, the world file for aerial.tif might be aerial.tfw. Conventions
vary for appropriate endings, but with MapServer the extension .wld is
always OK for world files.

---------------------------------------------------------------------------------------------------------------------------------------------------
/
/Ensuite pour que ca fonctionne, il faut mettre les fichiers raster et
les fichiers tfw dans le meme repertoire ou dans un sous-repertoire
indique dans le SHAPEPATH du Mapfile. Il faut s'assurer que le mapfile
pointe bien sur ce repertoire. Dernier point, il faut que chaque fichier
possede des droits en lecture et execution(r-x)
Pour vous simplifier la vie il existe un petit prog en mapbasic qui
genere des fichiers Tfw a partir des fichiers TAB
(http://www.directionsmag.com/files/index.php/view/263)

Stephane MOREL
/
Bonjour,

Je cherche a ouvrir une couche RASTER de mapinfos avec mapserver,
j'utilise donc le .tab via une connection OGR mais je n'arrive a rien
contrairement au couche de type POLYGON ou line.
Je cherche donc un bou de .map ou des infos pour afficher ma couche
RASTER a partir d'un .tab.

Merci d'avance

Gilles Montgaillard
DGA/SDSI/CERIT/DIG
B.P. 68 - 31326 Castanet-Tolosan Cedex
Tel. 05.61.28.92.7/ 6

 

#4 Mon 14 June 2004 17:31

Georges Daguerre
Invité

Re: RASTER mapserver OGR

Bonjour a tous.

Pour transformer le fichier de georeferencement .tab en .tfw (sans se
creuser la tete !!!), l'utilitaire Mapinfo TAB2TFW.MBX peut rendre un grand
service (en acces libre dans les bonnes boutiques ... sur Internet).

Bon courage.

Georges DAGUERRE
Charge de mission SIG
Ministere de l'Equipement
DDE 64 / AB
19, avenue de l'Adour - B.P. 246
64602 Anglet Cedex
Courriel : Georges.Daguerre@texte-a-enlever.equipement.gouv.fr
Telephone : 05 59 52 59 67
Fax 05 59 63 08 57

De : Stephane MOREL [stephane.morel@texte-a-enlever.vanoise.com]
Envoye : vendredi 11 juin 2004 16:51
À : cartonet_dev@texte-a-enlever.georezo.net
Objet : [cartonet_dev] RASTER mapserver OGR

je ne pense pas qu'il soit possible d'afficher les rasters mapinfo .
Pour pouvoir affciher des rasters il faut leur adjoindre un fichier de
calage tfw.
On peut trouver cette info sur le site de Mapserver :
http://mapserver.gis.umn.edu/doc40/rast … ml#formats
-------
-------
-----------------------------------------------------------------

Georeference with World Files

World files are a simple mechanism for associating georeferencing (world
coordinates) information with raster files. ESRI was the first company
to propagate the use of world files, and they often used with TIFF
instead of embedding georeferencing information in the file itself.

The world file contents look like the following. The first coefficient
is the X pixel size. The second and third are rotational/shear
coefficients (and should normally be 0.0). The fourth is the Y pixel
size, normally negative indicating that Y decreases as you move down
from the top left origin. The final two values are the X and Y location
of the center of the top left pixel. This example is for an image with a
2m x 2m pixel size, and a top left origin at (356800E, 5767999N).

2
0.0000000000
0.0000000000
-2
356800.00
5767999.00

The name of the world file is based on the file it relates to. For
instance, the world file for aerial.tif might be aerial.tfw. Conventions
vary for appropriate endings, but with MapServer the extension .wld is
always OK for world files.

-------
-------
-----------------------------------------------------------------
/
/Ensuite pour que ca fonctionne, il faut mettre les fichiers raster et
les fichiers tfw dans le meme repertoire ou dans un sous-repertoire
indique dans le SHAPEPATH du Mapfile. Il faut s'assurer que le mapfile
pointe bien sur ce repertoire. Dernier point, il faut que chaque fichier
possede des droits en lecture et execution(r-x)
Pour vous simplifier la vie il existe un petit prog en mapbasic qui
genere des fichiers Tfw a partir des fichiers TAB
(http://www.directionsmag.com/files/index.php/view/263)

Stephane MOREL
/
Bonjour,

Je cherche a ouvrir une couche RASTER de mapinfos avec mapserver,
j'utilise donc le .tab via une connection OGR mais je n'arrive a rien
contrairement au couche de type POLYGON ou line.
Je cherche donc un bou de .map ou des infos pour afficher ma couche
RASTER a partir d'un .tab.

Merci d'avance

Gilles Montgaillard
DGA/SDSI/CERIT/DIG
B.P. 68 - 31326 Castanet-Tolosan Cedex
Tel. 05.61.28.92.7/ 6

 

Pied de page des forums

Powered by FluxBB