6

I'm trying to process Sentinel-1 data downloaded from SCIHub using Rasterio.

When I open a Sentinel-2 raster taken from the Amazon Web Services Sentinel 2 dataset the Affine, Transform and CRS are read correctly:

import rasterio

r = rasterio.open('B01.jp2')
r.crs
CRS({'init': u'epsg:32630'})

r.affine
Affine(60.0, 0.0, 499980.0,
   0.0, -60.0, 5900040.0)

However, when I open a Sentinel-1 raster taken from SCIHub a warning is printed:

import rasterio

src = rasterio.open('s1a-iw-grd-vh-20170322t062239-20170322t062304-015801-01a061-002.tiff')
UserWarning: Dataset has no geotransform set.  Default transform will be applied (Affine.identity())

src.crs
CRS({})

src.affine
Affine(1.0, 0.0, 0.0,
   0.0, 1.0, 0.0)

I checked the metadata of the two files using gdalinfo.

Here's Sentinel-2 (which works):

gdalinfo B01.jp2 
Driver: JP2OpenJPEG/JPEG-2000 driver based on OpenJPEG library
Files: B01.jp2
Size is 1830, 1830
Coordinate System is:
PROJCS["WGS 84 / UTM zone 30N",
    GEOGCS["WGS 84",
        DATUM["WGS_1984",
            SPHEROID["WGS 84",6378137,298.257223563,
                AUTHORITY["EPSG","7030"]],
            AUTHORITY["EPSG","6326"]],
        PRIMEM["Greenwich",0,
            AUTHORITY["EPSG","8901"]],
        UNIT["degree",0.0174532925199433,
            AUTHORITY["EPSG","9122"]],
        AXIS["Latitude",NORTH],
        AXIS["Longitude",EAST],
        AUTHORITY["EPSG","4326"]],
    PROJECTION["Transverse_Mercator"],
    PARAMETER["latitude_of_origin",0],
    PARAMETER["central_meridian",-3],
    PARAMETER["scale_factor",0.9996],
    PARAMETER["false_easting",500000],
    PARAMETER["false_northing",0],
    UNIT["metre",1,
        AUTHORITY["EPSG","9001"]],
    AXIS["Easting",EAST],
    AXIS["Northing",NORTH],
    AUTHORITY["EPSG","32630"]]
