.p4d minimum format

This article describes the format of the p4d file and how to write a minimum p4d file that can be automatically read by Pix4Dmapper. Minimum p4d files are useful for projects that cannot be created with the command line option, or when pix4dmapper.exe is not available to create the project.

p4d file format

The .p4d project file contains information about the project such as images, coordinate systems, GCPs, processing options, etc. The .p4d file is in XML format and has a formal definition by means of a XSD (XML Schema Document) file. The XSD file can be found in the installation directory in "resources/xsd/pix4d_*.xsd"

The .p4d file has the following structure:

p4d 2.1 format summary
<?xml version="1.0" encoding="UTF-8"?>
<pix4dmapper>
    <software>
        <!--Contains info about the software (version, edition, ...) -->
    </software>
    <options>
        <!--Contains info about the processing options -->
        </initial>
        </dense>
        </ortho>
        </index>
    </options>
    <inputs>
        <!--Contains info about the project inputs (images, gcps, etc...)-->
        <!-- /!\ ORDER of inputs MATTERS -->     
        </cameras>
        </coordinateSystems>
        </gcps>
        </images>
        </processingArea>
        </indexRegions>
        </rayCloudObjects>
    </inputs>
</pix4dmapper>

 

Minimum p4d file

A minimum p4d file is a p4d file that contains a minimum set of information that can be opened into Pix4Dmapper.

This file must contain at least 3 images. Optionally, it can contain other information such as coordinate systems, GCPs or processing areas. When a minimum p4d file is imported into Pix4Dmapper, the missing information (camera model, coordinate systems, processing options, etc.) is automatically completed by the software.

The following information can be specified in a minimum p4d file:

Images

A minimum p4d file must always contain at least 3 images.

Image geolocation
If the image geolocation is in the EXIF, it will be automatically loaded from there when the p4d file is read. Otherwise it is possible to specify the image geolocation directly in the p4d file as well as the coordinate system if it is different from WGS84.
Camera model
It is recommended to use cameras that are in the internal database or where the camera model can be read from the EXIF. Therefore, the camera model should not be written in the minimum p4d file. If the camera model is in the database it will be loaded from there. Otherwise it will be read from the EXIF.
GCPs

When a project has GCPs, the minimum p4d file must contain:

  • A list of GCPs.
  • The coordinate system for the images, GCPs and outputs.
  • Image marks.
Coordinate systems

The coordinate system must be defined for:

  • The images.
  • The GCPs.
  • The outputs.

Both the horizontal and vertical coordinate systems must be defined.

Horizontal coordinate system

The horizontal coordinate system is defined through a WKT string using the <WKT> tag. WKT strings can be found here: http://spatialreference.org/

Vertical coordinate system

The following vertical systems are supported:

  • MSL - egm96: <verticalDef model="egm96"/>.
  • MSL - egm84: <verticalDef model="egm84"/>.
  • MSL - egm2008: <verticalDef model="egm2008"/>.
  • Geoid height above ellipsoid - height: <verticalDef model="constShift" geoidHeight="40"/>.
  • Arbitrary (not recommended to explicitly write it in the minimum p4d): <verticalDef model="noConv"/>.
Processing area
The processing area can be given either in WGS84 or in the output coordinate system.
Processing options

The processing options should only be set using templates. When working with minimum p4d files, the templates can be set using the following ways:

  • Use the tag <loadTemplate> in the minimum p4d to define which pre-defined template is  loaded when the minimum p4d is opened. Use the same template name as for the command line. The name can be be found using --template-list. For more information: 202560329.
  • When no template is defined in the minimum p4d file, a default template is loaded. In general it is the 3D Maps template. The template can then either be manually changed in the UI, or another template can be applied for processing when using the command line. For more information about the command line: 202560329.

 

Minimum p4d files examples

