> Every page of the ganymede website is listed in https://eugo.io/docs/ganymede/llms.txt.

# PyProj

> PyProj: Python interface to PROJ (cartographic projections and coordinate transformations library). A Python demo notebook from ganymede.

Web page: https://eugo.io/docs/ganymede/demo_notebooks/geospatial/pyproj/
Notebook: https://eugo.io/docs/ganymede/demo_notebooks/geospatial/pyproj/pyproj.ipynb (source: https://github.com/eugo-inc/ganymede/blob/main/demo_notebooks/geospatial/pyproj.ipynb)

Description:
- Python interface to PROJ (cartographic projections and coordinate transformations library).

Resources:
- [GitHub] https://github.com/pyproj4/pyproj
- [Docs] https://pyproj4.github.io/pyproj/stable/

## Example 1

Use a CRS (coordinate reference system)

```python
from pyproj import CRS

# These are all variations of the same "4326" CRS
crs = CRS.from_epsg(4326)
crs = CRS.from_string("EPSG:4326")
crs = CRS.from_proj4("+proj=latlon")
crs = CRS.from_user_input(4326)

crs
```

## Example 2

Transform coordinates

```python
import numpy
from pyproj import Transformer, transform

transformer = Transformer.from_crs(2263, 4326)
x_coords = numpy.random.randint(80000, 120000)
y_coords = numpy.random.randint(200000, 250000)

transformed = transformer.transform(x_coords, y_coords)

transformed
```
