Skip to content
Draft
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
Empty file added geoarrow/core/__init__.py
Empty file.
1 change: 1 addition & 0 deletions geoarrow/core/array/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from .point import PointArray
47 changes: 47 additions & 0 deletions geoarrow/core/array/point.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
from __future__ import annotations

from dataclasses import dataclass
from typing import TYPE_CHECKING

import pyarrow as pa

if TYPE_CHECKING:
import geoarrow.geo
import geoarrow.geos
import geoarrow.proj


@dataclass
class PointArray:

arr: pa.Array

def __post_init__(self):
validate_point_array(self.arr)

@property
def geo(self) -> geoarrow.geo.PointArray:
"""Access GeoRust algorithms on this PointArray"""
import geoarrow.geo

return geoarrow.geo.PointArray.from_pyarrow(self.arr)

@property
def geos(self) -> geoarrow.geos.PointArray:
"""Access GEOS algorithms on this PointArray"""
import geoarrow.geos

return geoarrow.geos.PointArray.from_pyarrow(self.arr)

@property
def proj(self) -> geoarrow.proj.PointArray:
"""Access Proj algorithms on this PointArray"""
import geoarrow.proj

return geoarrow.proj.PointArray.from_pyarrow(self.arr)


def validate_point_array(arr: pa.Array):
"""Validate that this pyarrow Array is a valid GeoArrow Point array
"""
pass
80 changes: 80 additions & 0 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[tool.poetry]
name = "geoarrow.core"
version = "0.1"
description = "Core classes for GeoArrow in Python"
authors = []
readme = "README.md"
packages = [
{ include = "core", from = "geoarrow" }
]

[tool.poetry.dependencies]
python = "^3.8"
pyarrow = "^12.0.1"

[tool.poetry.dev-dependencies]

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"