• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

OSGeo / gdal / 15885686134

25 Jun 2025 07:44PM UTC coverage: 71.084%. Remained the same
15885686134

push

github

rouault
gdal_priv.h: fix C++11 compatibility

573814 of 807237 relevant lines covered (71.08%)

250621.56 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/frmts/postgisraster/postgisrastertiledataset.cpp
1
/***********************************************************************
2
 * File :    postgisrastertiledataset.cpp
3
 * Project:  PostGIS Raster driver
4
 * Purpose:  GDAL Dataset implementation for PostGIS Raster tile
5
 * Author:   Jorge Arevalo, jorge.arevalo@deimos-space.com
6
 *                          jorgearevalo@libregis.org
7
 *
8
 *
9
 ***********************************************************************
10
 * Copyright (c) 2013, Jorge Arevalo
11
 * Copyright (c) 2013, Even Rouault
12
 *
13
 * SPDX-License-Identifier: MIT
14
 ************************************************************************/
15
#include "postgisraster.h"
16

17
/************************
18
 * \brief Constructor
19
 ************************/
20
PostGISRasterTileDataset::PostGISRasterTileDataset(
×
21
    PostGISRasterDataset *poRDSIn, int nXSize, int nYSize)
×
22
    : poRDS(poRDSIn), pszPKID(nullptr)
×
23
{
24
    nRasterXSize = nXSize;
×
25
    nRasterYSize = nYSize;
×
26
}
×
27

28
/************************
29
 * \brief Destructor
30
 ************************/
31
PostGISRasterTileDataset::~PostGISRasterTileDataset()
×
32
{
33
    if (pszPKID)
×
34
    {
35
        CPLFree(pszPKID);
×
36
        pszPKID = nullptr;
×
37
    }
38
}
×
39

40
/********************************************************
41
 * \brief Get the affine transformation coefficients
42
 ********************************************************/
43
CPLErr PostGISRasterTileDataset::GetGeoTransform(GDALGeoTransform &gt) const
×
44
{
45
    gt = m_gt;
×
46
    return CE_None;
×
47
}
48

49
/********************************************************
50
 * \brief Return spatial extent of tile
51
 ********************************************************/
52
void PostGISRasterTileDataset::GetNativeExtent(double *pdfMinX, double *pdfMinY,
×
53
                                               double *pdfMaxX,
54
                                               double *pdfMaxY) const
55
{
56
    // FIXME; incorrect in case of non 0 rotation terms
57

58
    double dfMinX = m_gt[GEOTRSFRM_TOPLEFT_X];
×
59
    double dfMaxY = m_gt[GEOTRSFRM_TOPLEFT_Y];
×
60

61
    double dfMaxX = m_gt[GEOTRSFRM_TOPLEFT_X] +
×
62
                    nRasterXSize * m_gt[GEOTRSFRM_WE_RES] +
×
63
                    nRasterYSize * m_gt[GEOTRSFRM_ROTATION_PARAM1];
×
64

65
    double dfMinY = m_gt[GEOTRSFRM_TOPLEFT_Y] +
×
66
                    nRasterXSize * m_gt[GEOTRSFRM_ROTATION_PARAM2] +
×
67
                    nRasterYSize * m_gt[GEOTRSFRM_NS_RES];
×
68

69
    // In case yres > 0
70
    if (dfMinY > dfMaxY)
×
71
    {
72
        double dfTemp = dfMinY;
×
73
        dfMinY = dfMaxY;
×
74
        dfMaxY = dfTemp;
×
75
    }
76

77
    *pdfMinX = dfMinX;
×
78
    *pdfMinY = dfMinY;
×
79
    *pdfMaxX = dfMaxX;
×
80
    *pdfMaxY = dfMaxY;
×
81
}
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc