Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VRT created with just one band #2

Open
caprieldeluca opened this issue Nov 21, 2024 · 2 comments
Open

VRT created with just one band #2

caprieldeluca opened this issue Nov 21, 2024 · 2 comments

Comments

@caprieldeluca
Copy link

caprieldeluca commented Nov 21, 2024

Thank you for this work!

In my opinion, always use the QGIS' pyproj. I was not able to activate the plugin until I edited the QGIS3.ini by hand, because when run the plugin for the first time the configuration is not loaded and the activation fails because pyproj name was not defined, so the configuration is not written either.

But the issue is about something else: The virtual raster has only one band.

Below is the About QGIS table, and the full processing log.

QGIS version 3.34.12-Prizren QGIS code revision eeb6af36386
Qt version 5.15.8
Python version 3.11.2
GDAL/OGR version 3.6.2
PROJ version 9.1.1
EPSG Registry database version v10.076 (2022-08-31)
GEOS version 3.11.1-CAPI-1.17.1
SQLite version 3.40.1
PostgreSQL client version 15.8 (Debian 15.8-0+deb12u1)
SpatiaLite version 5.0.1
QWT version 6.1.4
QScintilla2 version 2.13.3
OS version Debian GNU/Linux 12 (bookworm)
       
Active Python plugins
tactilemaps 0.3.0
profile-manager 0.31
QuickOSM 2.2.3
mmqgis 2024.11.8
processing_saga_nextgen 1.0.0
clusterpoints 6.1
plugin_reloader 0.11
proj_factors_redux 0.9
firstaid 3.2.0
db_manager 0.1.20
grassprovider 2.12.99
processing 2.12.99
MetaSearch 0.3.6
gabriel@debian:~$ qgis
...
20.11.2024 22:48:15 - INFO - extent=|QgsRectangle: 1487338.2500360906124115 2709967.14558297162875533, 7445514.55839920416474342 8233760.63277053646743298>, crs=|QgsCoordinateReferenceSystem: EPSG:5347>, pixel_size=6483.325689187283
20.11.2024 22:48:16 - INFO - Transforming 782988 points to EPSG:4326...
20.11.2024 22:48:17 - INFO - Transforming 782988 points to EPSG:4326... Done!
20.11.2024 22:48:17 - INFO - Calculating projection factors pyproj edition...
20.11.2024 22:48:23 - INFO - Calculating projection factors... Done!
20.11.2024 22:48:23 - INFO - Writing data to raster '/tmp/processing_TUfxPi/9139f5d68bbe4136be3f331911a81418/Projection Factors EPSG_5347.tif'...
20.11.2024 22:48:23 - INFO - Collecting data for 1: Angular Distortion...
20.11.2024 22:48:23 - INFO - Extracting factor 'angular_distortion' from calculated factors...
20.11.2024 22:48:23 - INFO - Extracting factor 'angular_distortion' from calculated factors... Done!
20.11.2024 22:48:23 - INFO - Packing 782988 values...
20.11.2024 22:48:23 - INFO - Packing 782988 values... Done!
20.11.2024 22:48:23 - INFO - Collecting data for 1: Angular Distortion... Done!
20.11.2024 22:48:23 - INFO - Writing data to raster band 1...
20.11.2024 22:48:23 - INFO - Writing data to raster band 1... Done!
20.11.2024 22:48:23 - INFO - Collecting data for 2: Areal Scale...
20.11.2024 22:48:23 - INFO - Extracting factor 'areal_scale' from calculated factors...
20.11.2024 22:48:23 - INFO - Extracting factor 'areal_scale' from calculated factors... Done!
20.11.2024 22:48:23 - INFO - Packing 782988 values...
20.11.2024 22:48:23 - INFO - Packing 782988 values... Done!
20.11.2024 22:48:23 - INFO - Collecting data for 2: Areal Scale... Done!
20.11.2024 22:48:23 - INFO - Writing data to raster band 2...
20.11.2024 22:48:23 - INFO - Writing data to raster band 2... Done!
20.11.2024 22:48:23 - INFO - Collecting data for 3: Partial derivative ∂x/∂λ...
20.11.2024 22:48:23 - INFO - Extracting factor 'dx_dlam' from calculated factors...
20.11.2024 22:48:23 - INFO - Extracting factor 'dx_dlam' from calculated factors... Done!
20.11.2024 22:48:23 - INFO - Packing 782988 values...
20.11.2024 22:48:23 - INFO - Packing 782988 values... Done!
20.11.2024 22:48:23 - INFO - Collecting data for 3: Partial derivative ∂x/∂λ... Done!
20.11.2024 22:48:23 - INFO - Writing data to raster band 3...
20.11.2024 22:48:23 - INFO - Writing data to raster band 3... Done!
20.11.2024 22:48:23 - INFO - Collecting data for 4: Partial derivative ∂x/∂ϕ...
20.11.2024 22:48:23 - INFO - Extracting factor 'dx_dphi' from calculated factors...
20.11.2024 22:48:23 - INFO - Extracting factor 'dx_dphi' from calculated factors... Done!
20.11.2024 22:48:23 - INFO - Packing 782988 values...
20.11.2024 22:48:23 - INFO - Packing 782988 values... Done!
20.11.2024 22:48:23 - INFO - Collecting data for 4: Partial derivative ∂x/∂ϕ... Done!
20.11.2024 22:48:23 - INFO - Writing data to raster band 4...
20.11.2024 22:48:23 - INFO - Writing data to raster band 4... Done!
20.11.2024 22:48:23 - INFO - Collecting data for 5: Partial derivative ∂y/∂λ...
20.11.2024 22:48:23 - INFO - Extracting factor 'dy_dlam' from calculated factors...
20.11.2024 22:48:23 - INFO - Extracting factor 'dy_dlam' from calculated factors... Done!
20.11.2024 22:48:23 - INFO - Packing 782988 values...
20.11.2024 22:48:23 - INFO - Packing 782988 values... Done!
20.11.2024 22:48:23 - INFO - Collecting data for 5: Partial derivative ∂y/∂λ... Done!
20.11.2024 22:48:23 - INFO - Writing data to raster band 5...
20.11.2024 22:48:23 - INFO - Writing data to raster band 5... Done!
20.11.2024 22:48:23 - INFO - Collecting data for 6: Partial derivative ∂y/∂ϕ...
20.11.2024 22:48:23 - INFO - Extracting factor 'dy_dphi' from calculated factors...
20.11.2024 22:48:23 - INFO - Extracting factor 'dy_dphi' from calculated factors... Done!
20.11.2024 22:48:23 - INFO - Packing 782988 values...
20.11.2024 22:48:23 - INFO - Packing 782988 values... Done!
20.11.2024 22:48:23 - INFO - Collecting data for 6: Partial derivative ∂y/∂ϕ... Done!
20.11.2024 22:48:23 - INFO - Writing data to raster band 6...
20.11.2024 22:48:23 - INFO - Writing data to raster band 6... Done!
20.11.2024 22:48:23 - INFO - Collecting data for 7: Meridian Convergence (aka Grid Declination) (in degrees)...
20.11.2024 22:48:23 - INFO - Extracting factor 'meridian_convergence' from calculated factors...
20.11.2024 22:48:23 - INFO - Extracting factor 'meridian_convergence' from calculated factors... Done!
20.11.2024 22:48:23 - INFO - Packing 782988 values...
20.11.2024 22:48:23 - INFO - Packing 782988 values... Done!
20.11.2024 22:48:23 - INFO - Collecting data for 7: Meridian Convergence (aka Grid Declination) (in degrees)... Done!
20.11.2024 22:48:23 - INFO - Writing data to raster band 7...
20.11.2024 22:48:23 - INFO - Writing data to raster band 7... Done!
20.11.2024 22:48:23 - INFO - Collecting data for 8: Meridian Parallel Angle (in degrees)...
20.11.2024 22:48:23 - INFO - Extracting factor 'meridian_parallel_angle' from calculated factors...
20.11.2024 22:48:23 - INFO - Extracting factor 'meridian_parallel_angle' from calculated factors... Done!
20.11.2024 22:48:23 - INFO - Packing 782988 values...
20.11.2024 22:48:23 - INFO - Packing 782988 values... Done!
20.11.2024 22:48:23 - INFO - Collecting data for 8: Meridian Parallel Angle (in degrees)... Done!
20.11.2024 22:48:23 - INFO - Writing data to raster band 8...
20.11.2024 22:48:23 - INFO - Writing data to raster band 8... Done!
20.11.2024 22:48:23 - INFO - Collecting data for 9: Meridional Scale...
20.11.2024 22:48:23 - INFO - Extracting factor 'meridional_scale' from calculated factors...
20.11.2024 22:48:23 - INFO - Extracting factor 'meridional_scale' from calculated factors... Done!
20.11.2024 22:48:23 - INFO - Packing 782988 values...
20.11.2024 22:48:23 - INFO - Packing 782988 values... Done!
20.11.2024 22:48:23 - INFO - Collecting data for 9: Meridional Scale... Done!
20.11.2024 22:48:23 - INFO - Writing data to raster band 9...
20.11.2024 22:48:23 - INFO - Writing data to raster band 9... Done!
20.11.2024 22:48:23 - INFO - Collecting data for 10: Parallel Scale...
20.11.2024 22:48:23 - INFO - Extracting factor 'parallel_scale' from calculated factors...
20.11.2024 22:48:23 - INFO - Extracting factor 'parallel_scale' from calculated factors... Done!
20.11.2024 22:48:23 - INFO - Packing 782988 values...
20.11.2024 22:48:23 - INFO - Packing 782988 values... Done!
20.11.2024 22:48:23 - INFO - Collecting data for 10: Parallel Scale... Done!
20.11.2024 22:48:23 - INFO - Writing data to raster band 10...
20.11.2024 22:48:23 - INFO - Writing data to raster band 10... Done!
20.11.2024 22:48:23 - INFO - Collecting data for 11: Maximum scale factor (Tissot Semimajor)...
20.11.2024 22:48:23 - INFO - Extracting factor 'tissot_semimajor' from calculated factors...
20.11.2024 22:48:24 - INFO - Extracting factor 'tissot_semimajor' from calculated factors... Done!
20.11.2024 22:48:24 - INFO - Packing 782988 values...
20.11.2024 22:48:24 - INFO - Packing 782988 values... Done!
20.11.2024 22:48:24 - INFO - Collecting data for 11: Maximum scale factor (Tissot Semimajor)... Done!
20.11.2024 22:48:24 - INFO - Writing data to raster band 11...
20.11.2024 22:48:24 - INFO - Writing data to raster band 11... Done!
20.11.2024 22:48:24 - INFO - Collecting data for 12: Minimum scale factor (Tissot Semiminor)...
20.11.2024 22:48:24 - INFO - Extracting factor 'tissot_semiminor' from calculated factors...
20.11.2024 22:48:24 - INFO - Extracting factor 'tissot_semiminor' from calculated factors... Done!
20.11.2024 22:48:24 - INFO - Packing 782988 values...
20.11.2024 22:48:24 - INFO - Packing 782988 values... Done!
20.11.2024 22:48:24 - INFO - Collecting data for 12: Minimum scale factor (Tissot Semiminor)... Done!
20.11.2024 22:48:24 - INFO - Writing data to raster band 12...
20.11.2024 22:48:24 - INFO - Writing data to raster band 12... Done!
20.11.2024 22:48:24 - INFO - Writing data to raster '/tmp/processing_TUfxPi/9139f5d68bbe4136be3f331911a81418/Projection Factors EPSG_5347.tif'... Done!
20.11.2024 22:48:25 - INFO - Creating VRT for '/tmp/processing_TUfxPi/9139f5d68bbe4136be3f331911a81418/Projection Factors EPSG_5347.tif' so that we can have band names...
20.11.2024 22:48:25 - INFO - Creating VRT for '/tmp/processing_TUfxPi/9139f5d68bbe4136be3f331911a81418/Projection Factors EPSG_5347.tif' so that we can have band names... Done!
gabriel@debian:~$ cd /tmp/processing_TUfxPi/9139f5d68bbe4136be3f331911a81418/
gabriel@debian:/tmp/processing_TUfxPi/9139f5d68bbe4136be3f331911a81418$ ls -la
total 45440
drwxr-xr-x 2 gabriel gabriel      100 Nov 20 22:48  .
drwx------ 4 gabriel gabriel       80 Nov 20 22:48  ..
-rw-r--r-- 1 gabriel gabriel 45017181 Nov 20 22:48 'Projection Factors EPSG_5347.tif'
-rw-r--r-- 1 gabriel gabriel  1503777 Nov 20 22:48 'Projection Factors EPSG_5347.tif.aux.xml'
-rw-r--r-- 1 gabriel gabriel     1514 Nov 20 22:48 'Projection Factors EPSG_5347.tif.vrt'
gabriel@debian:/tmp/processing_TUfxPi/9139f5d68bbe4136be3f331911a81418$ gdalinfo Projection\ Factors\ EPSG_5347.tif
Driver: GTiff/GeoTIFF
Files: Projection Factors EPSG_5347.tif
       Projection Factors EPSG_5347.tif.aux.xml
