Skip to content

Commit

Permalink
version 0.3.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
csaybar committed Jun 11, 2024
1 parent e011d8d commit d4d2f04
Show file tree
Hide file tree
Showing 6 changed files with 102 additions and 159 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
demo.py

dist/

equi7grid_lite/__pycache__/
docs/diagrams.drawio
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

Unreleased changes here.

## [0.1.1] - 2024-06-09
## [0.3.0] - 2024-06-11

- A new attribute added self.levels to the Equi7Grid constructor. This attribute is a List of the available levels in the QuadTree structure.
- New arguments added to lonlat2grid and grid2lonlat methods. First a centroid argument. This argument is used to specify if user wants the centroid of the grid or the bottom-left corner. By default, the centroid is True in order to keep compatibility with the cubo package. The level argument is used to specify the level of the QuadTree structure reference. By default, the level is 0.
- New method added to the Equi7Grid class. The method is called align2grid. This method is used to align coordinates to the QuadTree structure.

## [0.2.0] - 2024-06-10

- Documentation in README.md and code comments improved.
- Shameful bug respect to the initial level. It must be 0 no 1. I'm not in R!
Expand Down
16 changes: 12 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,22 +71,30 @@ grid_system = Equi7Grid(min_grid_size=2560)
# zones: AN, NA, OC, SA, AF, EU, AS
# min_grid_size: 2560 meters
# max_grid_size: 1310720 meters
```

To convert between geographic coordinates and Equi7Grid tiles, use the `lonlat2grid` and `grid2lonlat` methods.

# Convert geographic coordinates to Equi7Grid tile
```python
lon, lat = -79.5, -5.49
grid_system.lonlat2grid(lon=lon, lat=lat)
# id x y zone level geometry
# 0 SA2560_E2008N2524 5140480.0 6461440.0 SA Z1 POLYGON ((5145600.000 6461440.000, 5145600.000...

# Convert Equi7Grid tile to geographic coordinates
grid_system.grid2lonlat(grid_id="SA2560_E2008N2524)
grid_system.grid2lonlat(grid_id="SA2560_E2008N2524")
# lon lat x y
# 0 -79.543717 -5.517556 5140480 6461440
```

The `Equi7Grid` class also provides a method for creating a grid of Equi7Grid tiles that cover a given bounding box.
For users who want to align coordinates to the Equi7Grid Quad-Tree structure, the `align2grid` method is available.

```python
grid_system.align2grid(lon=lon, lat=lat, level=5)
# lon lat
#0 -80.116158 -6.105519
```

The `Equi7Grid` class also provides a method for creating a grid of Equi7Grid tiles that cover a given bounding box.

```python
import geopandas as gpd
Expand Down
130 changes: 0 additions & 130 deletions docs/.$diagrams.drawio.bkp

This file was deleted.

Loading

0 comments on commit d4d2f04

Please sign in to comment.