This section gives some example of minimum p4d files depending on the project's characteristics.

  • Example 1: For projects that consist only of images and have the image geolocation in the EXIF, or no image geolocation.
  • Example 2: For projects that consist only of images and do not have the image geolocation in the EXIF.
  • Example 3: For projects that consist only of images that have geolocation given in a projected coordinate system.
  • Example 4: For projects that consist of images that have the image geolocation in the EXIF and have a processing area.
  • Example 5: For projects that consist of images that have the image geolocation in the EXIF and have GCPs with image marks.
  • Example 6: For projects that consist of images that have the image geolocation in the EXIF and should use the 3D Models pre-defined template.
Example 1

For projects that consist only of images and have the image geolocation in the EXIF, or no image geolocation.

Minimum p4d content

  • Image list.

Project characteristics

Images yes, min 3 images The project contains a list of images. At least 3 images must be given.
Image geolocation

case a) yes, in EXIF, WGS84

case b) no

There are 2 cases:

case a) The project has image geolocation in WGS84 that is stored in the EXIF.

or

case b) The project has no image geolocation, neither in the EXIF nor in an external file.

Camera model in DB
or
from EXIF
The camera used for the project has either the corresponding camera model in the database or it can be loaded from the EXIF.
GCP no The project does not have GCPs.
Output coordinate system

case a) WGS84 - UTM

case b) Arbitrary

The output coordinate system is the same as for the images geolocation:

case a) The output coordinate system is WGS84 UTM.

or

case b) The output coordinate system is Arbitrary.

Processing area no The project does not have a processing area.
Processing options/template Default: 3D Maps The project will load the default template, which is the 3D Maps template.
 
Example:
<?xml version="1.0" encoding="UTF-8"?>
<pix4dmapper>
    <inputs>
        <images>
            <image path="D:/guided_tour/images/IMG_4082.JPG/"/>
            <image path="D:/guided_tour/images/IMG_4083.JPG/"/>
            <image path="D:/guided_tour/images/IMG_4087.JPG/"/>
            <image path="D:/guided_tour/images/IMG_4088.JPG/"/>
        </images>
    </inputs>
</pix4dmapper>
Example 2

For projects that consist only of images and do not have the image geolocation in the EXIF.

Minimum p4d content

  • Image list with GPS positions.

Project characteristics

Images yes, min 3 images The project contains a list of images. At least 3 images must be given.
Image geolocation yes, WGS84

The project has image geolocation in WGS84 that is not stored in the EXIF.

Camera model in DB
or
from EXIF
The camera used for the project has either the corresponding camera model in the database or it can be loaded from the EXIF.
GCP no The project does not have GCPs.
Output coordinate system WGS84 - UTM

The output coordinate system is WGS84 UTM.

Processing area no The project does not have a processing area.
Processing options/template Default: 3D Maps The project will load the default template, which is the 3D Maps template.
 
Example:
<?xml version="1.0" encoding="UTF-8"?>
<pix4dmapper>
    <inputs>
        <images>
            <image path="D:/guided_tour/images/IMG_4082.JPG">
                <gps lat="46.3414965400039" lng="8.02588605999496" alt="914.066589355469"/>
            </image>
            <image path="D:/guided_tour/images/IMG_4083.JPG">
                <gps lat="46.3411381999907" lng="8.02537270001017" alt="914.736022949219"/>
            </image>
            <image path="D:/guided_tour/images/IMG_4087.JPG">
                <gps lat="46.3411327000576" lng="8.02484090003983" alt="914.903991699219"/>
            </image>
        </images>
    </inputs>
</pix4dmapper>
Example 3

For projects that consist only of images that have geolocation given in a projected coordinate system.

Minimum p4d content

  • Image list with geolocation in a projected coordinate system.
  • Image, GCP, Output coordinate system.

Project characteristics

Images yes, min 3 images The project contains a list of images. At least 3 images must be given.
Image geolocation yes, projected CS (X,Y,Z)

