Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add carto package demo code and README #645

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 81 additions & 0 deletions carto/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# `carto` package

[![Documentation](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go&logoColor=white&style=flat)](https://pkg.go.dev/github.com/peterstace/simplefeatures/carto?tab=doc)

Package carto provides cartography functionality for working with and making
maps.

This includes:

- Various projections between angular coordinates (longitude and latitude)
and planar coordinates (x and y).

- Earth radius definitions.

See
[godoc](https://pkg.go.dev/github.com/peterstace/simplefeatures/carto?tab=doc)
for the full package documentation.

---

The following section shows supported projections. The code used to generate
the images in this section can be found
[here](https://github.com/peterstace/simplefeatures/tree/master/internal/cartodemo).

[**Equirectangular projection**](https://en.wikipedia.org/wiki/Equirectangular_projection)

Standard parallels are set to 36°N and 36°S. This configuration of the
Equirectangular projection is also known as the Marinus (of Tyre) projection.

![Equirectangular projection](../internal/cartodemo/testdata/marinus.png)

[**Web Mercator projection**](https://en.wikipedia.org/wiki/Web_Mercator_projection)

This is the full zoom 0 tile of the Web Mercator projection.

![Web Mercator projection](../internal/cartodemo/testdata/web_mercator.png)

[**Lambert Cylindrical Equal Area projection**](https://en.wikipedia.org/wiki/Lambert_cylindrical_equal-area_projection)

The central meridian is set to 0°E.

![Lambert Cylindrical Equal Area projection](../internal/cartodemo/testdata/lambert_cylindrical_equal_area.png)

[**Sinusoidal projection**](https://en.wikipedia.org/wiki/Sinusoidal_projection)

The central meridian is set to 0°E.

![Sinusoidal projection](../internal/cartodemo/testdata/sinusoidal.png)

[**Orthographic projection**](https://en.wikipedia.org/wiki/Orthographic_projection)

Centered on North America at 45°N, 105°W.

![Orthographic projection](../internal/cartodemo/testdata/orthographic_north_america.png)

[**Azimuthal Equidistant projection**](https://en.wikipedia.org/wiki/Azimuthal_equidistant_projection)

Centered at Sydney, Australia at 151°E, 34°S.

![Azimuthal Equidistant projection](../internal/cartodemo/testdata/azimuthal_equidistant_sydney.png)

[**Equidistant Conic projection**](https://en.wikipedia.org/wiki/Equidistant_conic_projection)

Standard parallels are set to 30°N and 60°N. The central meridian is set to
0°E.

![Equidistant Conic projection](../internal/cartodemo/testdata/equidistant_conic.png)

[**Albers Equal Area Conic projection**](https://en.wikipedia.org/wiki/Albers_projection)

Standard parallels are set to 30°N and 60°N. The central meridian is set to
0°E.

![Albers Equal Area Conic projection](../internal/cartodemo/testdata/albers_equal_area_conic.png)

[**Lambert Conformal Conic projection**](https://en.wikipedia.org/wiki/Lambert_conformal_conic_projection)

Standard parallels are set to 30°N and 60°N. The central meridian is set to
0°E.

![Lambert Conformal Conic projection](../internal/cartodemo/testdata/lambert_conformal_conic.png)
2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ go 1.17
retract v0.45.0 // Due to bug: https://github.com/peterstace/simplefeatures/pull/554

require github.com/lib/pq v1.1.1

require golang.org/x/image v0.23.0 // indirect
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
github.com/lib/pq v1.1.1 h1:sJZmqHoEaY7f+NPP8pgLB/WxulyR3fewgCM2qaSlBb4=
github.com/lib/pq v1.1.1/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
golang.org/x/image v0.23.0 h1:HseQ7c2OpPKTPVzNjG5fwJsOTCiiwS4QdsYi5XU6H68=
golang.org/x/image v0.23.0/go.mod h1:wJJBTdLfCCf3tiHa1fNxpZmUI4mmoZvwMCPP0ddoNKY=
Loading