A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/GEOSwift/GEOSwift below:

GEOSwift/GEOSwift: The Swift Geometry Engine.

Easily handle a geometric object model (points, linestrings, polygons etc.) and related topological operations (intersections, overlapping etc.). A type-safe, MIT-licensed Swift interface to the OSGeo's GEOS library routines.

For MapKit integration visit: https://github.com/GEOSwift/GEOSwiftMapKit
For MapboxGL integration visit: https://github.com/GEOSwift/GEOSwiftMapboxGL

Migrating to Version 5 or Later

Version 5 constitutes a ground-up rewrite of GEOSwift. For full details and help migrating from version 4, see VERSION_5.md.

GEOS is licensed under LGPL 2.1 and its compatibility with static linking is at least controversial. Use of geos without dynamic linking is discouraged.

  1. Update your Podfile to include:

     use_frameworks!
     pod 'GEOSwift'
    
  2. Run $ pod install

  1. Update the top-level dependencies in your Package.swift to include:

     .package(url: "https://github.com/GEOSwift/GEOSwift.git", from: "11.2.0")
    
  2. Update the target dependencies in your Package.swift to include

In certain cases, you may also need to explicitly include geos as a dependency. See issue #195 for details.

// 1. From Well Known Text (WKT) representation
let point = try Point(wkt: "POINT(10 45)")
let polygon = try Geometry(wkt: "POLYGON((35 10, 45 45.5, 15 40, 10 20, 35 10),(20 30, 35 35, 30 20, 20 30))")

// 2. From a Well Known Binary (WKB)
let wkb: NSData = geometryWKB()
let geometry2 = try Geometry(wkb: wkb)

// 3. From a GeoJSON file:
let decoder = JSONDecoder()
if let geoJSONURL = Bundle.main.url(forResource: "multipolygon", withExtension: "geojson"),
    let data = try? Data(contentsOf: geoJSONURL),
    let geoJSON = try? decoder.decode(GeoJSON.self, from: data),
    case let .feature(feature) = geoJSON,
    let italy = feature.geometry
{
    italy
}

Let's say we have two geometries:

GEOSwift let you perform a set of operations on these two geometries:

Explore more, interactively, in the playground, which is available in the GEOSwiftMapKit project. It can be found inside GEOSwiftMapKit workspace. Open the workspace in Xcode, build the GEOSwiftMapKit framework and open the playground file.

To make a contribution:


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4