The project has image geolocation given in a projected coordinate system. The image geolocation is not stored in the EXIF.

Camera model in DB
or
from EXIF
The camera used for the project has either the corresponding camera model in the database or it can be loaded from the EXIF.
GCP no The project does not have GCPs.
Output coordinate system same as image coordinate system

The output coordinate system is the same projected coordinate system of the images.

Processing area no The project does not have a processing area.
Processing options/template Default: 3D Maps The project will load the default template, which is the 3D Maps template.
 
Example:
<?xml version="1.0" encoding="UTF-8"?>
<pix4dmapper>
    <inputs>
        <coordinateSystems>
            <southingWesting>true</southingWesting>
            <output>
                <WKT>PROJCS[&quot;WGS84 / UTM zone 32N&quot;,GEOGCS[&quot;WGS 84&quot;,
                DATUM[&quot;WGS_1984&quot;,SPHEROID[&quot;WGS 84&quot;,6378137,298.257223563,
                AUTHORITY[&quot;EPSG&quot;,&quot;7030&quot;]],TOWGS84[0,0,0,0,0,0,0],
                AUTHORITY[&quot;EPSG&quot;,&quot;6326&quot;]],PRIMEM[&quot;Greenwich&quot;,0,
                AUTHORITY[&quot;EPSG&quot;,&quot;8901&quot;]],UNIT[&quot;degree&quot;,
                0.0174532925199433,AUTHORITY[&quot;EPSG&quot;,&quot;9108&quot;]],
                AUTHORITY[&quot;EPSG&quot;,&quot;4326&quot;]],PROJECTION[&quot;Transverse_Mercator&quot;],
                PARAMETER[&quot;latitude_of_origin&quot;,0],PARAMETER[&quot;central_meridian&quot;,9],
                PARAMETER[&quot;scale_factor&quot;,0.9996],PARAMETER[&quot;false_easting&quot;,500000],
                PARAMETER[&quot;false_northing&quot;,0],UNIT[&quot;Meter&quot;,1],
                AUTHORITY[&quot;EPSG&quot;,&quot;32632&quot;]]</WKT>
                <verticalDef model="constShift" geoidHeight="0"/>
            </output>
            <gcp>
                <WKT>PROJCS[&quot;WGS84 / UTM zone 32N&quot;,GEOGCS[&quot;WGS 84&quot;,
                DATUM[&quot;WGS_1984&quot;,SPHEROID[&quot;WGS 84&quot;,6378137,298.257223563,
                AUTHORITY[&quot;EPSG&quot;,&quot;7030&quot;]],TOWGS84[0,0,0,0,0,0,0],
                AUTHORITY[&quot;EPSG&quot;,&quot;6326&quot;]],PRIMEM[&quot;Greenwich&quot;,0,
                AUTHORITY[&quot;EPSG&quot;,&quot;8901&quot;]],UNIT[&quot;degree&quot;,
                0.0174532925199433,AUTHORITY[&quot;EPSG&quot;,&quot;9108&quot;]],
                AUTHORITY[&quot;EPSG&quot;,&quot;4326&quot;]],PROJECTION[&quot;Transverse_Mercator&quot;],
                PARAMETER[&quot;latitude_of_origin&quot;,0],PARAMETER[&quot;central_meridian&quot;,9],
                PARAMETER[&quot;scale_factor&quot;,0.9996],PARAMETER[&quot;false_easting&quot;,500000],
                PARAMETER[&quot;false_northing&quot;,0],UNIT[&quot;Meter&quot;,1],
                AUTHORITY[&quot;EPSG&quot;,&quot;32632&quot;]]</WKT>
                <verticalDef model="constShift" geoidHeight="0"/>
            </gcp>
            <image>
                <WKT>GEOGCS[&quot;WGS 84&quot;,DATUM[&quot;WGS_1984&quot;,SPHEROID[&quot;
                WGS 84&quot;,6378137,298.257223563,AUTHORITY[&quot;EPSG&quot;,&quot;7030&quot;]],TOWGS84[0,0,0,0,0,0,0],
                AUTHORITY[&quot;EPSG&quot;,&quot;6326&quot;]],PRIMEM[&quot;Greenwich&quot;,0,AUTHORITY[&quot;
                EPSG&quot;,&quot;8901&quot;]],UNIT[&quot;degree&quot;,0.01745329251994328,AUTHORITY[&quot;
                 EPSG&quot;,&quot;9122&quot;]],AUTHORITY[&quot;EPSG&quot;,&quot;4326&quot;]]</WKT>
                <verticalDef model="constShift" geoidHeight="0"/>
            </image>
        </coordinateSystems>
        <images>
            <image path="D:/guided_tour/images/IMG_4082.JPG">
                <xyz x="425037.646559" y="5132452.279486" z="914.066589"/>
            </image>
            <image path="D:/guided_tour/images/IMG_4083.JPG">
                <xyz x="424997.651379" y="5132412.949416" z="914.736023"/>
            </image>
            <image path="D:/guided_tour/images/IMG_4087.JPG">
                <xyz x="424956.719418" y="5132412.842123" z="914.903992"/>
            </image>
        </images>
    </inputs>
