We highly recommend migrating to the PIX4Dengine SDK. To get access to the latest documentation please visit PIX4Dengine Server SDK.
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:
<?
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:
A minimum p4d file must always contain at least 3 images.
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.
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"/>.
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: How to use the command line.
- 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: How to use the command line.
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.
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
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.
or
from EXIF
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.
<?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>
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
The project has image geolocation in WGS84 that is not stored in the EXIF.
or
from EXIF
The output coordinate system is WGS84 UTM.
<?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>
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
The project has image geolocation given in a projected coordinate system. The image geolocation is not stored in the EXIF.
or
from EXIF
The output coordinate system is the same projected coordinate system of the images.
<?xml version=
"1.0"
encoding=
"UTF-8"
?>
<pix4dmapper>
<inputs>
<coordinateSystems>
<southingWesting>
true
</southingWesting>
<output>
<WKT>PROJCS["WGS84 / UTM zone 32N",GEOGCS["WGS
84
",
DATUM["WGS_1984",SPHEROID["WGS
84
",
6378137
,
298.257223563
,
AUTHORITY["EPSG","
7030
"]],TOWGS84[
0
,
0
,
0
,
0
,
0
,
0
,
0
],
AUTHORITY["EPSG","
6326
"]],PRIMEM["Greenwich",
0
,
AUTHORITY["EPSG","
8901
"]],UNIT["degree",
0.0174532925199433
,AUTHORITY["EPSG","
9108
"]],
AUTHORITY["EPSG","
4326
"]],PROJECTION["Transverse_Mercator"],
PARAMETER["latitude_of_origin",
0
],PARAMETER["central_meridian",
9
],
PARAMETER["scale_factor",
0.9996
],PARAMETER["false_easting",
500000
],
PARAMETER["false_northing",
0
],UNIT["Meter",
1
],
AUTHORITY["EPSG","
32632
"]]</WKT>
<verticalDef model=
"constShift"
geoidHeight=
"0"
/>
</output>
<gcp>
<WKT>PROJCS["WGS84 / UTM zone 32N",GEOGCS["WGS
84
",
DATUM["WGS_1984",SPHEROID["WGS
84
",
6378137
,
298.257223563
,
AUTHORITY["EPSG","
7030
"]],TOWGS84[
0
,
0
,
0
,
0
,
0
,
0
,
0
],
AUTHORITY["EPSG","
6326
"]],PRIMEM["Greenwich",
0
,
AUTHORITY["EPSG","
8901
"]],UNIT["degree",
0.0174532925199433
,AUTHORITY["EPSG","
9108
"]],
AUTHORITY["EPSG","
4326
"]],PROJECTION["Transverse_Mercator"],
PARAMETER["latitude_of_origin",
0
],PARAMETER["central_meridian",
9
],
PARAMETER["scale_factor",
0.9996
],PARAMETER["false_easting",
500000
],
PARAMETER["false_northing",
0
],UNIT["Meter",
1
],
AUTHORITY["EPSG","
32632
"]]</WKT>
<verticalDef model=
"constShift"
geoidHeight=
"0"
/>
</gcp>
<image>
<WKT>GEOGCS["WGS
84
",DATUM["WGS_1984",SPHEROID["
WGS
84
",
6378137
,
298.257223563
,AUTHORITY["EPSG","
7030
"]],TOWGS84[
0
,
0
,
0
,
0
,
0
,
0
,
0
],
AUTHORITY["EPSG","
6326
"]],PRIMEM["Greenwich",
0
,AUTHORITY["
EPSG","
8901
"]],UNIT["degree",
0.01745329251994328
,AUTHORITY["
EPSG","
9122
"]],AUTHORITY["EPSG","
4326
"]]</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>
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
The project has image geolocation in WGS84 that is stored in the EXIF.
or
from EXIF
The output coordinate system is WGS84 UTM.
<?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>
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
The project has image geolocation in WGS84 that is stored in the EXIF.
or
from EXIF
The output coordinate system is a projected coordinate system. It is the same as the GCP's coordinate system
<?xml version=
"1.0"
encoding=
"UTF-8"
?>
<pix4dmapper>
<inputs>
<coordinateSystems>
<southingWesting>
true
</southingWesting>
<output>
<WKT>PROJCS["CH1903+ / LV95",GEOGCS["CH1903+",
DATUM["CH1903+",SPHEROID["Bessel
1841
",
6377397.155
,
299.1528128
,
AUTHORITY["EPSG","
7004
"]],TOWGS84[
674.374
,
15.056
,
405.346
,
0
,
0
,
0
,
0
],
AUTHORITY["EPSG","
6150
"]],PRIMEM["Greenwich",
0
,
AUTHORITY["EPSG","
8901
"]],UNIT["degree",
0.0174532925199433
,
AUTHORITY["EPSG","
9122
"]],AUTHORITY["EPSG","
4150
"]],
PROJECTION["Hotine_Oblique_Mercator_Azimuth_Center"],
PARAMETER["latitude_of_center",
46.95240555555556
],
PARAMETER["longitude_of_center",
7.439583333333333
],
PARAMETER["azimuth",
90
],PARAMETER["rectified_grid_angle",
90
],
PARAMETER["scale_factor",
1
],PARAMETER["false_easting",
2600000
],
PARAMETER["false_northing",
1200000
],UNIT["metre",
1
,
AUTHORITY["EPSG","
9001
"]],AXIS["Y",EAST],
AXIS["X",NORTH],AUTHORITY["EPSG","
2056
"]]</WKT>
<verticalDef model=
"constShift"
geoidHeight=
"0"
/>
</output>
<gcp>
<WKT>PROJCS["CH1903+ / LV95",GEOGCS["CH1903+",
DATUM["CH1903+",SPHEROID["Bessel
1841
",
6377397.155
,
299.1528128
,
AUTHORITY["EPSG","
7004
"]],TOWGS84[
674.374
,
15.056
,
405.346
,
0
,
0
,
0
,
0
],
AUTHORITY["EPSG","
6150
"]],PRIMEM["Greenwich",
0
,
AUTHORITY["EPSG","
8901
"]],UNIT["degree",
0.0174532925199433
,
AUTHORITY["EPSG","
9122
"]],AUTHORITY["EPSG","
4150
"]],
PROJECTION["Hotine_Oblique_Mercator_Azimuth_Center"],
PARAMETER["latitude_of_center",
46.95240555555556
],
PARAMETER["longitude_of_center",
7.439583333333333
],
PARAMETER["azimuth",
90
],PARAMETER["rectified_grid_angle",
90
],
PARAMETER["scale_factor",
1
],PARAMETER["false_easting",
2600000
],
PARAMETER["false_northing",
1200000
],UNIT["metre",
1
,
AUTHORITY["EPSG","
9001
"]],AXIS["Y",EAST],
AXIS["X",NORTH],AUTHORITY["EPSG","
2056
"]]</WKT>
<verticalDef model=
"constShift"
geoidHeight=
"0"
/>
</gcp>
<image>
<WKT>GEOGCS["WGS
84
",DATUM["WGS_1984",SPHEROID["WGS
84
",
6378137
,
298.257223563
,AUTHORITY["EPSG","
7030
"]],TOWGS84[
0
,
0
,
0
,
0
,
0
,
0
,
0
],
AUTHORITY["EPSG","
6326
"]],PRIMEM["Greenwich",
0
,AUTHORITY["
EPSG","
8901
"]],UNIT["degree",
0.01745329251994328
,
AUTHORITY["EPSG","
9122
"]],
AUTHORITY["EPSG","
4326
"]]</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>
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
yes, in EXIF, WGS84
The project has image geolocation in WGS84 that is stored in the EXIF.
or
from EXIF
WGS84 - UTM
The output coordinate system is the same as for the images geolocation: WGS84 UTM.
<?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>