[SCM] PostGIS branch master updated. 3.6.0rc2-616-gbf9cc9f63
git at osgeo.org
git at osgeo.org
Thu Jun 18 11:35:26 PDT 2026
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "PostGIS".
The branch, master has been updated
via bf9cc9f63a8a1557976a2518792167fada45ed2d (commit)
from e80ff0a0cf01e8834eb7fdef7d17161dd2a825b1 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit bf9cc9f63a8a1557976a2518792167fada45ed2d
Author: Darafei Praliaskouski <me at komzpa.net>
Date: Thu Jun 18 22:21:37 2026 +0400
raster: document raster2pgsql SRID reprojection
Closes #3743
Closes https://github.com/postgis/postgis/pull/964
diff --git a/NEWS b/NEWS
index ad8c66e92..af7656e13 100644
--- a/NEWS
+++ b/NEWS
@@ -55,6 +55,8 @@ To take advantage of all postgis_sfcgal extension features SFCGAL 2.3+ is needed
- #6062, [topology] Stop using recursive snapping, for improved robustness (Sandro Santilli)
- #6065, Improved winding order computation robustness for rings having collapsed elements
(Sandro Santilli)
+ - #3743, [raster] Document and test raster2pgsql -s FROM_SRID:SRID
+ reprojection support (Darafei Praliaskouski)
* Bug Fixes *
diff --git a/doc/using_raster_dataman.xml b/doc/using_raster_dataman.xml
index ef79c1164..2f8773895 100644
--- a/doc/using_raster_dataman.xml
+++ b/doc/using_raster_dataman.xml
@@ -177,10 +177,10 @@ Available GDAL raster formats:
<para>
<variablelist>
<varlistentry>
- <term><option>-s <SRID></option></term>
+ <term><option>-s [<FROM_SRID>:]<SRID></option></term>
<listitem>
<para>
- Assign output raster with specified SRID. If not provided or is zero, raster's metadata will be checked to determine an appropriate SRID.
+ Assign the output raster to the specified SRID. When FROM_SRID is also provided, raster2pgsql marks the input raster with FROM_SRID and emits SQL that reprojects the raster to the target SRID. If the source SRID is omitted or is zero, the raster metadata will be checked to determine an appropriate source SRID. Reprojection cannot be used with copy mode.
</para>
</listitem>
</varlistentry>
diff --git a/raster/loader/raster2pgsql.c b/raster/loader/raster2pgsql.c
index f593ac64b..68f68b526 100644
--- a/raster/loader/raster2pgsql.c
+++ b/raster/loader/raster2pgsql.c
@@ -8,6 +8,7 @@
* Copyright 2009 Mark Cave-Ayland <mark.cave-ayland at siriusit.co.uk>
* Copyright (C) 2011 Regents of the University of California
* <bkpark at ucdavis.edu>
+ * Copyright 2026 Darafei Praliaskouski <me at komzpa.net>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -338,25 +339,17 @@ chartrim(const char *input, char *remove) {
static void
usage() {
printf(_("RELEASE: %s GDAL_VERSION=%d (%s)\n"), POSTGIS_LIB_VERSION, POSTGIS_GDAL_VERSION, xstr(POSTGIS_REVISION));
- printf(_(
- "USAGE: raster2pgsql [<options>] <raster>[ <raster>[ ...]] [[<schema>.]<table>]\n"
- " Multiple rasters can also be specified using wildcards (*,?).\n"
- "\n"
- "OPTIONS:\n"
- ));
- /*
- printf(_(
- " -s [<from>:]<srid> Set the SRID field. Defaults to %d.\n"
- " Optionally reprojects from given SRID (cannot be used with -Y).\n"
- " Raster's metadata will be checked to determine an appropriate SRID.\n"
- " If a srid of %d is provided (either as from or as target).\n"
- ), SRID_UNKNOWN, SRID_UNKNOWN);
- */
- printf(_(
- " -s <srid> Set the SRID field. Defaults to %d. If SRID not\n"
- " provided or is %d, raster's metadata will be checked to\n"
- " determine an appropriate SRID.\n"
- ), SRID_UNKNOWN, SRID_UNKNOWN);
+ printf(
+ _("USAGE: raster2pgsql [<options>] <raster>[ <raster>[ ...]] [[<schema>.]<table>]\n"
+ " Multiple rasters can also be specified using wildcards (*,?).\n"
+ "\n"
+ "OPTIONS:\n"));
+ printf(_(" -s [<from>:]<srid> Set the SRID field. Defaults to %d.\n"
+ " Optionally reprojects from given SRID (cannot be used with -Y).\n"
+ " Raster's metadata will be checked to determine an appropriate SRID.\n"
+ " Metadata lookup is also used when %d is provided as from or target.\n"),
+ SRID_UNKNOWN,
+ SRID_UNKNOWN);
printf(_(
" -b <band> Index (1-based) of band to extract from raster. For more\n"
" than one band index, separate with comma (,). Ranges can be\n"
diff --git a/raster/test/regress/loader/Projected.opts b/raster/test/regress/loader/Projected.opts
index d98e23d0d..12a2b1e3b 100644
--- a/raster/test/regress/loader/Projected.opts
+++ b/raster/test/regress/loader/Projected.opts
@@ -1 +1 @@
--s :3857 -l 2
+-s 4326:3857 -l 2
-----------------------------------------------------------------------
Summary of changes:
NEWS | 2 ++
doc/using_raster_dataman.xml | 4 ++--
raster/loader/raster2pgsql.c | 31 ++++++++++++-------------------
raster/test/regress/loader/Projected.opts | 2 +-
4 files changed, 17 insertions(+), 22 deletions(-)
hooks/post-receive
--
PostGIS
More information about the postgis-tickets
mailing list