</pix4dmapper>
Example 4

For projects that consist of images that have the image geolocation in the EXIF and have a processing area.

Minimum p4d content

  • Image list.
  • Processing area.

Project characteristics

Images yes, min 3 images The project contains a list of images. At least 3 images must be given.
Image geolocation yes, in EXIF, WGS84

The project has image geolocation in WGS84 that is stored in the EXIF.

Camera model in DB
or
from EXIF
The camera used for the project has either the corresponding camera model in the database or it can be loaded from the EXIF.
GCP no The project does not have GCPs.
Output coordinate system WGS84 - UTM

The output coordinate system is WGS84 UTM.

Processing area yes The project has a processing area.
Processing options/template Default: 3D Maps The project will load the default template, which is the 3D Maps template.
 
Example:
<?xml version="1.0" encoding="UTF-8"?>
<pix4dmapper>
    <inputs>
        <images>
            <image path="D:/guided_tour/images/IMG_4082.JPG/"/>
            <image path="D:/guided_tour/images/IMG_4083.JPG/"/>
            <image path="D:/guided_tour/images/IMG_4087.JPG/"/>
            <image path="D:/guided_tour/images/IMG_4088.JPG/"/>
            <image path="D:/guided_tour/images/IMG_4089.JPG/"/>
        </images>
        <processingArea>
            <geoCoord2D x="424907.363521081" y="5132487.476173564"/>
            <geoCoord2D x="424964.352052119" y="5132555.503014828"/>
            <geoCoord2D x="425082.030328863" y="5132522.777422256"/>
            <geoCoord2D x="425018.293691834" y="5132409.561053967"/>
            <geoCoord2D x="424925.060836578" y="5132449.395196952"/>
        </processingArea>
    </inputs>
</pix4dmapper>
Example 5

For projects that consist of images that have the image geolocation in the EXIF and have GCPs with image marks.

Minimum p4d content

  • Image list with GPS position and GCP image marks.
  • GCP list.
  • Image, GCP, Output coordinate system. 

Project characteristics

Images yes, min 3 images The project contains a list of images. At least 3 images must be given.
Image geolocation yes, in EXIF, WGS84

The project has image geolocation in WGS84 that is stored in the EXIF.

Camera model in DB
or
from EXIF
The camera used for the project has either the corresponding camera model in the database or it can be loaded from the EXIF.
GCP yes The project has GCPs.
Output coordinate system projected coordinate system, same as GCPs

The output coordinate system is a projected coordinate system. It is the same as the GCP's coordinate system

Processing area no The project does not have a processing area.
Processing options/template Default: 3D Maps The project will load the default template, which is the 3D Maps template.
 
