Skip to content

Doc: Projections tutorial#14285

Merged
rouault merged 11 commits intoOSGeo:masterfrom
geographika:projections-tutorial
Apr 12, 2026
Merged

Doc: Projections tutorial#14285
rouault merged 11 commits intoOSGeo:masterfrom
geographika:projections-tutorial

Conversation

@geographika
Copy link
Copy Markdown
Collaborator

@geographika geographika commented Apr 2, 2026

This PR adds a new tutorial on working with CRSs in GDAL. It was hard to define the scope of the tutorial, and I have pages more of notes that may make it to a separate "advanced" page. I'm not 100% happy with it, so open to suggestions and feedback before merging.

Link to preview: https://gdal--14285.org.readthedocs.build/en/14285/tutorials/reprojecting_data.html

Several new examples are added to the various CLI tools. There is some overlap with the older tutorial, but the focus here is on the new CLI and reading the CRS info returned by GDAL.

There is also a fix in one of the parameters in gdal_raster_reproject.rst.
A few notes:

  • the full WKT CRS takes up a lot of the gdal info output. I'm guessing 90% of the time users just want to know the EPSG code. Having several EPSG codes included in the output (for example in the CONVERSION block) likely causes some confusion. Would only returning the EPSG code for known / unmodified CRSs be an option?
  • The Natural Earth example, with the new CLI tools returns lots of "old" errors e.g. Warning 1: A geometry of type MULTIPOLYGON is inserted into layer ne_10m_admin_0_countries_chn of geometry type POLYGON, which is not normally allowed by the GeoPackage specification, but the driver will however do it. To create a conformant GeoPackage, if using ogr2ogr, the -nlt option can be used to override the layer geometry type. This warning will no longer be emitted for this combination of layer and feature geometry type.

Hopefully there are no inaccuracies in the tutorial - have at it @jjimenezshaw !

Comment thread doc/source/programs/gdal_raster_reproject.rst Outdated
Comment thread doc/source/programs/gdal_raster_reproject.rst Outdated
Comment thread doc/source/tutorials/reprojecting_data.rst Outdated
Comment thread doc/source/glossary.rst Outdated
Coordinate Reference System. A system that maps spatial data coordinates to real-world locations,
combining a coordinate system with a reference surface like a projection or :term:`ellipsoid`.
Coordinate Reference System. Specifies how coordinates correspond to locations on Earth,
including the coordinate system, :term:`datum`, and, if applicable, a projection.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As many people exchange "coordinate reference system" and "coordinate system", if we use "coordinate system" we should also explain it. Otherwise people will not understand it.

Other option is to not mention "coordinate system" at all, but tell something else in the CRS definition.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added a glossary entry for "coordinate system" as best I can, and linked to that

Comment thread doc/source/tutorials/reprojecting_data.rst Outdated
Co-authored-by: Javier Jimenez Shaw <j1@jimenezshaw.com>
Comment thread doc/source/programs/gdal_raster_reproject.rst Outdated
Comment thread doc/source/programs/gdal_vector_edit.rst Outdated
Comment thread doc/source/tutorials/index.rst Outdated
Comment thread doc/source/tutorials/osr_api_tut.rst
Comment thread doc/source/tutorials/reprojecting_data.rst Outdated
Comment thread doc/source/tutorials/reprojecting_data.rst
Comment thread doc/source/tutorials/reprojecting_data.rst Outdated
Comment thread doc/source/tutorials/reprojecting_data.rst Outdated
Comment thread doc/source/glossary.rst Outdated
Comment thread doc/source/glossary.rst
@ctoney
Copy link
Copy Markdown
Contributor

ctoney commented Apr 2, 2026

I read through the rendered preview. Nice work. Thanks, this is a really good addition!

It was hard to define the scope of the tutorial, and I have pages more of notes that may make it to a separate "advanced" page.

That definitely makes sense given the topic. The tutorial hits the right spot IMO. It's introductory and beginner friendly while still providing helpful info and interesting reading for more experienced users. I also like that several links to relevant information are incorporated into a concise tutorial. That gives me one good source I can go to even if I'm just looking for some linked info that I can't remember where it was. Keeping the intro tutorial relatively short makes it more digestible, but you condensed it well to the essentials. That seems like the right model. I would be interested to see it link to the "advanced" page at some point :)

geographika and others added 4 commits April 7, 2026 17:27
Co-authored-by: Even Rouault <even.rouault@spatialys.com>
Co-authored-by: Even Rouault <even.rouault@spatialys.com>
Co-authored-by: Even Rouault <even.rouault@spatialys.com>
Co-authored-by: Even Rouault <even.rouault@spatialys.com>
@geographika
Copy link
Copy Markdown
Collaborator Author

@jjimenezshaw @rouault @ctoney - thanks all for your reviews, and taking the time to read through this. I'll address the comments above in the next few days.

@geographika geographika added documentation Issues and contributions to the documentation content funded through GSP Work funded through the GDAL Sponsorship Program labels Apr 7, 2026
@geographika geographika marked this pull request as draft April 7, 2026 15:45
@geographika
Copy link
Copy Markdown
Collaborator Author

geographika commented Apr 10, 2026

When #14286 and #14303 are merged I'll update to include its usage and switch from draft.

@rouault
Copy link
Copy Markdown
Member

rouault commented Apr 10, 2026

When #14286 and #14303 are merged I'll update to include its usage and switch from draft.

merged

@geographika
Copy link
Copy Markdown
Collaborator Author

Updated the tutorial to take into account the summary CRS information (added in #14303).

A couple of questions while writing the docs:

    Coordinate Reference System:
      - name: WGS 84
      - ID: EPSG:4326
      - type: Geographic 2D
      - area of use: World, west -180.00, south -90.00, east 180.00, north 90.00
    Data axis to CRS axis mapping: 2,1

I presume -**units: degree** isn't part of the output as it is assumed for a Geographic CRS?

    Coordinate Reference System:
      - name: WGS 84 / Pseudo-Mercator
      - ID: EPSG:3857
      - type: Projected
      - projection type: Popular Visualisation Pseudo-Mercator, Popular Visualisation Pseudo Mercator
      - units: metre
      - area of use: World between 85.06°S and 85.06°N, west -180.00, south -85.06, east 180.00, north 85.06
    Data axis to CRS axis mapping: 1,2

I tried to explain the duplicated "Popular Visualisation Pseudo-Mercator" in the ouput as follows:

  • projection type: Popular Visualisation Pseudo-Mercator, Popular Visualisation Pseudo Mercator - this shows both the projection conversion name and the EPSG method name.
    They are identical here because the CRS uses the standard EPSG:1024 Web Mercator method, so both the conversion and method labels resolve to the same projection definition.

Is this correct?

@geographika geographika marked this pull request as ready for review April 11, 2026 15:57
@rouault
Copy link
Copy Markdown
Member

rouault commented Apr 11, 2026

I presume -**units: degree** isn't part of the output as it is assumed for a Geographic CRS?

although that's clearly lazyness of mine. There are ancient times geographic CRS where the units is ... cough cough ... grads. But who cares about les-fromages-qui-puent ? Anyway most of the GDAL interface for such CRS communicates in degree, so let's shut up on those confusing details

Is this correct?

yep, but the best documentation is the one you don't have to write. I'll tune that so we don't emit twice the same info

@rouault
Copy link
Copy Markdown
Member

rouault commented Apr 11, 2026

I'll tune that so we don't emit twice the same inf

#14330

@rouault rouault merged commit fd3f16d into OSGeo:master Apr 12, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Issues and contributions to the documentation content funded through GSP Work funded through the GDAL Sponsorship Program

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants