![]() |
SWMMVis
6.0.0-alpha.4
Qt6/C++ GIS-based graphical user interface for the SWMMVis engine (6.0.0-alpha.4)
|
Classes | |
| struct | GeorefProbe |
| What a cheap read-only open reveals about a raster's georeferencing — for dialog prefill/validation. More... | |
| struct | WorldFileParams |
| The six lines of an ESRI world file, in file order. More... | |
Functions | |
| bool | parseWorldFile (const QString &path, WorldFileParams *out, QString *err) |
| Parses a world file: six whitespace/newline-separated doubles. | |
| QStringList | worldFileCandidates (const QString &imagePath) |
| Conventional world-file sidecar paths for imagePath, in priority order. | |
| void | worldFileToGeoTransform (const WorldFileParams &wf, double gt[6]) |
| Converts world-file parameters to a GDAL GeoTransform. | |
| bool | applyPamGeoref (const QString &imagePath, const double *gt6, const QString &crsWkt, QString *err) |
| Persists georeferencing on imagePath so every later plain GDAL open sees it. | |
| GeorefProbe | probeGeoref (const QString &imagePath) |
| Probes imagePath read-only; never fails (an unopenable file simply yields a default-constructed probe). | |
| QString | authCodeToWkt (const QString &authCode, QString *err) |
| Resolves a CRS identifier ("EPSG:26985" or anything else OGRSpatialReference::SetFromUserInput accepts) to WKT. | |
| bool openswmmvis::io::rastergeoref::applyPamGeoref | ( | const QString & | imagePath, |
| const double * | gt6, | ||
| const QString & | crsWkt, | ||
| QString * | err | ||
| ) |
Persists georeferencing on imagePath so every later plain GDAL open sees it.
First tries the driver's native update path (GDALOpenEx with GDAL_OF_UPDATE + SetGeoTransform/SetSpatialRef — GTiff writes internally or to PAM as GDAL decides). If the driver refuses update access (PNG/JPEG do), writes/merges the PAM sidecar "<imagePath>.aux.xml" directly, preserving any existing non-georef PAM content (statistics, histograms). Finally verifies by reopening read-only.
| imagePath | Raster to georeference. |
| gt6 | Optional GeoTransform (6 doubles, CORNER-anchored — see worldFileToGeoTransform()); nullptr = don't set. |
| crsWkt | CRS as WKT (see authCodeToWkt()); empty = don't set. |
| err | Optional; receives a message on failure. |
| QString openswmmvis::io::rastergeoref::authCodeToWkt | ( | const QString & | authCode, |
| QString * | err | ||
| ) |
Resolves a CRS identifier ("EPSG:26985" or anything else OGRSpatialReference::SetFromUserInput accepts) to WKT.
| authCode | CRS identifier. |
| err | Optional; receives a message on failure. |
| bool openswmmvis::io::rastergeoref::parseWorldFile | ( | const QString & | path, |
| WorldFileParams * | out, | ||
| QString * | err | ||
| ) |
Parses a world file: six whitespace/newline-separated doubles.
Locale-independent (world files always use '.' as the decimal separator).
| path | World file to read. |
| out | Receives the parsed parameters on success. |
| err | Optional; receives a message on failure (unreadable file, fewer than six values, or a non-numeric value). |
| GeorefProbe openswmmvis::io::rastergeoref::probeGeoref | ( | const QString & | imagePath | ) |
Probes imagePath read-only; never fails (an unopenable file simply yields a default-constructed probe).
| QStringList openswmmvis::io::rastergeoref::worldFileCandidates | ( | const QString & | imagePath | ) |
Conventional world-file sidecar paths for imagePath, in priority order.
For the common formats the conventional three-letter name comes first (.tif/.tiff → .tfw, .png → .pgw, .jpg/.jpeg → .jgw, .bmp → .bpw), followed by the generic "first + last letter of the extension + w" form, the full "extension + w" form (e.g. .tifw), and finally the format-agnostic .wld.
Pure path arithmetic — ALL candidates are returned whether or not they exist on disk; the caller checks existence.
| void openswmmvis::io::rastergeoref::worldFileToGeoTransform | ( | const WorldFileParams & | wf, |
| double | gt[6] | ||
| ) |
Converts world-file parameters to a GDAL GeoTransform.
A world file anchors C/F at the CENTER of the top-left pixel; the GDAL GeoTransform anchors gt[0]/gt[3] at its top-left CORNER: gt[0] = C − A/2 − B/2 and gt[3] = F − D/2 − E/2, with gt[1]=A, gt[2]=B, gt[4]=D, gt[5]=E.