Example:
<?xml version="1.0" encoding="UTF-8"?>
<pix4dmapper>
    <inputs>
        <coordinateSystems>
            <southingWesting>true</southingWesting>
            <output>
                <WKT>PROJCS[&quot;CH1903+ / LV95&quot;,GEOGCS[&quot;CH1903+&quot;,
                DATUM[&quot;CH1903+&quot;,SPHEROID[&quot;Bessel 1841&quot;,6377397.155,299.1528128,
                AUTHORITY[&quot;EPSG&quot;,&quot;7004&quot;]],TOWGS84[674.374,15.056,405.346,0,0,0,0],
                AUTHORITY[&quot;EPSG&quot;,&quot;6150&quot;]],PRIMEM[&quot;Greenwich&quot;,0,
                AUTHORITY[&quot;EPSG&quot;,&quot;8901&quot;]],UNIT[&quot;degree&quot;,0.0174532925199433,
                AUTHORITY[&quot;EPSG&quot;,&quot;9122&quot;]],AUTHORITY[&quot;EPSG&quot;,&quot;4150&quot;]],
                PROJECTION[&quot;Hotine_Oblique_Mercator_Azimuth_Center&quot;],
                PARAMETER[&quot;latitude_of_center&quot;,46.95240555555556],
                PARAMETER[&quot;longitude_of_center&quot;,7.439583333333333],
                PARAMETER[&quot;azimuth&quot;,90],PARAMETER[&quot;rectified_grid_angle&quot;,90],
                PARAMETER[&quot;scale_factor&quot;,1],PARAMETER[&quot;false_easting&quot;,2600000],
                PARAMETER[&quot;false_northing&quot;,1200000],UNIT[&quot;metre&quot;,1,
                AUTHORITY[&quot;EPSG&quot;,&quot;9001&quot;]],AXIS[&quot;Y&quot;,EAST],
                AXIS[&quot;X&quot;,NORTH],AUTHORITY[&quot;EPSG&quot;,&quot;2056&quot;]]</WKT>
                <verticalDef model="constShift" geoidHeight="0"/>
            </output>
            <gcp>
                <WKT>PROJCS[&quot;CH1903+ / LV95&quot;,GEOGCS[&quot;CH1903+&quot;,
                DATUM[&quot;CH1903+&quot;,SPHEROID[&quot;Bessel 1841&quot;,6377397.155,299.1528128,
                AUTHORITY[&quot;EPSG&quot;,&quot;7004&quot;]],TOWGS84[674.374,15.056,405.346,0,0,0,0],
                AUTHORITY[&quot;EPSG&quot;,&quot;6150&quot;]],PRIMEM[&quot;Greenwich&quot;,0,
                AUTHORITY[&quot;EPSG&quot;,&quot;8901&quot;]],UNIT[&quot;degree&quot;,0.0174532925199433,
                AUTHORITY[&quot;EPSG&quot;,&quot;9122&quot;]],AUTHORITY[&quot;EPSG&quot;,&quot;4150&quot;]],
                PROJECTION[&quot;Hotine_Oblique_Mercator_Azimuth_Center&quot;],
                PARAMETER[&quot;latitude_of_center&quot;,46.95240555555556],
                PARAMETER[&quot;longitude_of_center&quot;,7.439583333333333],
                PARAMETER[&quot;azimuth&quot;,90],PARAMETER[&quot;rectified_grid_angle&quot;,90],
                PARAMETER[&quot;scale_factor&quot;,1],PARAMETER[&quot;false_easting&quot;,2600000],
                PARAMETER[&quot;false_northing&quot;,1200000],UNIT[&quot;metre&quot;,1,
                AUTHORITY[&quot;EPSG&quot;,&quot;9001&quot;]],AXIS[&quot;Y&quot;,EAST],
                AXIS[&quot;X&quot;,NORTH],AUTHORITY[&quot;EPSG&quot;,&quot;2056&quot;]]</WKT>
                <verticalDef model="constShift" geoidHeight="0"/>
            </gcp>
            <image>
                <WKT>GEOGCS[&quot;WGS 84&quot;,DATUM[&quot;WGS_1984&quot;,SPHEROID[&quot;WGS 84&quot;,
                6378137,298.257223563,AUTHORITY[&quot;EPSG&quot;,&quot;7030&quot;]],TOWGS84[0,0,0,0,0,0,0],
                AUTHORITY[&quot;EPSG&quot;,&quot;6326&quot;]],PRIMEM[&quot;Greenwich&quot;,0,AUTHORITY[&quot;
                EPSG&quot;,&quot;8901&quot;]],UNIT[&quot;degree&quot;,0.01745329251994328,
                AUTHORITY[&quot;EPSG&quot;,&quot;9122&quot;]],
                AUTHORITY[&quot;EPSG&quot;,&quot;4326&quot;]]</WKT>
                <verticalDef model="constShift" geoidHeight="0"/>
            </image>
        </coordinateSystems>
        <gcps>
            <GCP label="GCP34" x="2645179.6829" y="1132492.3415" z="714.5561" id="0" type="3DGCP"/>
            <GCP label="GCP35" x="2645181.2668" y="1132427.7042" z="710.6317" id="1" type="3DGCP"/>
            <GCP label="GCP36" x="2645120.8904" y="1132344.4249" z="713.0474" id="2" type="3DGCP"/>
            <GCP label="GCP37" x="2645104.4556" y="1132422.4822" z="713.2078" id="3" type="3DGCP"/>
        </gcps>
        <images>
            <image path="D:/guided_tour/images/IMG_4082.JPG">
                <gps lat="46.3414965400039" lng="8.02588605999496" alt="914.066589355469" />
                <imageGCP x="2540.19431702924" y="1427.43502245644" id="1"/>
            </image>
            <image path="D:/guided_tour/images/IMG_4083.JPG">
                <gps lat="46.3411381999907" lng="8.02537270001017" alt="914.736022949219"/>
                <imageGCP x="2338.86753301507" y="559.488567046065" id="2"/>
            </image>
            <image path="D:/guided_tour/images/IMG_4087.JPG">
                <gps lat="46.3411327000576" lng="8.02484090003983" alt="914.903991699219"/>
            </image>
        </images>
    </inputs>
