Skip to content

Commit

Permalink
add extra requirement files
Browse files Browse the repository at this point in the history
  • Loading branch information
cnheider committed Dec 10, 2023
1 parent dd1854b commit 87c372c
Show file tree
Hide file tree
Showing 10 changed files with 29 additions and 38 deletions.
2 changes: 1 addition & 1 deletion jord/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

__project__ = "Jord"
__author__ = "Christian Heider Lindbjerg"
__version__ = "0.3.0"
__version__ = "0.3.1"
__doc__ = r"""
.. module:: jord
:platform: Unix, Windows
Expand Down
4 changes: 2 additions & 2 deletions jord/shapely_utilities/grouping.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import shapely
from shapely import unary_union

from jord.shapely_utilities import closing
from jord.shapely_utilities.geometry_types import is_multi
from .geometry_types import is_multi
from .morphology import closing

__all__ = ["overlap_groups"]

Expand Down
21 changes: 10 additions & 11 deletions jord/shapely_utilities/lines.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,34 +23,33 @@
import collections
import logging
from enum import Enum
from typing import List, Iterable, Optional
from typing import Tuple, Sequence, Union
from typing import Iterable, List, Optional, Sequence, Tuple, Union

import numpy
from shapely.geometry import (
GeometryCollection,
LineString,
MultiLineString,
MultiPoint,
MultiPolygon,
Point,
Polygon,
MultiPolygon,
GeometryCollection,
box,
)
from shapely.geometry import box
from shapely.geometry.base import BaseGeometry
from shapely.ops import linemerge as shapely_linemerge
from sorcery import assigned_names
from warg import Number, pairs

from jord.shapely_utilities.points import (
unique_line_points,
nearest_neighbor_within,
from .points import (
azimuth,
shift_point,
closest_object,
nearest_neighbor_within,
shift_point,
unique_line_points,
)
from jord.shapely_utilities.polygons import explode_polygons
from jord.shapely_utilities.projection import nearest_geometry
from .polygons import explode_polygons
from .projection import nearest_geometry

EPSILON = 1e-6

Expand Down
12 changes: 3 additions & 9 deletions jord/shapely_utilities/morphology.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ def erosion(geom: BaseGeometry, eps: float = 1e-7) -> BaseGeometry:
return geom.buffer(-eps)


erode = erosion


def dilation(geom: BaseGeometry, eps: float = 1e-7) -> BaseGeometry:
"""
Expand All @@ -30,9 +27,6 @@ def dilation(geom: BaseGeometry, eps: float = 1e-7) -> BaseGeometry:
return geom.buffer(eps)


dilate = dilation


def closing(geom: BaseGeometry, eps: float = 1e-7) -> BaseGeometry:
"""
Expand All @@ -43,9 +37,6 @@ def closing(geom: BaseGeometry, eps: float = 1e-7) -> BaseGeometry:
return erode(dilate(geom, eps), eps)


close = closing


def opening(geom: BaseGeometry, eps: float = 1e-7) -> BaseGeometry:
"""
Expand All @@ -57,6 +48,9 @@ def opening(geom: BaseGeometry, eps: float = 1e-7) -> BaseGeometry:


# open = opening # keyword clash
erode = erosion
dilate = dilation
close = closing

if __name__ == "__main__":

Expand Down
8 changes: 4 additions & 4 deletions jord/shapely_utilities/polygons.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-

import statistics
from typing import Union, Tuple, List, Sequence, Generator
from typing import Generator, List, Sequence, Tuple, Union

from shapely.geometry import (
LineString,
Expand All @@ -12,10 +12,10 @@
Polygon,
)
from shapely.geometry.base import BaseGeometry
from warg import pairs, Number
from warg import Number, pairs

from jord.shapely_utilities.morphology import opening, closing
from jord.shapely_utilities.rings import ensure_ccw_ring, ensure_cw_ring
from .morphology import closing, opening
from .rings import ensure_ccw_ring, ensure_cw_ring

__all__ = [
"zero_buffer",
Expand Down
15 changes: 4 additions & 11 deletions jord/shapely_utilities/rings.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

from typing import Iterable, Union

from shapely import LineString, LinearRing, MultiLineString, Point

from shapely import LinearRing
from .projection import line_line_intersection, project_point_to_line

__all__ = [
"ensure_ccw_ring",
Expand All @@ -24,16 +27,6 @@ def ensure_cw_ring(ring: LinearRing) -> LinearRing:
return ring


from typing import Iterable, Union

from shapely import MultiLineString, LineString, Point, LinearRing

from jord.shapely_utilities.projection import (
project_point_to_line,
line_line_intersection,
)


def make_projected_ring(
lines: Union[MultiLineString, Iterable[LineString]], ccw: bool = True
) -> LinearRing:
Expand Down
1 change: 1 addition & 0 deletions requirements/requirements_fiona.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
fiona
1 change: 1 addition & 0 deletions requirements/requirements_geopandas.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
geopandas
1 change: 1 addition & 0 deletions requirements/requirements_networkx.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
networkx
2 changes: 2 additions & 0 deletions requirements/requirements_shapely.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pyproj
shapely

0 comments on commit 87c372c

Please sign in to comment.