Skip to content
/ geos Public

GEOS packaging for SPM & CocoaPods

License

GEOSwift/geos

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

73 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GEOS

This library is an SPM-compatible repackaging of the source code from libgeos/geos for use on Apple and Linux systems.

GEOS is a C++ library for performing operations on two-dimensional vector geometries. It is primarily a port of the JTS Topology Suite Java library. It provides many of the algorithms used by PostGIS, the Shapely package for Python, the sf package for R, and others.

Requirements

  • Swift 5.9+
  • iOS 12.0+ / macOS 10.13+ / tvOS 12.0+ / watchOS 4.0+ / visionOS 1.0+
  • Linux

Usage

Swift Package Manager (SPM)

Add the following to your Package.swift:

let package = Package(
    name: "YourPackage",
    dependencies: [
        .package(url: "https://github.com/GEOSwift/geos.git", from: "11.0.0")
    ],
    targets: [
        .target(
            name: "YourTarget",
            dependencies: [
                .product(name: "geos", package: "geos")
            ]
        )
    ]
)

Basic Usage

import geos

// The geos C API is now available for use

Note

geos is built as a dynamically-linked library for maximum compliance with the LGPL 2.1 license. Use of statically-linked geos is discouraged.

Versioning

Currently version 11.0.0 packages libgeos/geos 3.14.1.

This package follows SemVer principles and therefore its versions don't map 1:1 with the underlying geos library. When a geos release identifies any changes as breaking, we will release a new major version of this library.

Licensing

The source code contained in this repo is released under a dual license:

  • The contents of the Sources directory are taken from libgeos/geos and distributed under the LGPL 2.1 license (see COPYING).
  • The other content of this repo is distributed under the MIT LICENSE.

Releasing a new version

  • Create a new branch.
  • Modify update.sh to successfully pull the new version of geos and construct an SPM-compatible Sources directory. This only entails pointing at a new source archive unless geos releases a new version with different build structure (rare).
  • Run update.sh.
  • Modify Package.swift if necessary.
  • Test the supported platforms (Apple Devices/Linux) with both CLI and Xcode.
  • Update this README.md with any relevant information (e.g. new version numbers).
  • Commit all modifications and open a PR.
  • Once merged, release a new version numbered according to SemVer principles. If the underlying geos release contains any breaking changes, increment the major release here. Minor and patch version increments are at your discretion.