</pix4dmapper>
Example 6

For projects that consist of images that have the image geolocation in the EXIF and should use the 3D Models pre-defined template.

Minimum p4d content

  • Image list.
  • Template to load when project opens the first time.

Project characteristics

Images yes, min 3 images The project contains a list of images. At least 3 images must be given.
Image geolocation

yes, in EXIF, WGS84

The project has image geolocation in WGS84 that is stored in the EXIF.

Camera model in DB
or
from EXIF
The camera used for the project has either the corresponding camera model in the database or it can be loaded from the EXIF.
GCP no The project does not have GCPs.
Output coordinate system

WGS84 - UTM

The output coordinate system is the same as for the images geolocation: WGS84 UTM.

Processing area no The project does not have a processing area.
Processing options/template 3D Models The project will load the template specified by <loadTemplate>, which is the 3D Models template in this example.
 
Example:
<?xml version="1.0" encoding="UTF-8"?>
<pix4dmapper>
    <options>
        <loadTemplate>3d-models</loadTemplate>
    </options>
    <inputs>
        <images>
            <image path="D:/guided_tour/images/IMG_4082.JPG/"/>
            <image path="D:/guided_tour/images/IMG_4083.JPG/"/>
            <image path="D:/guided_tour/images/IMG_4087.JPG/"/>
            <image path="D:/guided_tour/images/IMG_4088.JPG/"/>
        </images>
    </inputs>
</pix4dmapper>

 

Was this article helpful?
0 out of 0 found this helpful