Origin = (499980.000000000000000,5900040.000000000000000)
Pixel Size = (60.000000000000000,-60.000000000000000)
Corner Coordinates:
Upper Left  (  499980.000, 5900040.000) (  3d 0' 1.08"W, 53d14'58.66"N)
Lower Left  (  499980.000, 5790240.000) (  3d 0' 1.05"W, 52d15'45.17"N)
Upper Right (  609780.000, 5900040.000) (  1d21'18.19"W, 53d14'17.80"N)
Lower Right (  609780.000, 5790240.000) (  1d23'30.49"W, 52d15' 5.73"N)
Center      (  554880.000, 5845140.000) (  2d11'12.70"W, 52d45'11.95"N)
Band 1 Block=192x192 Type=UInt16, ColorInterp=Gray
  Overviews: 915x915, 457x457, 228x228, 114x114
  Overviews: arbitrary
  Image Structure Metadata:
    COMPRESSION=JPEG2000
    NBITS=15

Here's Sentinel-1 (which doesn't work):

gdalinfo  s1a-iw-grd-vh-20170322t062239-20170322t062304-015801-01a061-002.tiff 
Driver: GTiff/GeoTIFF
Files: s1a-iw-grd-vh-20170322t062239-20170322t062304-015801-01a061-002.tiff
Size is 26307, 16699
Coordinate System is `'
GCP Projection = 
GEOGCS["WGS 84",
    DATUM["WGS_1984",
        SPHEROID["unnamed",6378137,298.2572235604902,
            AUTHORITY["EPSG","4326"]],
        AUTHORITY["EPSG","6326"]],
    PRIMEM["Greenwich",0],
    UNIT["degree",0.0174532925199433],
    AUTHORITY["EPSG","4326"]]
GCP[  0]: Id=1, Info=
          (0,0) -> (-0.0586869021480695,52.8786492861072,82.5438837502152)
GCP[  1]: Id=2, Info=
          (1316,0) -> (-0.2502702620235,52.9022595687367,82.5437502386048)
GCP[  2]: Id=3, Info=
          (2632,0) -> (-0.442060477599235,52.9255608888741,82.5436199875548)
GCP[  3]: Id=4, Info=
          (3948,0) -> (-0.634055217277722,52.9485526590759,82.5434928266332)
GCP[  4]: Id=5, Info=
          (5264,0) -> (-0.826252128231016,52.9712342980856,82.5433686049655)
GCP[  5]: Id=6, Info=
          (6580,0) -> (-1.01864883751855,52.993605231024,82.5432471828535)
GCP[  6]: Id=7, Info=
          (7896,0) -> (-1.21124295254712,53.0156648894928,82.5431284420192)
GCP[  7]: Id=8, Info=
          (9212,0) -> (-1.4040320612446,53.0374127116436,82.543012291193)
GCP[  8]: Id=9, Info=
          (10528,0) -> (-1.59701373215793,53.0588481422363,82.5428986269981)
GCP[  9]: Id=10, Info=
          (11844,0) -> (-1.79018551457585,53.079970632701,82.542787370272)
GCP[ 10]: Id=11, Info=
          (13160,0) -> (-1.98354493870863,53.1007796412048,82.5426784493029)
GCP[ 11]: Id=12, Info=
          (14476,0) -> (-2.17708951591652,53.1212746327237,82.5425718007609)
GCP[ 12]: Id=13, Info=
          (15792,0) -> (-2.37081673896027,53.1414550791147,82.5424673622474)
GCP[ 13]: Id=14, Info=
          (17108,0) -> (-2.56472408224355,53.1613204591856,82.542365077883)
GCP[ 14]: Id=15, Info=
          (18424,0) -> (-2.75880900202351,53.1808702587605,82.5422649076208)
GCP[ 15]: Id=16, Info=
          (19740,0) -> (-2.95306893658214,53.2001039707397,82.5421668021008)
GCP[ 16]: Id=17, Info=
          (21056,0) -> (-3.1475013063723,53.2190210951573,82.542070726864)
GCP[ 17]: Id=18, Info=
          (22372,0) -> (-3.34210351417623,53.2376211392384,82.5419766427949)
GCP[ 18]: Id=19, Info=
          (23688,0) -> (-3.5368729453424,53.2559036174645,82.5418845163658)
GCP[ 19]: Id=20, Info=
          (25004,0) -> (-3.7318069681956,53.2738680516526,82.5417943224311)
GCP[ 20]: Id=21, Info=
          (26306,0) -> (-3.9248266027804,53.2913279263375,82.541706956923)
GCP[ 21]: Id=22, Info=
          (0,2004) -> (-0.120395141673231,52.6996611510942,89.1849377583712)
GCP[ 22]: Id=23, Info=
          (1316,2004) -> (-0.311207028346612,52.7232347178294,89.1847954448313)
GCP[ 23]: Id=24, Info=
          (2632,2004) -> (-0.502223205157143,52.7465012583834,89.1846565008163)
GCP[ 24]: Id=25, Info=
          (3948,2004) -> (-0.693441387042101,52.7694601938617,89.1845207447186)
GCP[ 25]: Id=26, Info=
          (5264,2004) -> (-0.884859267130061,52.7921109512745,89.1843880303204)
GCP[ 26]: Id=27, Info=
          (6580,2004) -> (-1.07647451802253,52.814452963754,89.1842582253739)
GCP[ 27]: Id=28, Info=
          (7896,2004) -> (-1.26828479238668,52.8364856706804,89.1841312116012)
GCP[ 28]: Id=29, Info=
          (9212,2004) -> (-1.46028772323727,52.8582085177675,89.1840068846941)
GCP[ 29]: Id=30, Info=
          (10528,2004) -> (-1.65248092412088,52.8796209571356,89.183885156177)
GCP[ 30]: Id=31, Info=
          (11844,2004) -> (-1.84486198930761,52.9007224473837,89.1837659422308)
GCP[ 31]: Id=32, Info=
          (13160,2004) -> (-2.03742849402543,52.921512453666,89.1836491702124)
GCP[ 32]: Id=33, Info=
          (14476,2004) -> (-2.23017799473204,52.94199044777,89.1835347777233)
GCP[ 33]: Id=34, Info=
          (15792,2004) -> (-2.42310802940049,52.9621559081943,89.1834227051586)
GCP[ 34]: Id=35, Info=
          (17108,2004) -> (-2.61621611778935,52.9820083202237,89.1833128966391)
GCP[ 35]: Id=36, Info=
          (18424,2004) -> (-2.8094997616773,53.0015471759974,89.183205309324)
GCP[ 36]: Id=37, Info=
          (19740,2004) -> (-3.00295644505575,53.0207719745729,89.1830999003723)
GCP[ 37]: Id=38, Info=
          (21056,2004) -> (-3.19658363429398,53.0396822219861,89.1829966278747)
GCP[ 38]: Id=39, Info=
          (22372,2004) -> (-3.3903787783176,53.0582774313113,89.1828954545781)
GCP[ 39]: Id=40, Info=
          (23688,2004) -> (-3.58433930886567,53.0765571227289,89.1827963571995)
GCP[ 40]: Id=41, Info=
          (25004,2004) -> (-3.77846264092258,53.0945208236064,89.1826992956921)
GCP[ 41]: Id=42, Info=
          (26306,2004) -> (-3.97067849341095,53.111981998929,89.1826052479446)
GCP[ 42]: Id=43, Info=
          (0,4008) -> (-0.181738424203892,52.5206481495242,95.0912933750078)
GCP[ 43]: Id=44, Info=
          (1316,4008) -> (-0.371783797647196,52.5441853595747,95.0911432458088)
GCP[ 44]: Id=45, Info=
          (2632,4008) -> (-0.562031130845226,52.5674174982919,95.0909965699539)
GCP[ 45]: Id=46, Info=
          (3948,4008) -> (-0.752478165551145,52.5903439919164,95.090853177011)
GCP[ 46]: Id=47, Info=
          (5264,4008) -> (-0.943122623640613,52.6129642727443,95.090712913312)
GCP[ 47]: Id=48, Info=
          (6580,4008) -> (-1.13396220812136,52.6352777792988,95.0905756475404)
GCP[ 48]: Id=49, Info=
          (7896,4008) -> (-1.32499460351525,52.65728395642,95.0904412651435)
GCP[ 49]: Id=50, Info=
          (9212,4008) -> (-1.51621747597522,52.6789822553225,95.0903096599504)
GCP[ 50]: Id=51, Info=
          (10528,4008) -> (-1.70762847333898,52.7003721336444,95.090180747211)
GCP[ 51]: Id=52, Info=
          (11844,4008) -> (-1.89922522521499,52.7214530555015,95.0900544421747)
GCP[ 52]: Id=53, Info=
          (13160,4008) -> (-2.09100534312975,52.742224491547,95.0899306721985)
GCP[ 53]: Id=54, Info=
          (14476,4008) -> (-2.28296642072681,52.7626859190367,95.0898093739524)
GCP[ 54]: Id=55, Info=
          (15792,4008) -> (-2.47510603398918,52.7828368218949,95.0896904924884)
GCP[ 55]: Id=56, Info=
          (17108,4008) -> (-2.66742174145449,52.8026766907788,95.0895739691332)
GCP[ 56]: Id=57, Info=
          (18424,4008) -> (-2.85991108440097,52.8222050231387,95.0894597610459)
GCP[ 57]: Id=58, Info=
          (19740,4008) -> (-3.05257158699568,52.8414213232729,95.0893478253856)
GCP[ 58]: Id=59, Info=
          (21056,4008) -> (-3.24540075642016,52.8603251023804,95.0892381230369)
GCP[ 59]: Id=60, Info=
          (22372,4008) -> (-3.43839608301244,52.8789158786151,95.0891306186095)
GCP[ 60]: Id=61, Info=
          (23688,4008) -> (-3.63155504049178,52.8971931771471,95.0890252785757)
GCP[ 61]: Id=62, Info=
          (25004,4008) -> (-3.82487508636179,52.9151565302389,95.0889220740646)
GCP[ 62]: Id=63, Info=
          (26306,4008) -> (-4.01629455458005,52.9326193787593,95.0888220490888)
GCP[ 63]: Id=64, Info=
          (0,6012) -> (-0.242759733378642,52.3416158043164,101.789330489933)
GCP[ 64]: Id=65, Info=
          (1316,6012) -> (-0.432048903967433,52.3651176332146,101.78917149175)
GCP[ 65]: Id=66, Info=
          (2632,6012) -> (-0.621537571455049,52.3883163010772,101.789016040973)
GCP[ 66]: Id=67, Info=
          (3948,6012) -> (-0.811223520829204,52.4112112421219,101.788863972761)
GCP[ 67]: Id=68, Info=
          (5264,6012) -> (-1.00110451686545,52.4338018963879,101.788715143688)
GCP[ 68]: Id=69, Info=
          (6580,6012) -> (-1.19117830524793,52.4560877099266,101.788569410332)
GCP[ 69]: Id=70, Info=
          (7896,6012) -> (-1.38144261304679,52.4780681349072,101.788426667452)
GCP[ 70]: Id=71, Info=
          (9212,6012) -> (-1.57189514891245,52.499742629686,101.788286805153)
GCP[ 71]: Id=72, Info=
          (10528,6012) -> (-1.7625336031939,52.5211106588668,101.788149743341)
GCP[ 72]: Id=73, Info=
          (11844,6012) -> (-1.9533556480756,52.5421716933621,101.788015392609)
GCP[ 73]: Id=74, Info=
          (13160,6012) -> (-2.14435893776656,52.5629252104601,101.787883687764)
GCP[ 74]: Id=75, Info=
          (14476,6012) -> (-2.33554110873108,52.5833706938939,101.787754558027)
GCP[ 75]: Id=76, Info=
          (15792,6012) -> (-2.52689977993705,52.6035076339127,101.787627947517)
GCP[ 76]: Id=77, Info=
          (17108,6012) -> (-2.7184325530915,52.6233355273487,101.787503807805)
GCP[ 77]: Id=78, Info=
          (18424,6012) -> (-2.91013701284225,52.6428538776793,101.787382091396)
GCP[ 78]: Id=79, Info=
          (19740,6012) -> (-3.10201072694024,52.6620621950851,101.787262755446)
GCP[ 79]: Id=80, Info=
          (21056,6012) -> (-3.29405124637749,52.680959996504,101.787145757116)
GCP[ 80]: Id=81, Info=
          (22372,6012) -> (-3.48625610554135,52.6995468056865,101.787031071261)
GCP[ 81]: Id=82, Info=
          (23688,6012) -> (-3.67862282245196,52.7178221532589,101.786918658763)
GCP[ 82]: Id=83, Info=
          (25004,6012) -> (-3.8711488991802,52.7357855768013,101.786808491684)
GCP[ 83]: Id=84, Info=
          (26306,6012) -> (-4.06178118762942,52.7532504893714,101.78670167923)
GCP[ 84]: Id=85, Info=
          (0,8016) -> (-0.303035721111394,52.1625109545217,91.9479288989678)
GCP[ 85]: Id=86, Info=
          (1316,8016) -> (-0.491575755657553,52.1859787223204,91.9477830734104)
GCP[ 86]: Id=87, Info=
          (2632,8016) -> (-0.680312911620964,52.209145231797,91.9476406164467)
GCP[ 87]: Id=88, Info=
          (3948,8016) -> (-0.869245012567248,52.2320099243148,91.9475013539195)
GCP[ 88]: Id=89, Info=
          (5264,8016) -> (-1.05836986198128,52.2545722469109,91.9473651386797)
GCP[ 89]: Id=90, Info=
          (6580,8016) -> (-1.24768524446059,52.2768316524971,91.9472318403423)
GCP[ 90]: Id=91, Info=
          (7896,8016) -> (-1.43718892623272,52.2987875999713,91.9471013396978)
GCP[ 91]: Id=92, Info=
          (9212,8016) -> (-1.62687865537101,52.3204395542894,91.9469735417515)
GCP[ 92]: Id=93, Info=
          (10528,8016) -> (-1.81675216192162,52.341786986527,91.9468483505771)
GCP[ 93]: Id=94, Info=
          (11844,8016) -> (-2.00680715804551,52.3628293739411,91.9467256888747)
GCP[ 94]: Id=95, Info=
          (13160,8016) -> (-2.19704133821052,52.3835662000375,91.9466054840013)
GCP[ 95]: Id=96, Info=
          (14476,8016) -> (-2.38745237942775,52.403996954641,91.9464876782149)
GCP[ 96]: Id=97, Info=
          (15792,8016) -> (-2.57803794150717,52.4241211339669,91.9463722016662)
GCP[ 97]: Id=98, Info=
          (17108,8016) -> (-2.76879566730392,52.4439382406889,91.9462590115145)
GCP[ 98]: Id=99, Info=
          (18424,8016) -> (-2.95972318293089,52.4634477840026,91.9461480574682)
GCP[ 99]: Id=100, Info=
          (19740,8016) -> (-3.15081809793106,52.4826492796837,91.9460393013433)
GCP[100]: Id=101, Info=
          (21056,8016) -> (-3.34207800542034,52.5015422501419,91.9459326984361)
GCP[101]: Id=102, Info=
          (22372,8016) -> (-3.53350048223771,52.5201262244761,91.945828220807)
GCP[102]: Id=103, Info=
          (23688,8016) -> (-3.72508308916353,52.5384007385344,91.9457258312032)
GCP[103]: Id=104, Info=
          (25004,8016) -> (-3.91682337129756,52.5563653349883,91.9456255072728)
GCP[104]: Id=105, Info=
          (26306,8016) -> (-4.10667660923773,52.5738333873732,91.9455282473937)
GCP[105]: Id=106, Info=
          (0,10020) -> (-0.363576973458847,51.9834584547741,106.234993175603)
GCP[106]: Id=107, Info=
          (1316,10020) -> (-0.55137637689065,52.0068919012432,106.23482836131)
GCP[107]: Id=108, Info=
          (2632,10020) -> (-0.739370486002916,52.0300259660548,106.234667144716)
GCP[108]: Id=109, Info=
          (3948,10020) -> (-0.92755716922007,52.0528600988421,106.234509353526)
GCP[109]: Id=110, Info=
          (5264,10020) -> (-1.11593427416305,52.0753937546173,106.234354846179)
GCP[110]: Id=111, Info=
          (6580,10020) -> (-1.30449962899666,52.0976263939996,106.234203485772)
GCP[111]: Id=112, Info=
          (7896,10020) -> (-1.49325104308268,52.1195574833496,106.23405516427)
GCP[112]: Id=113, Info=
          (9212,10020) -> (-1.68218630731405,52.1411864948615,106.233909775503)
GCP[113]: Id=114, Info=
          (10528,10020) -> (-1.87130319434239,52.1625129066407,106.233767233789)
GCP[114]: Id=115, Info=
          (11844,10020) -> (-2.06059945880399,52.1835362027793,106.233627459034)
GCP[115]: Id=116, Info=
          (13160,10020) -> (-2.25007283758055,52.2042558734346,106.233490376733)
GCP[116]: Id=117, Info=
          (14476,10020) -> (-2.43972105009077,52.2246714149079,106.233355927281)
GCP[117]: Id=118, Info=
          (15792,10020) -> (-2.62954179858945,52.2447823297233,106.233224053867)
GCP[118]: Id=119, Info=
          (17108,10020) -> (-2.81953276844726,52.2645881267009,106.233094705269)
GCP[119]: Id=120, Info=
          (18424,10020) -> (-3.00969162839016,52.2840883210251,106.232967833057)
GCP[120]: Id=121, Info=
          (19740,10020) -> (-3.20001603069298,52.303282434306,106.232843395323)
GCP[121]: Id=122, Info=
          (21056,10020) -> (-3.3905036113414,52.3221699946369,106.232721359469)
GCP[122]: Id=123, Info=
          (22372,10020) -> (-3.58115199020032,52.3407505366516,106.232601684518)
GCP[123]: Id=124, Info=
          (23688,10020) -> (-3.77195877125383,52.3590236015883,106.232484339736)
GCP[124]: Id=125, Info=
          (25004,10020) -> (-3.96292154300962,52.3769887373662,106.232369298115)
GCP[125]: Id=126, Info=
          (26306,10020) -> (-4.15200392703701,52.394459285176,106.232257722877)
GCP[126]: Id=127, Info=
          (0,12024) -> (-0.424029206913522,51.8044143888276,130.302068443038)
GCP[127]: Id=128, Info=
          (1316,12024) -> (-0.611092211058332,51.8278133628791,130.301871600561)
GCP[128]: Id=129, Info=
          (2632,12024) -> (-0.798347751947292,51.850914854854,130.301678750664)
GCP[129]: Id=130, Info=
          (3948,12024) -> (-0.98579372152971,51.873718318951,130.30148972664)
GCP[130]: Id=131, Info=
          (5264,12024) -> (-1.1734279928158,51.8962232149086,130.301304382272)
GCP[131]: Id=132, Info=
          (6580,12024) -> (-1.36124842100596,51.9184290081934,130.301122590899)
GCP[132]: Id=133, Info=
          (7896,12024) -> (-1.54925284396075,51.9403351701014,130.300944231451)
GCP[133]: Id=134, Info=
          (9212,12024) -> (-1.73743908237954,51.9619411778226,130.300769211724)
GCP[134]: Id=135, Info=
          (10528,12024) -> (-1.92580493989497,51.983246514494,130.300597441383)
GCP[135]: Id=136, Info=
          (11844,12024) -> (-2.11434820318494,52.0042506692556,130.300428840332)
GCP[136]: Id=137, Info=
          (13160,12024) -> (-2.30306664213557,52.0249531373105,130.300263339654)
GCP[137]: Id=138, Info=
          (14476,12024) -> (-2.49195801004832,52.0453534199894,130.300100879744)
GCP[138]: Id=139, Info=
          (15792,12024) -> (-2.68102004386725,52.0654510248158,130.299941399135)
GCP[139]: Id=140, Info=
          (17108,12024) -> (-2.8702504643976,52.0852454655691,130.299784850329)
GCP[140]: Id=141, Info=
          (18424,12024) -> (-3.0596469764929,52.1047362623425,130.299631184898)
GCP[141]: Id=142, Info=
          (19740,12024) -> (-3.24920726920479,52.1239229415966,130.299480367452)
GCP[142]: Id=143, Info=
          (21056,12024) -> (-3.43892901590734,52.1428050362101,130.29933235608)
GCP[143]: Id=144, Info=
          (22372,12024) -> (-3.62880987443374,52.1613820855305,130.29918712005)
GCP[144]: Id=145, Info=
          (23688,12024) -> (-3.81884748728788,52.1796536354326,130.299044625834)
GCP[145]: Id=146, Info=
          (25004,12024) -> (-4.00903948202264,52.1976192383903,130.298904845491)
GCP[146]: Id=147, Info=
          (26306,12024) -> (-4.19735774432129,52.2150922034868,130.298769197427)
GCP[147]: Id=148, Info=
          (0,14028) -> (-0.483346775621728,51.6252469899592,121.20086953789)
GCP[148]: Id=149, Info=
          (1316,14028) -> (-0.669682644300111,51.6486137588689,121.200684892945)
GCP[149]: Id=150, Info=
          (2632,14028) -> (-0.856208809082472,51.6716849098461,121.200504073873)
GCP[150]: Id=151, Info=
          (3948,14028) -> (-1.04292319658077,51.6944599035567,121.200326898135)
GCP[151]: Id=152, Info=
          (5264,14028) -> (-1.22982371488984,51.7169382061161,121.200153230689)
GCP[152]: Id=153, Info=
          (6580,14028) -> (-1.41690825468467,51.7391192892727,121.199982941151)
GCP[153]: Id=154, Info=
          (7896,14028) -> (-1.60417468967288,51.7610026305062,121.199815913104)
GCP[154]: Id=155, Info=
          (9212,14028) -> (-1.7916208767648,51.7825877130906,121.199652050622)
GCP[155]: Id=156, Info=
          (10528,14028) -> (-1.9792446561641,51.8038740261459,121.199491262436)
GCP[156]: Id=157, Info=
          (11844,14028) -> (-2.16704385147808,51.8248610646925,121.199333476834)
GCP[157]: Id=158, Info=
          (13160,14028) -> (-2.35501626987929,51.8455483297111,121.199178613722)
GCP[158]: Id=159, Info=
          (14476,14028) -> (-2.54315970231109,51.8659353282057,121.199026620947)
GCP[159]: Id=160, Info=
          (15792,14028) -> (-2.73147192371177,51.886021573268,121.198877435178)
GCP[160]: Id=161, Info=
          (17108,14028) -> (-2.91995069322888,51.905806584139,121.19873101078)
GCP[161]: Id=162, Info=
          (18424,14028) -> (-3.10859375440085,51.9252898862656,121.198587297462)
GCP[162]: Id=163, Info=
          (19740,14028) -> (-3.29739883530032,51.944471011353,121.198446258903)
GCP[163]: Id=164, Info=
          (21056,14028) -> (-3.48636364865112,51.9633494974135,121.198307853192)
GCP[164]: Id=165, Info=
          (22372,14028) -> (-3.67548589195744,51.9819248888161,121.198172047734)
GCP[165]: Id=166, Info=
          (23688,14028) -> (-3.8647632477086,52.0001967363436,121.198038817383)
GCP[166]: Id=167, Info=
          (25004,14028) -> (-4.05419338375041,52.0181645972631,121.19790812768)
GCP[167]: Id=168, Info=
          (26306,14028) -> (-4.24175635592064,52.0356417300532,121.19778130576)
GCP[168]: Id=169, Info=
          (0,16032) -> (-0.542079859033336,51.4460249913458,100.986913993023)
GCP[169]: Id=170, Info=
          (1316,16032) -> (-0.727696988581507,51.4693607980349,100.986756379716)
GCP[170]: Id=171, Info=
          (2632,16032) -> (-0.913502139696876,51.4924028241229,100.986602218822)
GCP[171]: Id=172, Info=
          (3948,16032) -> (-1.09949328040946,51.5151505379048,100.986451346427)
GCP[172]: Id=173, Info=
          (5264,16032) -> (-1.28566835963381,51.5376034128641,100.986303620972)
GCP[173]: Id=174, Info=
          (6580,16032) -> (-1.47202530843783,51.5597609278849,100.986158909276)
GCP[174]: Id=175, Info=
          (7896,16032) -> (-1.65856204062493,51.5816225673713,100.986017099582)
GCP[175]: Id=176, Info=
          (9212,16032) -> (-1.84527645300139,51.6031878213257,100.985878090374)
GCP[176]: Id=177, Info=
          (10528,16032) -> (-2.03216642554201,51.624456185414,100.985741798766)
GCP[177]: Id=178, Info=
          (11844,16032) -> (-2.21922982155856,51.645427161029,100.985608137213)
GCP[178]: Id=179, Info=
          (13160,16032) -> (-2.40646448790888,51.6661002553585,100.985477050766)
GCP[179]: Id=180, Info=
          (14476,16032) -> (-2.59386825524102,51.686474981455,100.985348461196)
GCP[180]: Id=181, Info=
          (15792,16032) -> (-2.78143893825257,51.7065508583058,100.985222324729)
GCP[181]: Id=182, Info=
          (17108,16032) -> (-2.96917433593486,51.7263274108989,100.985098578967)
GCP[182]: Id=183, Info=
          (18424,16032) -> (-3.15707223178298,51.7458041702852,100.984977185726)
GCP[183]: Id=184, Info=
          (19740,16032) -> (-3.34513039396437,51.7649806736333,100.98485810589)
GCP[184]: Id=185, Info=
          (21056,16032) -> (-3.53334657545772,51.7838564642821,100.98474129755)
GCP[185]: Id=186, Info=
          (22372,16032) -> (-3.72171851419996,51.8024310917926,100.984626723453)
GCP[186]: Id=187, Info=
          (23688,16032) -> (-3.9102439333015,51.8207041120063,100.984514360316)
GCP[187]: Id=188, Info=
          (25004,16032) -> (-4.0989205414203,51.8386750871173,100.984404178336)
GCP[188]: Id=189, Info=
          (26306,16032) -> (-4.28573647614875,51.8561572163041,100.984297284856)
GCP[189]: Id=190, Info=
          (0,16698) -> (-0.561935418722545,51.3865096027108,110.955579586327)
GCP[190]: Id=191, Info=
          (1316,16698) -> (-0.747314779864231,51.4098345022696,110.955408698879)
GCP[191]: Id=192, Info=
          (2632,16698) -> (-0.932881437484905,51.432866234127,110.955241433345)
GCP[192]: Id=193, Info=
          (3948,16698) -> (-1.11863337038245,51.4556042686147,110.955077618361)
GCP[193]: Id=194, Info=
          (5264,16698) -> (-1.30456853849148,51.4780480812404,110.954917112365)
GCP[194]: Id=195, Info=
          (6580,16698) -> (-1.49068488407302,51.5001971528894,110.954759783112)
GCP[195]: Id=196, Info=
          (7896,16698) -> (-1.67698033225826,51.5220509699388,110.954605522566)
GCP[196]: Id=197, Info=
          (9212,16698) -> (-1.86345279130386,51.5436090243344,110.954454231076)
GCP[197]: Id=198, Info=
          (10528,16698) -> (-2.05010015275927,51.5648708136548,110.954305824824)
GCP[198]: Id=199, Info=
          (11844,16698) -> (-2.23692029164091,51.5858358411763,110.954160217196)
GCP[199]: Id=200, Info=
          (13160,16698) -> (-2.42391106664807,51.6065036159404,110.954017340206)
GCP[200]: Id=201, Info=
          (14476,16698) -> (-2.6110703204095,51.6268736528237,110.95387713518)
GCP[201]: Id=202, Info=
          (15792,16698) -> (-2.7983958797401,51.6469454726073,110.953739549965)
GCP[202]: Id=203, Info=
          (17108,16698) -> (-2.98588555587816,51.6667186020416,110.953604525886)
GCP[203]: Id=204, Info=
          (18424,16698) -> (-3.17353714468488,51.6861925739063,110.953472020105)
GCP[204]: Id=205, Info=
          (19740,16698) -> (-3.36134842680075,51.7053669270646,110.953341994435)
GCP[205]: Id=206, Info=
          (21056,16698) -> (-3.54931716777572,51.724241206514,110.95321440883)
GCP[206]: Id=207, Info=
          (22372,16698) -> (-3.73744111821344,51.7428149634381,110.953089234419)
GCP[207]: Id=208, Info=
          (23688,16698) -> (-3.92571801399647,51.7610877552657,110.952966433018)
GCP[208]: Id=209, Info=
          (25004,16698) -> (-4.11414557668833,51.7790591457448,110.952845979482)
GCP[209]: Id=210, Info=
          (26306,16698) -> (-4.30071461444045,51.7965423208952,110.952729095705)
Metadata:
  AREA_OR_POINT=Area
  TIFFTAG_DATETIME=2017:03:22 08:52:58
  TIFFTAG_IMAGEDESCRIPTION=Sentinel-1A IW GRD HR L1
  TIFFTAG_SOFTWARE=Sentinel-1 IPF 002.72
Image Structure Metadata:
  INTERLEAVE=BAND
Corner Coordinates:
Upper Left  (    0.0,    0.0)
Lower Left  (    0.0,16699.0)
Upper Right (26307.0,    0.0)
Lower Right (26307.0,16699.0)
Center      (13153.5, 8349.5)
Band 1 Block=26307x1 Type=UInt16, ColorInterp=Gray

I can see that the root elements in this metadata describing the projections are different, namely "GEOGCS" and "PROJCS" and also that there are two different raster formats here, jp2 and GeoTIFF.

When I open either file with QGIS the data is correctly projected.

How do I process the Sentinel-1 data such that it can be opened correctly with rasterio (or raster2pgsql)?

4

Rasterio can read and write GCPs and warp with them since version 1.0a3. src.crs returns nothing to make it clear that there is no coordinate reference system associated with the file's affine transformation matrix. If you want to see the file's ground control points and their CRS, do this (one of the project's test files shown for example).

>>> import rasterio
>>> dst = rasterio.open('tests/data/white-gemini-iv.vrt')
>>> dst.crs
CRS({})
>>> gcps, gcp_crs = dst.gcps
>>> gcp_crs
CRS({'init': 'epsg:32618'})
2

The problem was that the tiff had a "GCP Projection" (Ground Control Point). The points shown in the projection when I called gdalinfo match points in the raster to points in the specified coordinate system.

For example:

GCP[  0]: Id=1, Info=
          (0,0) -> (-0.0586869021480695,52.8786492861072,82.5438837502152)

Indicates that the top left pixel has lng/lat coordinates -0.0586869021480695,52.8786492861072 and an altitude of 82.5438837502152.

In order for rasterio to interpret the projection it needed to be converted using gdalwarp. I warped the image to ESPG:4326 with the command:

gdalwarp -r bilinear -t_srs EPSG:4326 s1a-iw-grd-vv-20160313t174940-20160313t175005-010354-00f569-001.tif crs.tif

Where crs.tif is the output image.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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