<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
code
        {mso-style-priority:99;
        font-family:"Courier New";}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Arial",sans-serif;
        color:windowtext;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:"Courier New";
        mso-fareast-language:EN-CA;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-CA" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p>I'm working with SPOT 6 and 7 imagery delivered in DIMAP format. I've figured out how to extract the multispectral and pan-chromatic bands into geotiff with
<code><span style="font-size:10.0pt">gdal-translate</span></code> so they're easier to work with.<o:p></o:p></p>
<p style="margin-left:36.0pt"><i>((cross posted to <a href="https://gis.stackexchange.com/questions/405077/making-use-of-spot-imagery-mask-files">
https://gis.stackexchange.com/questions/405077/making-use-of-spot-imagery-mask-files</a>))<o:p></o:p></i></p>
<p>In each archive there are a series of mask files in <a href="https://gis.stackexchange.com/questions/tagged/gml" title="show questions tagged 'gml'">
gml</a> format, which I can read with <code><span style="font-size:10.0pt">ogrinfo</span></code> and Qgis. However the mask files don't have a coordinate system so I can't use them with the images.<o:p></o:p></p>
<p>From the ogrinfo report it appears the GML are using image row and column pixel dimensions. (The matching source image is 9652 x 57083.)<o:p></o:p></p>
<pre><code>$ ogrinfo \SPOT6_sample_roi.gml maskfeature<o:p></o:p></code></pre>
<pre><code>INFO: Open of `\SPOT6_sample_roi.gml'<o:p></o:p></code></pre>
<pre><code>      using driver `GML' successful.<o:p></o:p></code></pre>
<pre><code>Metadata:<o:p></o:p></code></pre>
<pre><code>  NAME=Area of interest mask for product id SPOT6_MS_201308032015087_SEN_SPOT6_20160316_1601281mdxzlrvssw12_1<o:p></o:p></code></pre>
<pre><code><o:p> </o:p></code></pre>
<pre><code>Layer name: MaskFeature<o:p></o:p></code></pre>
<pre><code>Geometry: Polygon<o:p></o:p></code></pre>
<pre><code>Feature Count: 1<o:p></o:p></code></pre>
<pre><code>Extent: (1.000000, 1.000000) - (9653.000000, 57084.000000)<o:p></o:p></code></pre>
<pre><code>Layer SRS WKT:<o:p></o:p></code></pre>
<pre><code>(unknown)<o:p></o:p></code></pre>
<pre><code>gml_id: String (0.0) NOT NULL<o:p></o:p></code></pre>
<pre><code>maskType: String (18.0)<o:p></o:p></code></pre>
<pre><code>OGRFeature(MaskFeature):0<o:p></o:p></code></pre>
<pre><code>  gml_id (String) = REGION_OF_INTEREST-0<o:p></o:p></code></pre>
<pre><code>  maskType (String) = REGION_OF_INTEREST<o:p></o:p></code></pre>
<pre><code>  POLYGON ((9645.1767578125 6.41328716278076,9645.162109375 5.32240867614746,9645.03125 4.30024194717407,9644.7841796875 3.2741334438324,9644.5390625 2.39344930648804,9644.181640625 1.72693908214569,9643.7666015625 1.20388793945312,9643.4931640625 1.0,8939.99609375 1.0,1.0 4.3671669960022,1.0 28542.5,1 57084,9653 57084,9653.0 45960.265625,9645.1767578125 6.41328716278076))<o:p></o:p></code></pre>
<p><a href="https://gist.github.com/maphew/513404f56b956ef3f1379b70d1d5d87f">The gdalinfo report for the source image</a> also shows pixel coordinates for the coordinate system:<o:p></o:p></p>
<pre><code>Corner Coordinates:<o:p></o:p></code></pre>
<pre><code>Upper Left  (    0.0,    0.0)<o:p></o:p></code></pre>
<pre><code>Lower Left  (    0.0,57083.0)<o:p></o:p></code></pre>
<pre><code>Upper Right ( 9652.0,    0.0)<o:p></o:p></code></pre>
<pre><code>Lower Right ( 9652.0,57083.0)<o:p></o:p></code></pre>
<pre><code>Center      ( 4826.0,28541.5)<o:p></o:p></code></pre>
<p>However it also has RPC metadata that seems to be enough to have Qgis and ArcMap/Pro display it in the right geographical location:<o:p></o:p></p>
<pre><code>RPC Metadata:<o:p></o:p></code></pre>
<pre><code>  HEIGHT_OFF=500.0<o:p></o:p></code></pre>
<pre><code>  HEIGHT_SCALE=500.0<o:p></o:p></code></pre>
<pre><code>  LAT_OFF=64.90742355<o:p></o:p></code></pre>
<pre><code>  LAT_SCALE=1.71583845<o:p></o:p></code></pre>
<pre><code>  ...snip...<o:p></o:p></code></pre>
<pre><code>  SAMP_OFF=4825<o:p></o:p></code></pre>
<pre><code>  SAMP_SCALE=4826.0<o:p></o:p></code></pre>
<p>Sample files at <a href="https://drive.google.com/drive/folders/119QEECJ42FKt0A9mq55rRmGsT9-5nSZq?usp=sharing">
https://drive.google.com/drive/folders/119QEECJ42FKt0A9mq55rRmGsT9-5nSZq?usp=sharing</a> (The image has been resized to 10% of it's original size.)<o:p></o:p></p>
<p><strong>How might I marry the raster coordinate system info to the mask files so I can use them together?</strong><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif">Thanks in advance for your time and thoughts,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif"><o:p> </o:p></span></p>
<p class="MsoNormal" style="margin-top:4.0pt;line-height:115%;text-autospace:none;vertical-align:middle">
<b><span lang="EN-US" style="font-size:9.0pt;line-height:115%;font-family:"Arial",sans-serif;mso-fareast-language:EN-CA">Matt Wilkie</span></b><span lang="EN-US" style="font-size:9.0pt;line-height:115%;font-family:"Arial",sans-serif;mso-fareast-language:EN-CA"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:9.0pt;font-family:"Arial",sans-serif;mso-fareast-language:EN-CA">A / Manager<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:9.0pt;font-family:"Arial",sans-serif;mso-fareast-language:EN-CA">(Geomatics Developer & Administrator)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:9.0pt;font-family:"Arial",sans-serif;mso-fareast-language:EN-CA">Environment
<span style="color:#2E74B5">|</span> Technology, Innovation and Mapping<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:9.0pt;font-family:"Arial",sans-serif;mso-fareast-language:EN-CA">T 867-667-8133
<span style="color:#2E74B5">|</span> </span><u><span style="font-size:9.0pt;font-family:"Arial",sans-serif;mso-fareast-language:EN-CA"><a href="http://yukon.ca/"><span lang="EN-US" style="color:windowtext">Yukon.ca</span></a><o:p></o:p></span></u></p>
<p class="MsoNormal"><i><span style="font-size:9.0pt;font-family:"Arial",sans-serif;mso-fareast-language:EN-CA">Hours: 08:30-16:30, Mon-Wed: Office, Thu: Remote, Fri: Away.<o:p></o:p></span></i></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>