[gdal-dev] Making use of SPOT imagery mask files

Matt.Wilkie at yukon.ca Matt.Wilkie at yukon.ca
Wed Jul 28 14:58:06 PDT 2021


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 gdal-translate so they're easier to work with.

((cross posted to https://gis.stackexchange.com/questions/405077/making-use-of-spot-imagery-mask-files))

In each archive there are a series of mask files in gml<https://gis.stackexchange.com/questions/tagged/gml> format, which I can read with ogrinfo and Qgis. However the mask files don't have a coordinate system so I can't use them with the images.

>From the ogrinfo report it appears the GML are using image row and column pixel dimensions. (The matching source image is 9652 x 57083.)

$ ogrinfo \SPOT6_sample_roi.gml maskfeature

INFO: Open of `\SPOT6_sample_roi.gml'

      using driver `GML' successful.

Metadata:

  NAME=Area of interest mask for product id SPOT6_MS_201308032015087_SEN_SPOT6_20160316_1601281mdxzlrvssw12_1



Layer name: MaskFeature

Geometry: Polygon

Feature Count: 1

Extent: (1.000000, 1.000000) - (9653.000000, 57084.000000)

Layer SRS WKT:

(unknown)

gml_id: String (0.0) NOT NULL

maskType: String (18.0)

OGRFeature(MaskFeature):0

  gml_id (String) = REGION_OF_INTEREST-0

  maskType (String) = REGION_OF_INTEREST

  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))

The gdalinfo report for the source image<https://gist.github.com/maphew/513404f56b956ef3f1379b70d1d5d87f> also shows pixel coordinates for the coordinate system:

Corner Coordinates:

Upper Left  (    0.0,    0.0)

Lower Left  (    0.0,57083.0)

Upper Right ( 9652.0,    0.0)

Lower Right ( 9652.0,57083.0)

Center      ( 4826.0,28541.5)

However it also has RPC metadata that seems to be enough to have Qgis and ArcMap/Pro display it in the right geographical location:

RPC Metadata:

  HEIGHT_OFF=500.0

  HEIGHT_SCALE=500.0

  LAT_OFF=64.90742355

  LAT_SCALE=1.71583845

  ...snip...

  SAMP_OFF=4825

  SAMP_SCALE=4826.0

Sample files at https://drive.google.com/drive/folders/119QEECJ42FKt0A9mq55rRmGsT9-5nSZq?usp=sharing (The image has been resized to 10% of it's original size.)

How might I marry the raster coordinate system info to the mask files so I can use them together?
Thanks in advance for your time and thoughts,

Matt Wilkie
A / Manager
(Geomatics Developer & Administrator)
Environment | Technology, Innovation and Mapping
T 867-667-8133 | Yukon.ca<http://yukon.ca/>
Hours: 08:30-16:30, Mon-Wed: Office, Thu: Remote, Fri: Away.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20210728/54a11056/attachment.html>


More information about the gdal-dev mailing list