GEOSwift alternatives and similar libraries
Based on the "Maps" category.
Alternatively, view GEOSwift alternatives based on common mentions on social networks and blogs.
-
Mapbox GL
DISCONTINUED. Interactive, thoroughly customizable maps in native Android, iOS, macOS, Node.js, and Qt applications, powered by vector tiles and OpenGL -
NAMapKit
Allows you to use custom maps in iphone applications and attempts to mimics some of the behaviour of the MapKit framework -
CMMapLauncher
CMMapLauncher is a mini-library for iOS that makes it quick and easy to show directions in various mapping applications. -
JDSwiftHeatMap
JDSwiftMap is an IOS Native MapKit Library. You can easily make a highly customized HeatMap. -
MapViewPlus
DISCONTINUED. Use any custom view as custom callout view of your MKMapView with cool animations. Also, easily use any image as annotation view. -
GoogleMapsHelper
An easy to integrate Model Based Google Maps Helper (SVHTTPClient, AFNetworking) That lets you Geo Code , Reverse Geocode, Get Directions , Places Autocomplete. -
GLMap
Crossplatform offline vector map with MapCSS styling. Offline search and offline navigation are included.
CodeRabbit: AI Code Reviews for Developers
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of GEOSwift or a related project?
README
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](VERSION_5.md).
Features
- A pure-Swift, type-safe, optional-aware programming interface
- WKT and WKB reading & writing
- Robust support for GeoJSON via Codable
- Thread-safe
- Swift-native error handling
- Extensively tested
Requirements
- iOS 9.0+, tvOS 9.0+, macOS 10.9+, watchOS 2.0+ (Swift Package Manager, CocoaPods)
- Linux (Swift Package Manager)
- Swift 5.3
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.
Installation
CocoaPods
Update your
Podfile
to include:use_frameworks! pod 'GEOSwift'
Run
$ pod install
Swift Package Manager
Update the top-level dependencies in your
Package.swift
to include:.package(url: "https://github.com/GEOSwift/GEOSwift.git", from: "9.0.0")
Update the target dependencies in your
Package.swift
to include"GEOSwift"
In certain cases, you may also need to explicitly include geos as a dependency. See issue #195 for details.
Usage
Geometry creation
// 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
}
Topological operations
Let's say we have two geometries:
GEOSwift let you perform a set of operations on these two geometries:
Predicates:
- equals: returns true if this geometric object is âspatially equalâ to another geometry.
- disjoint: returns true if this geometric object is âspatially disjointâ from another geometry.
- intersects: returns true if this geometric object âspatially intersectsâ another geometry.
- touches: returns true if this geometric object âspatially touchesâ another geometry.
- crosses: returns true if this geometric object âspatially crossesâ another geometry.
- within: returns true if this geometric object is âspatially withinâ another geometry.
- contains: returns true if this geometric object âspatially containsâ another geometry.
- overlaps: returns true if this geometric object âspatially overlapsâ another geometry.
- relate: returns true if this geometric object is spatially related to another geometry by testing for intersections between the interior, boundary and exterior of the two geometric objects as specified by the values in the intersectionPatternMatrix.
Playground
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.
Contributing
To make a contribution:
- Fork the repo
- Start from the
main
branch and create a branch with a name that describes your contribution - Run
$ xed Package.swift
to open the project in Xcode. - Run
$ swiftlint
from the repo root and resolve any issues. - Sign in to travis-ci.com (if you've never signed in before, CI won't run to verify your pull request)
- Push your branch and create a pull request to
main
- One of the maintainers will review your code and may request changes
- If your pull request is accepted, one of the maintainers should update the changelog before merging it
Maintainer
- Andrew Hershberger (@macdrevx)
Past Maintainers
- Virgilio Favero Neto (@vfn)
- Andrea Cremaschi (@andreacremaschi) (original author)
License
- GEOSwift was released by Andrea Cremaschi (@andreacremaschi) under a MIT license. See LICENSE for more information.
- GEOS stands for Geometry Engine - Open Source, and is a C++ library, ported from the Java Topology Suite. GEOS implements the OpenGIS Simple Features for SQL spatial predicate functions and spatial operators. GEOS, now an OSGeo project, was initially developed and maintained by Refractions Research of Victoria, Canada.
*Note that all licence references and agreements mentioned in the GEOSwift README section above
are relevant to that project's source code only.