#1 Wed 21 May 2003 18:23
- Ludo Pro
- Invité
transformation de coordonnees d'un DWG
Bonjour la liste,
Nous avons recu un plan DWG au cordonnees assez bizarre. Le perimetre
d'etude est en Lambert I. Le fichier DWG comprend des coordonnees de
l'ordre de 35000 en X et 40000 en Y la ou on devrait trouver des valeurs
de l'ordre de 500000 en X et 1110000 en Y
Nous aurions aime faire juste un changement de coordonnees, en esperant
garder des proportions potables.
Connaitriez-vous un outil sous ArcView 3.X (ou autre) permettant
d'effectuer cette transformation (au moins du type homothetie).
Merci pour tout aide
Ludovic
#2 Wed 04 June 2003 10:50
- Ludo Pro
- Invité
Re: transformation de coordonnees d'un DWG
Tout d'abord merci aux personnes qui ont repondu tres rapidement a notre
probleme.
#####################
# La question etait :
Nous avons recu un plan DWG . Le perimetre d'etude est en Lambert I. Le
fichier DWG comprend des coordonnees de l'ordre de 35000 en X et 40000
en Y la ou on devrait trouver des valeurs de l'ordre de 500000 en X et
1110000 en Y
Connaitriez-vous un outil sous ArcView 3.X (ou autre) permettant
d'effectuer cette transformation (au moins du type homothetie) ?
################################################
# Il nous a ete propose les solutions suivantes :
- utilisation d'une extension transform2D.avx : nous n'avons pas
reussi a l'utiliser
- utilisation d'une extension shapewarp : pas teste (merci pour l'aide
tout de meme)
- utilisation d'un fichier de georeferencement WLD : cette solution a
fonctionne pour nous. Je la reposte donc ici :
------------Extrait de l'aide en ligne d'ARCVIEW 3--------------------
Why use coordinate transformations?
When you use CAD drawing files, there’s no guarantee that the features
will be in the same coordinate system as the data in other themes you
might be displaying on your map. Some CAD drawings may be digitized in
actual ground coordinates and some may be digitized in page units such
as inches. In such cases, you can apply a coordinate transformation to
your CAD drawing themes to ensure that they register with your themes.
ArcView supports either a one-point or two-point transformations. A
one-point transformation simply shifts the CAD drawing theme to a new
location in geographic space. A two-point transformation uses a
transformation matrix that applies a coordinate offset, scale, and
rotation uniformly to all coordinates read from the drawing source. The
coordinate transformations are applied using the world file.
What is a world file?
The world file is a text file (with the extension .WLD) containing one
or two pairs of X,Y coordinates. The first pair of X,Y coordinates is
the actual X,Y location of any known control point in your drawing file.
The second pair of X,Y coordinates is a new location in geographic space
where you would want the CAD drawing control point to be in ArcView.
World file format
The world file format is shown below:
Notes
The world file must have the .WLD extension and cannot have more than
two lines in the above format.
ArcView automatically applies the world file when it finds a valid
file name with the same prefix as the drawing file name in the same
sub-directory. For example, suppose you’ve stored sample.dwg and
sample.wld files in the same sub-directory. When you add themes from
sample.dwg, ArcView automatically uses the sample.wld file for
coordinate transformations.
Examples
One point transformation
Consider the following pairs of coordinates in your world file:
25.0,60.0 25000.0,60000.0
When you apply the above world file, it will shift the CAD drawing
location (25.0,60.0) to a new location (25000.0,60000.0) in the view.
Two point transformation
Consider a case where you have two known control points in your CAD
drawing and you know the new location for one of these two control
points. You want to apply a transformation such that your CAD drawing
theme will:
1 Shift all features to the new known location
2 Uniformly apply a scale factor of 100 to all features in the theme
3 Rotate all theme features 90 degrees
You can use the following formula to calculate the new X,Y location for
the second control point:
x’ = Ax + By + C
y’ = -Bx + Ay + D
Where
x’ = calculated x value for the second control point
y’ = calculated y value for the second control point
x = x coordinate of the second CAD control point
y = y coordinate of the second CAD control point
A = s * cos(@)
B = s * sin(@)
C = x coordinate of the known new location
(translation in x direction)
D = y coordinate of the known new location
(translation in y direction)
and
s = scale change (scale factor such as 1, 1.5 etc.)
@ = rotation angle
In the above example, suppose your first control point in your CAD
drawing is (0,0) and the second control point is (12.0,9.0). The known
new location for the first control point is (1200.0,1300.0). The scale
factor is 100 and the drawing rotation angle is 90 degrees.
Using the above formula, you can calculate the new X,Y coordinates for
the second control point as shown below:
x = 12
y = 9
A = 100 * cos (90) = 0
B = 100 * sin (90) = 100
C = 1200
D = 1300
x’ = 0 + 900 + 1200 = 2100
y’ = -1200 + 0 + 1300 = 100
Therefore, the world file for this example will have values as shown below:
0,0 1200.0,1300.0
12.0,9.0 2100.0,100.0
--------------------------
Merci a Julien Radoux, Xavier Guillotin et Yves Hennequin
Cordialement
Ludovic