Size is 919, 852
Coordinate System is:
PROJCRS["POSGAR 2007 / Argentina 5",
    BASEGEOGCRS["POSGAR 2007",
        DATUM["Posiciones Geodesicas Argentinas 2007",
            ELLIPSOID["WGS 84",6378137,298.257223563,
                LENGTHUNIT["metre",1]]],
        PRIMEM["Greenwich",0,
            ANGLEUNIT["degree",0.0174532925199433]],
        ID["EPSG",5340]],
    CONVERSION["Argentina zone 5",
        METHOD["Transverse Mercator",
            ID["EPSG",9807]],
        PARAMETER["Latitude of natural origin",-90,
            ANGLEUNIT["degree",0.0174532925199433],
            ID["EPSG",8801]],
        PARAMETER["Longitude of natural origin",-60,
            ANGLEUNIT["degree",0.0174532925199433],
            ID["EPSG",8802]],
        PARAMETER["Scale factor at natural origin",1,
            SCALEUNIT["unity",1],
            ID["EPSG",8805]],
        PARAMETER["False easting",5500000,
            LENGTHUNIT["metre",1],
            ID["EPSG",8806]],
        PARAMETER["False northing",0,
            LENGTHUNIT["metre",1],
            ID["EPSG",8807]]],
    CS[Cartesian,2],
        AXIS["northing (X)",north,
            ORDER[1],
            LENGTHUNIT["metre",1]],
        AXIS["easting (Y)",east,
            ORDER[2],
            LENGTHUNIT["metre",1]],
    USAGE[
        SCOPE["Engineering survey, topographic mapping."],
        AREA["Argentina - between 61°30'W and 58°30'W onshore."],
        BBOX[-39.06,-61.51,-23.37,-58.5]],
    ID["EPSG",5347]]
