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.

In each archive there are a series of mask files in 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.
  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:
gml_id: String (0.0) NOT NULL
maskType: String (18.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 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:

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?

1 Answer 1


A small piece of progress: we can use gdaltransform -rpc to get lat-long (or any other coordinate system) results for the pixel locations of the image:

$ gdaltransform -rpc DS_SPOT6_201308032015087_LM1_FR1_FR1_FR1_W137N65_10315\PROD_SPOT6_001\VOL_SPOT6_001_A\IMG_SPOT6_MS_001_A\DIM_SPOT6_MS_201308032015087_SEN_1.XML
Enter column line values separated by space, and press Return.
0.0 57083.0
-137.766376889524 63.1915449659547 0
9652.0    0.0
-136.420879379204 66.6213864498263 0

These are the corner coordinates of the gdalinfo report, and they match the image as ArcMap displays it.

corner coordinates displayed over satellite image

So in python we could loop through the vertices of each GML polygon coordinate pair and transform using the above method, but it seems there should be a more straightforward path.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.