GCPConvert

De MicMac
Aller à : navigation, rechercher

Picto-liste.png List of commands

Description

The command GCPConvert is used to:

  • transform a set of ground control points from most text format to MicMac’s Xml format.
  • transform the ground control points into an euclidean coordinate system, suitable for MicMac.

Allowed commands

  • AppEgels
  • AppGeoCub
  • AppInFile
  • AppXML

Syntax

The global syntax for GCPConvert is :

mm3d GCPConvert FormatSpecification GCPFile NamedArgs

Help

You can access to the help by typing :

mm3d GCPConvert -help

Mandatory unnamed args :

Named args :

  • [Name=Out] string :: {Xml Out File}
  • [Name=ChSys] string :: {Change coordinate file}
  • [Name=MulCo] REAL :: {Multiplier of result (for development and testing use)}
  • [Name=MulInc] bool :: {Multiplier also incertitude ? (for development and testing use)}

Example

Launching this command,

mm3d GCPConvert AppInFile CP3D_Format.txt

or

mm3d GCPConvert "#F=N_X_Y_Z" CP3D_Format.txt

You should get a file like this:

<?xml version="1.0" ?>
<DicoAppuisFlottant>
     <OneAppuisDAF>
          <Pt>301.610 939.1341 144.75</Pt>
          <NamePt>30</NamePt>
          <Incertitude>1 1 1</Incertitude>
     </OneAppuisDAF>
     <OneAppuisDAF>
          <Pt>301.412 937.530 144.787</Pt>
          <NamePt>31</NamePt>
          <Incertitude>1 1 1</Incertitude>
     </OneAppuisDAF>
</DicoAppuisFlottant>

Uncertainty in output XML file

As seen in previous example, the uncertainty of each ground control point is fixed by default at the value of one ground unit in each direction of the coordinate system:

<Incertitude>1 1 1</Incertitude>

In case of using the generated GCP file with Campari for bundle adjustment, you'll have to specify a factor which will be alter this uncertainty. So, if uncertainty is equal for each direction and each point, it's easier to specify it by this way. In the following example, factor of 0.002 generates an uncertainty of 2 mm in a metric coordinate system.

mm3d Campari ".*JPG" MEP_Basc2 MEP_Terrain GCP=[Targets.xml,0.002,Targets_Final-S2D.xml,0.5]


Formatting the input GCP file

If you don't use an AppXML formatted file (in fact a MicMac's XML file), the input file has to be a space or tabulation separated values file (no comma or other symbols). You can use 'Egels' or 'GeoCub' format, or describe your file as explained below.

AppGeoCub

Text file is formatted as:

PointNumber    X    Y    Z

Lines beginning with '%' are considered as comments.

AppEgels

Text file is formatted as:

PointNumber  VariableNonImported  X    Y    Z

Lines beginning with '#' are considered as comments.

This file format is used by some IGN/ENSG softwares developed by Yves Egels[1].

AppInFile

The first line describes name and position of the rows. It begins by '#F= ', where

  • the first character '#' means that all line beginning by a # will be a comment;
  • the two characters 'F=' mean that this is really a format specification;

'#F= ' followed by the format specification :

  • 'N' means the name of the point;
  • 'X', 'Y', 'Z' means the coordinates;
  • 'Ix', 'Iy', 'Iz' means the accuracy (not mandatory);
  • S means a string which has not to be interpreted;

separated by spaces.

You can reorder this format as you want.

Example 1:

#F= N X Y Z Ix Iy Iz
157 233.28 144.03 103.05 0.00332 0.0034 0.0039
158 317.011 -0.00000 0.0000 0.0053 0.0060 0.0071
  • N means the first string of each line is the name of the point;
  • X, Y, Z means that this strings number 2, 3 and 4 are the coordinates;
  • Ix, Iy, Iz means that this strings number 5, 6 and 7 are the accuracy;

Example 2:

#F= N S X Y Z
300 3 94.208685 658.506787 42.39556
301 3 95.323427 656.409116 43.502239
302 3 97.008135 654.424482 45.084237
  • N means the first string of each line is the name of the point;
  • S means the 2nd string has not to be interpreted;
  • X, Y, Z means that this strings number 3, 4 and 5 are the coordinates.

Known limitations

GCPConverts add many decimals to coordinates

As reported [[2]], GCPConvert alters slightly values during the conversion, by adding non significant decimals. So instead of taking back this file:

<?xml version="1.0" ?>
<DicoAppuisFlottant>
     <OneAppuisDAF>
          <Pt>301.610 939.1341 144.75</Pt>
          <NamePt>30</NamePt>
          <Incertitude>1 1 1</Incertitude>
     </OneAppuisDAF>
     <OneAppuisDAF>
          <Pt>301.412 937.530 144.787</Pt>
          <NamePt>31</NamePt>
          <Incertitude>1 1 1</Incertitude>
     </OneAppuisDAF>
</DicoAppuisFlottant>

You may rather obtain this one:

<?xml version="1.0" ?>
<DicoAppuisFlottant>
     <OneAppuisDAF>
          <Pt>301.61000000000001 939.13400000000001 144.75</Pt>
          <NamePt>30</NamePt>
          <Incertitude>1 1 1</Incertitude>
     </OneAppuisDAF>
     <OneAppuisDAF>
          <Pt>301.41199999999998 937.52999999999997 144.78700000000001</Pt>
          <NamePt>31</NamePt>
          <Incertitude>1 1 1</Incertitude>
     </OneAppuisDAF>
</DicoAppuisFlottant>