# GeoKernel Python

Official Python package for the GeoKernel GIS SDK.

The package name is `geokernel`:

```powershell
pip install geokernel
```

## Usage

```python
import sys

from PySide6.QtWidgets import QApplication, QMainWindow

from geokernel import Viewer, ViewerTool

app = QApplication(sys.argv)

window = QMainWindow()
window.setWindowTitle("HelloMap")
window.resize(1200, 800)

viewer = Viewer(width=1200, height=800)
viewer.set_tool(ViewerTool.PAN)
viewer.add_layer(r"D:\data\world_4326.shp")

window.setCentralWidget(viewer.qt_widget())
window.closeEvent = lambda event: (viewer.close(), event.accept())

window.show()
app.processEvents()
viewer.show()
viewer.resize(window.centralWidget().width(), window.centralWidget().height())
viewer.full_extent()
viewer.refresh_layers()
app.exec()
```

## Development

```powershell
python -m venv .venv
.\.venv\Scripts\Activate.ps1
pip install -e .
```

## Runtime Binaries

The PyPI package is designed to include the GeoKernel evaluation runtime under:

```text
src/geokernel/bin/
```

The runtime should include `GeoKernel.Viewer.dll`, GeoKernel DLLs, Qt DLLs, Skia/GDAL/PROJ dependencies, Qt plugins, GDAL plugins, `gdal-data`, and `proj-data`.

For development builds, copy the current local SDK runtime into the package with:

```powershell
python tools\sync_evaluation_binaries.py --source "D:\projects\GeoKernel\outputs\packages\Evaluation" --clean
```

If the package does not contain binaries yet, the wrapper also checks:

```text
GEOKERNEL_BIN
D:\projects\GeoKernel\outputs\packages\Evaluation
```

## Package Layout

```text
src/
  geokernel/
    __init__.py
    geometry.py
    layer.py
    dll.py
    viewer.py
    bin/
tools/
  sync_evaluation_binaries.py
```