Data axis to CRS axis mapping: 2,1
Origin = (1487338.250036090612411,8233760.632770536467433)
Pixel Size = (6483.325689187283388,-6483.325689187282478)
Metadata:
  AREA_OR_POINT=Area
Image Structure Metadata:
  COMPRESSION=ZSTD
  INTERLEAVE=PIXEL
  PREDICTOR=3
Corner Coordinates:
Upper Left  ( 1487338.250, 8233760.633) ( 94d54'42.50"W, 13d12' 6.81"S)
Lower Left  ( 1487338.250, 2709967.146) (118d26' 7.41"W, 49d12'29.52"S)
Upper Right ( 7445514.558, 8233760.633) ( 42d 8'41.51"W, 15d14'56.38"S)
Lower Right ( 7445514.558, 2709967.146) ( 23d 4'58.96"W, 60d33'48.56"S)
Center      ( 4466426.404, 5471863.889) ( 72d 8' 8.89"W, 40d15'48.22"S)
Band 1 Block=256x256 Type=Float64, ColorInterp=Gray
  Min=0.000 Max=0.000 
  Minimum=0.000, Maximum=0.000, Mean=0.000, StdDev=0.000
  NoData Value=nan
  Metadata:
    STATISTICS_APPROXIMATE=YES
    STATISTICS_MAXIMUM=2.4625943167908e-06
    STATISTICS_MEAN=4.0311898997676e-07
    STATISTICS_MINIMUM=0
    STATISTICS_STDDEV=6.0597063522829e-07
    STATISTICS_VALID_PERCENT=100
Band 2 Block=256x256 Type=Float64, ColorInterp=Undefined
  Min=1.000 Max=1.453 
  Minimum=1.000, Maximum=1.453, Mean=1.113, StdDev=0.128
  NoData Value=nan
  Metadata:
    STATISTICS_APPROXIMATE=YES
    STATISTICS_MAXIMUM=1.4533864143041
    STATISTICS_MEAN=1.1133410831186
    STATISTICS_MINIMUM=1.0000001817961
    STATISTICS_STDDEV=0.12775369043998
    STATISTICS_VALID_PERCENT=100
Band 3 Block=256x256 Type=Float64, ColorInterp=Undefined
  Min=0.418 Max=1.159 
  Minimum=0.418, Maximum=1.159, Mean=0.792, StdDev=0.199
  NoData Value=nan
  Metadata:
    STATISTICS_APPROXIMATE=YES
    STATISTICS_MAXIMUM=1.1590221075969
    STATISTICS_MEAN=0.79189377041665
    STATISTICS_MINIMUM=0.41751181130423
    STATISTICS_STDDEV=0.19910791136148
    STATISTICS_VALID_PERCENT=100
Band 4 Block=256x256 Type=Float64, ColorInterp=Undefined
  NoData Value=nan
Band 5 Block=256x256 Type=Float64, ColorInterp=Undefined
  NoData Value=nan
Band 6 Block=256x256 Type=Float64, ColorInterp=Undefined
  NoData Value=nan
Band 7 Block=256x256 Type=Float64, ColorInterp=Undefined
  NoData Value=nan
Band 8 Block=256x256 Type=Float64, ColorInterp=Undefined
  NoData Value=nan
Band 9 Block=256x256 Type=Float64, ColorInterp=Undefined
  NoData Value=nan
Band 10 Block=256x256 Type=Float64, ColorInterp=Undefined
  NoData Value=nan
Band 11 Block=256x256 Type=Float64, ColorInterp=Undefined
  NoData Value=nan
Band 12 Block=256x256 Type=Float64, ColorInterp=Undefined
  NoData Value=nan
gabriel@debian:/tmp/processing_TUfxPi/9139f5d68bbe4136be3f331911a81418$ cat Projection\ Factors\ EPSG_5347.tif.vrt
<VRTDataset rasterXSize="919" rasterYSize="852">
  <SRS dataAxisToSRSAxisMapping="2,1">PROJCS["POSGAR 2007 / Argentina 5",GEOGCS["POSGAR 2007",DATUM["Posiciones_Geodesicas_Argentinas_2007",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","1062"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","5340"]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",-90],PARAMETER["central_meridian",-60],PARAMETER["scale_factor",1],PARAMETER["false_easting",5500000],PARAMETER["false_northing",0],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["Northing",NORTH],AXIS["Easting",EAST],AUTHORITY["EPSG","5347"]]</SRS>
  <GeoTransform>  1.4873382500360906e+06,  6.4833256891872834e+03,  0.0000000000000000e+00,  8.2337606327705365e+06,  0.0000000000000000e+00, -6.4833256891872825e+03</GeoTransform>
  <VRTRasterBand dataType="Float64" band="1">
    <NoDataValue>nan</NoDataValue>
    <ComplexSource resampling="nearest">
      <SourceFilename relativeToVRT="1">Projection Factors EPSG_5347.tif</SourceFilename>
      <SourceBand>1</SourceBand>
      <SourceProperties RasterXSize="919" RasterYSize="852" DataType="Float64" BlockXSize="256" BlockYSize="256" />
      <SrcRect xOff="0" yOff="0" xSize="919" ySize="852" />
      <DstRect xOff="0" yOff="0" xSize="919" ySize="852" />
      <NODATA>nan</NODATA>
    </ComplexSource>
  <Description>Angular Distortion</Description></VRTRasterBand>
</VRTDataset>
@kannes
Copy link
Owner

kannes commented Nov 21, 2024

In my opinion, always use the QGIS' pyproj. I was not able to activate the plugin until I edited the QGIS3.ini by hand, because when run the plugin for the first time the configuration is not loaded and the activation fails because pyproj name was not defined, so the configuration is not written either.

Oops, that was a stupid oversight on my end. Thanks for reporting, I fixed it in https://github.com/kannes/proj_factors_redux/releases/tag/v0.9.1


That single band VRT is weird... Do you get a multi-band one if you run gdalbuildvrt test.vrt Projection\ Factors\ EPSG_5347.tif.tif manually?

@caprieldeluca
Copy link
Author

That single band VRT is weird... Do you get a multi-band one if you run gdalbuildvrt test.vrt Projection\ Factors\ EPSG_5347.tif.tif manually?

Yes, without band names but it looks OK.
Also found this in the Processing tab of Log Messages panel:

2024-11-21T06:22:44     INFO    gdalbuildvrt -overwrite -resolution average -separate -r nearest -input_file_list /tmp/processing_vUbKku/4615e4a8a5874818b3e1ed5e1fa9c481/buildvrtInputFiles.txt "/tmp/processing_vUbKku/f4673f29165f451a8959422e348ba532/Projection Factors EPSG_5347.tif.vrt"
2024-11-21T06:22:44     INFO    GDAL command output:
2024-11-21T06:22:44     INFO    Process completed successfully
2024-11-21T06:22:44     INFO    Results: {'OUTPUT': '/tmp/processing_vUbKku/f4673f29165f451a8959422e348ba532/Projection Factors EPSG_5347.tif.vrt'}
2024-11-21T06:22:44     CRITICAL    Warning 1: /tmp/processing_vUbKku/f4673f29165f451a8959422e348ba532/Projection Factors EPSG_5347.tif has 12 bands. Only the first one will be taken into account in the -separate case
2024-11-21T06:22:44     INFO    0...10...20...30...40...50...60...70...80...90...100 - done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants