Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

explain_-Jproj_full.rst_ 2.4 KB

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
  1. .. _-Jproj_full:
  2. **-J**\ *proj*\|\ **EPSG:n**
  3. Starting at GMT6 it is possible to use the `PROJ <https://proj.org/>`_ library to do coordinate and datum transforms.
  4. This is achieved via GDAL so it requires that GMT build is linked to that library. It is, however,
  5. beyond the scope of this manual to document the **PROJ** syntax (that is the syntax of the **proj**
  6. and **cs2cs** programs) so users are referred to `PROJ Applications <http://proj.org/apps/index.html>`_ for the details.
  7. The usage of **PROJ** follows very closely the syntax of **proj** and **cs2cs**. The projection parameters
  8. are encapsulated under the **-J** option. Because there are normally several parameters defining a
  9. referencing system separated by spaces (in **PROJ** or **GDAL**) we can either use double quotes as in
  10. **-J**\ "*+proj=merc +ellps=WGS84 +units=m*\ " or just glue all parameters like in
  11. **-J**\ *+proj=merc+ellps=WGS84+units=m*.
  12. Using `EPSG codes <http://spatialreference.org>`_ is also possible (but need the setting of the **GDAL_DATA**
  13. environment variable to point to the GDAL's *data* sub-directory). For example **-JEPSG:4326** sets
  14. the WGS-84 system.
  15. For :doc:`mapproject </mapproject>` and :doc:`grdproject </grdproject>` we can go directly from the
  16. referencing system A to B without the intermediate step of converting to geographic coordinates.
  17. That is obtained (like in **cs2cs**) by using the **+to** keyword. Example:
  18. **-J**\ *EPSG:4326+to+proj=aeqd+ellps=WGS84+units=m*. A much awaited bonus is also that we now do not need
  19. to set **-R** to do point coordinate conversions.
  20. While for point and grid conversions done by **mapproject** and **grdproject** we can use `all PROJ projections
  21. <https://proj.org/operations/projections/index.html>`_, the situations is, however, rather more limited for mapping purposes.
  22. Here, only the subset of the **PROJ** projections that can be mapped into the GMT projections syntax is
  23. available to use. Another aspect that is not present in **PROJ**, because it's not a mapping library,
  24. is how to set the map scale or map dimension. We introduced the two extensions **+width=**\ *size* and
  25. **+scale=**\ *1:xxxx* that work exactly like the *map width* and *scale* in classical GMT. It is also allowed
  26. to provide the scale (but NOT the width) by appending the string "/1:xxx" to the end of the projection parameters.
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...