The Swift Geometry Engine.

Overview

GEOSwift

CocoaPods Compatible Carthage Compatible SwiftPM Compatible Supported Platforms Build Status Code Coverage

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.

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+ (CocoaPods, Carthage, Swift PM)
  • Linux (Swift PM)
  • Swift 5.1

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

  1. Update your Podfile to include:

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

Carthage

  1. Add the following to your Cartfile:

     github "GEOSwift/GEOSwift" ~> 8.1
    
  2. Finish updating your project by following the typical Carthage workflow.

Swift Package Manager

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

     .package(url: "https://github.com/GEOSwift/GEOSwift.git", from: "8.1.0")
    
  2. 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:

Example geometries

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

Topological operations

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.

Playground

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.
  • Update GEOSwift.xcodeproj: After making your changes, you also need to update the Xcode project. You'll need a version of Carthage greater than 0.36.0 so that you can use the --use-xcframeworks option. Run $ carthage update --use-xcframeworks to generate geos.xcframework. Then open the GEOSwift.xcodeproj and ensure that it works with your changes. You'll likely only need to make changes if you've added, removed, or renamed files.
  • 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

Past Maintainers

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.
Comments
  • pod install fails on macOS High Sierra

    pod install fails on macOS High Sierra

    I'm running macOS High Sierra 10.13.3, XCode 9.2 (9C40b), and cocoapods 1.4.0. Running 'pod install' for 'GEOSwift' yields the following error. It seems to be purely related to the SVN export. I did notice that the geos project has transitioned from SVN to GIT (https://trac.osgeo.org/geos/wiki/CodeRepository). Has nobody else encountered this? How can we get our wonderful GEOSwift back under High Sierra? TIA!!!

    Installing geos (3.5.0)
    
    [!] Error installing geos
    [!] /usr/bin/svn export --non-interactive --trust-server-cert --force https://svn.osgeo.org/geos/tags/3.5.0 /var/folders/n2/5vdk92sj48qgnvyw00jx0q480000gn/T/d20180301-15895-1qd8777
    
    A    /var/folders/n2/5vdk92sj48qgnvyw00jx0q480000gn/T/d20180301-15895-1qd8777
    ...
    A    /var/folders/n2/5vdk92sj48qgnvyw00jx0q480000gn/T/d20180301-15895-1qd8777/include/geos/geom/MultiPolygon.h
    svn: E175013: Access to '/geos/!svn/rvr/4086/tags/3.5.0/include/geos/geom/GeometryCollection.h' forbidden
    svn: E200042: Additional errors:
    svn: E175013: Access to '/geos/!svn/rvr/4086/tags/3.5.0/include/geos/geom/Envelope.h' forbidden
    svn: E175013: Access to '/geos/!svn/rvr/4086/tags/3.5.0/include/geos/geom/GeometryFactory.h' forbidden
    svn: E175013: Access to '/geos/!svn/rvr/4086/tags/3.5.0/include/geos/geom/GeometryList.h' forbidden
    svn: E175013: Access to '/geos/!svn/rvr/4086/tags/3.5.0/include/geos/geom/util/ShortCircuitedGeometryVisitor.h' forbidden
    svn: E175013: Access to '/geos/!svn/rvr/4086/tags/3.5.0/include/geos/geom/util/PointExtracter.h' forbidden
    
    
    
    enhancement help wanted 
    opened by biomiker 60
  • Build failure on Xcode 10 after cocoa pods update

    Build failure on Xcode 10 after cocoa pods update

    I had this working under Xcode 10 by changing the build settings but after recently updating cocoa pods (and homebrew although I'm not sure if this is related) I'm now getting a "geos/platform.h file not found" error.

    I'm also seeing errors under GEOSwift about unresolved identifiers for GEOSGeom_createPoint_r, etc.

    I verified this is a problem starting with a new Xcode 10 project.

    When I switch the C++ Standard Library to libstdcc++ it says "vector file not found" instead.

    Not sure where to go from here. I've tried this on two difference machines.

    Thanks

    Using GEOSwift (3.0.1) Using geos (3.7.0)

    opened by joeuelk 37
  • Invalid Intersection result after upgrading to GeoSwift 7.0.0+

    Invalid Intersection result after upgrading to GeoSwift 7.0.0+

    I'm using GeoSwift for performing geospatial operations in a mobile app. Prior to v7.0.0, the intersection operation used to work as expected, however, after upgrading to v7.0.0 from 6.2.0, the same method returned a different result. Please find the attached geoJson files in the zip file for reproducing the error.

    Parent: polygon.json (polygon) LineString: multiLinestring.json (multiLineString)

    And here is the code I am using for the same

      do {
                 for lineString in multiLineString.lineStrings {
                    if try lineString.intersects(polygon) {
                        let intersectingGeometry = try lineString.intersection(with: polygon)
                        // Handle Intersection here
                    }
                } 
       } catch {
                DDLogError("Unable to get the intersection of line string with the geometry. \(error.localizedDescription)")
                return nil
            }
    
    

    Essentially I am getting a different result when I run the intersection operation on GeoSwift v6.2.0 (Expected) and GeoSwift v7.1.0 (Possibly Incorrect)

    Is there something else I need to do to find an intersection in the newer versions of GeoSwift? Thanks a lot for helping :)

    Here is the environment I am using Xcode : 12.2 GeoSwift: 7.1.0 GEOS: 5.1.0

    Apologies for not being able to find a simpler example to illustrate the problem 😅

    // Zip containing the geojson files TestData.zip

    opened by india2sarthak 30
  • Not able to load LineString in MapKit using GeoSwift

    Not able to load LineString in MapKit using GeoSwift

    I have installed GeoSwift successfully to my swift project. I have LineString.geojson.

    Its LineString. But, after parsing its not showing anything in maps.

    Following is my code.

     if let geoJSONURL = Bundle.main.url(forResource: "LineString", withExtension: "geojson") {
                do {
                    let geometries = try! Features.fromGeoJSON(geoJSONURL)
                    if let geo = geometries?[0] as? LineString {
                        if let shapesCollection = geo.mapShape() as? MKShapesCollection {
                            let shapes = shapesCollection.shapes
                            for shape in shapes {
                                if let polygon = shape as? MKPolyline {
                                    mapView.add(polygon)
                                }
                            }
                        }
                    }
                } catch {
                    print("Unable to load geojson data")
                }
            }
    

    After the following line, its not going inside, its executing outside of the function.

                if let geo = geometries?[0] as? LineString {
    

    Can anyone suggest me, how to show LineString in GeoSwift MapKit?

    opened by AnilkumarRabhasa 28
  • Cannot Install GEOSwift using spm or Carthage

    Cannot Install GEOSwift using spm or Carthage

    Environment

    Xcode: 11.3.1 Swift Version: 5.1.3 MacOS: macOS Catalina 10.15.3

    crash dyld: Library not loaded: @rpath/geos.framework/geos Referenced from: "/Users/...." Reason: image not found

    Please update your instructions.

    I also tried installing it using Carthage but it doesn't generate any .framework

    question 
    opened by denisatoderean 17
  • How to test if geometry is a Point?

    How to test if geometry is a Point?

    Thank you for all the work you have done upgrading the package, and the conversion guidelines at https://github.com/GEOSwift/GEOSwift/blob/master/VERSION_5.md are good.

    But how do I convert the following code? .. (Swift 5, Xcode 10.2)

                if geom is Waypoint {
                    let pt = geom as! Waypoint
    

    If I change the first line to ..

               if geom is Point {
    

    .. I get the compile error

    Cast from 'Geometry' to unrelated type 'Point' always fails
    
    question 
    opened by Tybion 17
  • Install issue

    Install issue

    Hi,

    I have a fresh install of Xcode. I change dependencies in Podfile I got the autoconf not found error then I install brew install autoconf automake libtool After relâche pod install, I got the following error (I tried pod update too):

    set -e
    type -P autoconf &>/dev/null || alias autoconf 'xcrun autoconf'
    type -P autoheader &>/dev/null || alias autoheader 'xcrun autoheader'
    type -P aclocal &>/dev/null || alias aclocal 'xcrun aclocal'
    type -P automake &>/dev/null || alias automake 'xcrun automake'
    type -P glibtool &>/dev/null || alias glibtool 'xcrun glibtool'
    type -P glibtoolize &>/dev/null || alias glibtoolize 'xcrun glibtoolize'
    
    sh autogen.sh
    ./configure
    ./tools/svn_repo_revision.sh
    
    sed -i "" "s/\/\* #undef HAVE_INT64_T_64 \*\//#define HAVE_INT64_T_64 1/" include/geos/platform.h
    sed -i "" "s/#define HAVE_LONG_INT_64 1/\/\* #undef HAVE_LONG_INT_64 \*\//" include/geos/platform.h
    
    cat <<EOT >> include/geos/platform.h
      #undef ISNAN
      #define ISNAN(x) (std::isnan(x))
    EOT
    
    patch capi/geos_c.h <<EOF
      149c149
      < #include <geos/export.h>
      ---
      > #define GEOS_DLL
    EOF
    
    * Running /usr/local/bin/glibtoolize (2.4.6)
       OPTIONS = --force --copy
    glibtoolize: putting auxiliary files in '.'.
    glibtoolize: copying file './ltmain.sh'
    glibtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'macros'.
    glibtoolize: copying file 'macros/libtool.m4'
    glibtoolize: copying file 'macros/ltoptions.m4'
    glibtoolize: copying file 'macros/ltsugar.m4'
    glibtoolize: copying file 'macros/ltversion.m4'
    glibtoolize: copying file 'macros/lt~obsolete.m4'
    * Running /usr/local/bin/aclocal (1.15.1)
    * Running /usr/local/bin/autoheader (2.69)
    * Running /usr/local/bin/automake (1.15.1)
       OPTIONS = --add-missing --copy -Woverride
    * Running /usr/local/bin/autoconf (2.69)
    ======================================
    Now you are ready to run './configure'
    ======================================
    checking build system type... x86_64-apple-darwin17.2.0
    checking host system type... x86_64-apple-darwin17.2.0
    checking target system type... x86_64-apple-darwin17.2.0
    checking for a BSD-compatible install... /usr/local/bin/ginstall -c
    checking whether build environment is sane... yes
    checking for a thread-safe mkdir -p... /usr/local/bin/gmkdir -p
    checking for gawk... no
    checking for mawk... no
    checking for nawk... no
    checking for awk... awk
    checking whether make sets $(MAKE)... yes
    checking whether make supports nested variables... yes
    checking whether to enable maintainer-specific portions of Makefiles... no
    checking for gcc... gcc
    checking whether the C compiler works... yes
    checking for C compiler default output file name... a.out
    checking for suffix of executables...
    checking whether we are cross compiling... no
    checking for suffix of object files... o
    checking whether we are using the GNU C compiler... yes
    checking whether gcc accepts -g... yes
    checking for gcc option to accept ISO C89... none needed
    checking whether gcc understands -c and -o together... yes
    checking for style of include used by make... GNU
    checking dependency style of gcc... gcc3
    checking how to print strings... printf
    checking for a sed that does not truncate output... /usr/local/bin/sed
    checking for grep that handles long lines and -e... /usr/bin/grep
    checking for egrep... /usr/bin/grep -E
    checking for fgrep... /usr/bin/grep -F
    checking for ld used by gcc... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld
    checking if the linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) is GNU ld... no
    checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
    checking the name lister (/usr/bin/nm -B) interface... BSD nm
    checking whether ln -s works... yes
    checking the maximum length of command line arguments... 196608
    checking how to convert x86_64-apple-darwin17.2.0 file names to x86_64-apple-darwin17.2.0 format... func_convert_file_noop
    checking how to convert x86_64-apple-darwin17.2.0 file names to toolchain format... func_convert_file_noop
    checking for /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld option to reload object files... -r
    checking for objdump... objdump
    checking how to recognize dependent libraries... pass_all
    checking for dlltool... dlltool
    checking how to associate runtime and link libraries... printf %s\n
    checking for ar... ar
    checking for archiver @FILE support... no
    checking for strip... strip
    checking for ranlib... ranlib
    checking command to parse /usr/bin/nm -B output from gcc object... ok
    checking for sysroot... no
    checking for a working dd... /bin/dd
    checking how to truncate binary pipes... /bin/dd bs=4096 count=1
    checking for mt... no
    checking if : is a manifest tool... no
    checking for dsymutil... dsymutil
    checking for nmedit... nmedit
    checking for lipo... lipo
    checking for otool... otool
    checking for otool64... no
    checking for -single_module linker flag... yes
    checking for -exported_symbols_list linker flag... yes
    checking for -force_load linker flag... yes
    checking how to run the C preprocessor... gcc -E
    checking for ANSI C header files... yes
    checking for sys/types.h... yes
    checking for sys/stat.h... yes
    checking for stdlib.h... yes
    checking for string.h... yes
    checking for memory.h... yes
    checking for strings.h... yes
    checking for inttypes.h... yes
    checking for stdint.h... yes
    checking for unistd.h... yes
    checking for dlfcn.h... yes
    checking for objdir... .libs
    checking if gcc supports -fno-rtti -fno-exceptions... yes
    checking for gcc option to produce PIC... -fno-common -DPIC
    checking if gcc PIC flag -fno-common -DPIC works... yes
    checking if gcc static flag -static works... no
    checking if gcc supports -c -o file.o... yes
    checking if gcc supports -c -o file.o... (cached) yes
    checking whether the gcc linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) supports shared libraries... yes
    checking dynamic linker characteristics... darwin17.2.0 dyld
    checking how to hardcode library paths into programs... immediate
    checking for dlopen in -ldl... yes
    checking whether a program can dlopen itself... yes
    checking whether a statically linked program can dlopen itself... yes
    checking whether stripping libraries is possible... yes
    checking if libtool supports shared libraries... yes
    checking whether to build shared libraries... yes
    checking whether to build static libraries... yes
    checking for g++... g++
    checking whether we are using the GNU C++ compiler... yes
    checking whether g++ accepts -g... yes
    checking dependency style of g++... gcc3
    checking how to run the C++ preprocessor... g++ -E
    checking for ld used by g++... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld
    checking if the linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) is GNU ld... no
    checking whether the g++ linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) supports shared libraries... yes
    checking for g++ option to produce PIC... -fno-common -DPIC
    checking if g++ PIC flag -fno-common -DPIC works... yes
    checking if g++ static flag -static works... no
    checking if g++ supports -c -o file.o... yes
    checking if g++ supports -c -o file.o... (cached) yes
    checking whether the g++ linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) supports shared libraries... yes
    checking dynamic linker characteristics... darwin17.2.0 dyld
    checking how to hardcode library paths into programs... immediate
    checking for library containing strerror... none required
    checking whether make sets $(MAKE)... (cached) yes
    checking for dirent.h that defines DIR... yes
    checking for library containing opendir... none required
    checking whether closedir returns void... no
    checking for working memcmp... yes
    checking for strftime... yes
    checking for vprintf... yes
    checking for _doprnt... no
    checking for size_t... yes
    checking for working alloca.h... yes
    checking for alloca... yes
    checking for dirent.h that defines DIR... (cached) yes
    checking for library containing opendir... (cached) none required
    checking for ANSI C header files... (cached) yes
    checking for memory.h... (cached) yes
    checking for unistd.h... (cached) yes
    checking ieeefp.h usability... no
    checking ieeefp.h presence... no
    checking for ieeefp.h... no
    checking sys/file.h usability... yes
    checking sys/file.h presence... yes
    checking for sys/file.h... yes
    checking sys/time.h usability... yes
    checking sys/time.h presence... yes
    checking for sys/time.h... yes
    checking for strchr... yes
    checking for memcpy... yes
    checking for gettimeofday... yes
    checking whether stat file-mode macros are broken... no
    checking whether struct tm is in sys/time.h or time.h... time.h
    checking for size_t... (cached) yes
    checking for an ANSI C-conforming const... yes
    checking if requested to force inline functions... yes
    checking if requested to enable assert macros... yes
    checking if requested libstdc++ debug mode... no
    checking if g++ supports -pedantic... yes
    checking if g++ supports -Wall... yes
    checking if g++ supports -ansi... yes
    checking if g++ supports -Wno-long-long... yes
    checking if g++ supports -ffloat-store... no
    checking for finite... yes
    checking for isfinite... yes
    checking for isnan... yes
    checking whether int64_t is 64 bits... no
    checking whether long long int is 64 bits... yes
    checking OS-specific settings... darwin17.2.0
    checking for OS/X version... Mac OS X (Darwin 17.2.0 kernel)
    checking that generated files are newer than configure... done
    configure: creating ./config.status
    config.status: creating Makefile
    config.status: creating capi/Makefile
    config.status: creating capi/geos_c.h
    config.status: creating doc/Doxyfile
    config.status: creating doc/Makefile
    config.status: creating macros/Makefile
    config.status: creating src/Makefile
    config.status: creating src/algorithm/Makefile
    config.status: creating src/algorithm/locate/Makefile
    config.status: creating src/algorithm/distance/Makefile
    config.status: creating src/geom/Makefile
    config.status: creating src/geom/prep/Makefile
    config.status: creating src/geom/util/Makefile
    config.status: creating src/geomgraph/Makefile
    config.status: creating src/geomgraph/index/Makefile
    config.status: creating include/Makefile
    config.status: creating include/geos/Makefile
    config.status: creating include/geos/algorithm/Makefile
    config.status: creating include/geos/algorithm/locate/Makefile
    config.status: creating include/geos/algorithm/distance/Makefile
    config.status: creating include/geos/geom/Makefile
    config.status: creating include/geos/geom/prep/Makefile
    config.status: creating include/geos/geom/util/Makefile
    config.status: creating include/geos/geomgraph/Makefile
    config.status: creating include/geos/geomgraph/index/Makefile
    config.status: creating include/geos/index/Makefile
    config.status: creating include/geos/index/bintree/Makefile
    config.status: creating include/geos/index/chain/Makefile
    config.status: creating include/geos/index/intervalrtree/Makefile
    config.status: creating include/geos/index/quadtree/Makefile
    config.status: creating include/geos/index/strtree/Makefile
    config.status: creating include/geos/index/sweepline/Makefile
    config.status: creating include/geos/io/Makefile
    config.status: creating include/geos/linearref/Makefile
    config.status: creating include/geos/noding/Makefile
    config.status: creating include/geos/noding/snapround/Makefile
    config.status: creating include/geos/operation/Makefile
    config.status: creating include/geos/operation/buffer/Makefile
    config.status: creating include/geos/operation/distance/Makefile
    config.status: creating include/geos/operation/intersection/Makefile
    config.status: creating include/geos/operation/linemerge/Makefile
    config.status: creating include/geos/operation/overlay/Makefile
    config.status: creating include/geos/operation/overlay/snap/Makefile
    config.status: creating include/geos/operation/polygonize/Makefile
    config.status: creating include/geos/operation/predicate/Makefile
    config.status: creating include/geos/operation/relate/Makefile
    config.status: creating include/geos/operation/sharedpaths/Makefile
    config.status: creating include/geos/operation/union/Makefile
    config.status: creating include/geos/operation/valid/Makefile
    config.status: creating include/geos/planargraph/Makefile
    config.status: creating include/geos/planargraph/algorithm/Makefile
    config.status: creating include/geos/precision/Makefile
    config.status: creating include/geos/simplify/Makefile
    config.status: creating include/geos/triangulate/Makefile
    config.status: creating include/geos/triangulate/quadedge/Makefile
    config.status: creating include/geos/util/Makefile
    config.status: creating include/geos/version.h
    config.status: creating src/index/Makefile
    config.status: creating src/index/bintree/Makefile
    config.status: creating src/index/chain/Makefile
    config.status: creating src/index/intervalrtree/Makefile
    config.status: creating src/index/quadtree/Makefile
    config.status: creating src/index/strtree/Makefile
    config.status: creating src/index/sweepline/Makefile
    config.status: creating src/io/Makefile
    config.status: creating src/linearref/Makefile
    config.status: creating src/noding/Makefile
    config.status: creating src/noding/snapround/Makefile
    config.status: creating src/operation/Makefile
    config.status: creating src/operation/buffer/Makefile
    config.status: creating src/operation/distance/Makefile
    config.status: creating src/operation/intersection/Makefile
    config.status: creating src/operation/linemerge/Makefile
    config.status: creating src/operation/overlay/Makefile
    config.status: creating src/operation/polygonize/Makefile
    config.status: creating src/operation/predicate/Makefile
    config.status: creating src/operation/relate/Makefile
    config.status: creating src/operation/sharedpaths/Makefile
    config.status: creating src/operation/union/Makefile
    config.status: creating src/operation/valid/Makefile
    config.status: creating src/planargraph/Makefile
    config.status: creating src/precision/Makefile
    config.status: creating src/simplify/Makefile
    config.status: creating src/triangulate/Makefile
    config.status: creating src/triangulate/quadedge/Makefile
    config.status: creating src/util/Makefile
    config.status: creating swig/geos.i
    config.status: creating swig/Makefile
    config.status: creating swig/python/Makefile
    config.status: creating swig/python/tests/Makefile
    config.status: creating swig/ruby/Makefile
    config.status: creating swig/ruby/test/Makefile
    config.status: creating php/Makefile
    config.status: creating php/test/Makefile
    config.status: creating tests/Makefile
    config.status: creating tests/bigtest/Makefile
    config.status: creating tests/unit/Makefile
    config.status: creating tests/perf/Makefile
    config.status: creating tests/perf/operation/Makefile
    config.status: creating tests/perf/operation/buffer/Makefile
    config.status: creating tests/perf/operation/predicate/Makefile
    config.status: creating tests/perf/capi/Makefile
    config.status: creating tests/xmltester/Makefile
    config.status: creating tests/geostest/Makefile
    config.status: creating tests/thread/Makefile
    config.status: creating tools/Makefile
    config.status: creating tools/geos-config
    config.status: creating include/config.h
    config.status: creating include/geos/platform.h
    config.status: executing depfiles commands
    config.status: executing libtool commands
    Swig: false
    Python bindings: false
    Ruby bindings: false
    PHP bindings: false
    #define GEOS_SVN_REVISION 0
    configure.ac:37: warning: AM_INIT_AUTOMAKE: two- and three-arguments forms are deprecated.  For more info, see:
    configure.ac:37: http://www.gnu.org/software/automake/manual/automake.html#Modernize-AM_005fINIT_005fAUTOMAKE-invocation
    configure.ac:40: installing './compile'
    configure.ac:9: installing './config.guess'
    configure.ac:9: installing './config.sub'
    configure.ac:37: installing './install-sh'
    configure.ac:37: installing './missing'
    capi/Makefile.am: installing './depcomp'
    parallel-tests: installing './test-driver'
    swig/python/Makefile.am:18: installing './py-compile'
    Can't fetch local revision (neither .svn nor .git found)
    Wrote rev '0' in file './geos_svn_revision.h'
    sed: can't read s/\/\* #undef HAVE_INT64_T_64 \*\//#define HAVE_INT64_T_64 1/: No such file or directory```
    
    opened by JiDai 15
  • pod geos error

    pod geos error

    the config.log below is:

    configure:3545: gcc -V >&5 clang: error: argument to '-V' is missing (expected 1 value) clang: error: no input files configure:3556: $? = 1 configure:3545: gcc -qversion >&5 clang: error: unknown argument: '-qversion' clang: error: no input files configure:3556: $? = 1 configure:3576: checking whether the C compiler works configure:3598: gcc /usr/local/opt/libxml2/include /usr/local/opt/libxml2/lib conftest.c >&5 ld: can't map file, errno=22 file '/usr/local/opt/libxml2/lib' for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

    opened by badmonkeyemail 14
  • Build using Carthage?

    Build using Carthage?

    Hi,

    This looks like fantastic work! I am trying to integrate into an app where I am using Carthage as my framework manager — it's a little more lightweight than CocoaPods. I am wondering if it is possible to configure this for Carthage...I tried installing it and there was some cryptic (to me) error which I have pasted below. Perhaps this just means that there needs to be a Cartfile in the project directory specifying dependencies (MapBox iOS SDK?). Might be...anyway, insight from other interested parties would be appreciated.

    Thanks, Daven

    *** Building scheme "GEOSwift" in GEOSwift.xcworkspace
    Build Failed
    	Task failed with exit code 65:
    	/usr/bin/xcrun xcodebuild -workspace "/Users/Daven/Development/Mapping App/Map-Digitizer/Carthage/Checkouts/GEOSwift/GEOSwift.xcworkspace" -scheme GEOSwift -configuration Release -derivedDataPath /Users/Daven/Library/Caches/org.carthage.CarthageKit/DerivedData/GEOSwift/f5a631fe99cdac1fd72fd680763b8cf952a9aed6 -sdk iphoneos ONLY_ACTIVE_ARCH=NO BITCODE_GENERATION_MODE=bitcode CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES clean build
    
    This usually indicates that project itself failed to compile. Please check the xcodebuild log for more details: /var/folders/md/lvb3zv4n5652ffl6t44397t80000gn/T/carthage-xcodebuild.l8D67B.log
    
    enhancement 
    opened by davenquinn 14
  • GeoSwift Crashes

    GeoSwift Crashes

    The following code snippet crashes in GeoSwift (tested in 2.1.0, 2.1.3, swift 3.2, swift 4.0):

    let jsonString = "{\"type\":\"MultiPolygon\",\"coordinates\":[[[[-78.926467895507812,36.051319575025502],[-78.852289148724822,36.033005280682119],[-78.791885375976562,35.996896453738117],[-78.734207153320312,35.951329861522673],[-78.640823364257812,35.927980690382697],[-78.481521606445312,35.885712278670248],[-78.452682495117188,35.74316846139925],[-78.50833730594735,35.68130132015127],[-78.613357543945312,35.670685013302347],[-78.714981079101562,35.684071533140973],[-78.804244995117188,35.679609609368583],[-78.874276302296835,35.693002873745471],[-78.911361694335938,35.736480443001462],[-78.931961059570312,35.823380847706538],[-79.003372192382812,35.931316708569028],[-78.988265991210938,36.022446681758488],[-78.926467895507812,36.051319575025502]]]]}"
    let jsonData = jsonString.data(using: .utf8)!
    let json = try! JSONSerialization.jsonObject(with: jsonData, options: [])
    
    guard let dictionary = json as? [String: AnyObject],
        let features = Geometry.fromGeoJSONDictionary(dictionary) else {
            fatalError()
    }
    
    let points = (features[0]
        .geometries![0]
        .boundary() as! GeometryCollection<LineString>)
        .geometries[0]
        .points
    

    The crash doesn't always happen in the same place. Happy to provide more info as needed.

    help wanted 
    opened by macdrevx 12
  • Can't merge user_target_xcconfig for pod targets: [

    Can't merge user_target_xcconfig for pod targets: ["SVGKit", "geos"].

    Hi, guys.

    In my project two libraries are very necessary - 'SVGKit', 'GeoSwift' (in addition to him goes 'geos').

    I have added to my podfile: pod 'GEOSwift' pod 'SVGKit', :git => 'https://github.com/SVGKit/SVGKit.git', :branch => '2.x'

    And run 'pod install'. But I receive a error.

    [!] Can't merge user_target_xcconfig for pod targets: ["SVGKit", "geos"]. Singular build setting CLANG_CXX_LIBRARY has different values.

    [!] Can't merge user_target_xcconfig for pod targets: ["SVGKit", "geos"]. Singular build setting CLANG_CXX_LIBRARY has different values.

    Why there is a error? What can I make? Help, please.

    I tried to lower the SVGKit version and then I have established them. But I have lost in functionality of SVGKit and I can't solve objectives with his help.

    opened by Belzik 12
  • Update to libgeos/geos 3.11.0

    Update to libgeos/geos 3.11.0

    Hi,

    Currently the latest version of GEOSwift is based on libgeos/geos 3.10.1 The new version of libgeos/geos 3.11 from July 1 2022 introducing ConcaveHull, which is very useful for many cases when ConvexHull is not sufficient.

    Is there any time estimates on when the new version might be released? That would be very helpful :)

    opened by vladislavitsi 0
  • Xcode Cloud: Unable to verify project that links GEOSwift using SPM

    Xcode Cloud: Unable to verify project that links GEOSwift using SPM

    Hi,

    Our project depends on GEOSwift (at commit ab813f1acbd92986e8733356b73b3f6d4ddc08e0 which should be the same as 9.0.0). We've shipped builds of our app using this dependency before, where the app was built using Fastlane.

    We're now trying to migrate some CI/CD jobs to Xcode Cloud, but are finding that we receive failures during the step Prepare Build for App Store Connect:

    ITMS-90334: Invalid Code Signature Identifier. The identifier "geos-<long identifier>" in your code signature for "geos" must match its Bundle Identifier "geos"

    Not entirely sure if this is an issue with GEOSwift/geos or Xcode Cloud, but https://github.com/simibac/ConfettiSwiftUI/issues/8 seems to indicate it's an issue with libraries that are forced to be dynamic. This appears to be the case for the geos dependency as well (see https://github.com/GEOSwift/geos/blob/main/Package.swift)

    opened by romnes 2
  • Command CompileSwiftSources failed with a nonzero exit code

    Command CompileSwiftSources failed with a nonzero exit code

    I'm trying to include this as a package in an iOS project (Or rather this PR : https://github.com/GEOSwift/GEOSwift/pull/228)

    But it won't build , I get errors like : ` ▸ Linking geos.o ▸ Processing empty-geos.plist ▸ Linking geos ❌ Undefined symbols for architecture x86_64

    Symbol: ___llvm_profile_runtime Referenced from: ___llvm_profile_runtime_user in geos.o ❌ ld: symbol(s) not found for architecture x86_64 ❌ clang: error: linker command failed with exit code 1 (use -v to see invocation)`

    opened by valentary 6
  • Infinite loop issue with queryNode function

    Infinite loop issue with queryNode function

    I'm able to reproduce this reliably right now, so I'm happy to follow any instructions to help debug this further. It seems that GEOSwift gets stuck in an infinite loop in an operation where I call try multiPolygonA.intersection(with: multiPolygonB). Here's what happens in Xcode:

    Screenshot 2021-12-12 at 17 44 38

    We get into that flow like so:

    Screenshot 2021-12-12 at 17 45 26

    And ultimately from this line:

    Screenshot 2021-12-12 at 17 45 57

    Let me know what would be helpful for me to provide, to further debug this.

    opened by ProjectDent 6
  • I want to analyze a WKT that contains 3D coordinates.

    I want to analyze a WKT that contains 3D coordinates.

    I want to be able to analyze WKT where Point Z with 3D information is used. However, I'm not familiar with Swift or its library extensions, and I'm not sure if this is the right way to do it. Could you please kindly help me?

    opened by sabitetsu 2
Releases(9.0.0)
Owner
GEOSwift
GEOSwift
Google Directions API helper for iOS, written in Swift

PXGoogleDirections Google Directions API SDK for iOS, entirely written in Swift. ?? Features Supports all features from the Google Directions API as o

Romain L 268 Aug 18, 2022
Aplicativo criado para estudos de desenvolvimento de Mapa e GPS usando Swift

Onde_estou_iOS Aplicativo criado para estudos de desenvolvimento de Mapa e GPS usando Swift, onde ele pede autorização para usar GPS e localização do

Jeff Araujo 0 Nov 14, 2021
A Swift package for parsing Clang module map files

Clangler is a Swift package used to parse Clang module map files into an abstract syntax tree (AST) representation. Once parsed, you can inspect or manipulate the nodes in the file, then generate and save a new file reflecting your changes.

Dalton Claybrook 9 Apr 7, 2022
Use Swift in the macOS command line to build maps.

Use Swift in the macOS command line to build maps. imagefrom A Swift command line utility that gets an image from a URL. Saves the web image as JPEG o

Rob Labs 0 Dec 30, 2021
A spatial analysis library written in Swift for native iOS, macOS, tvOS, watchOS, and Linux applications, ported from Turf.js.

Turf for Swift ?? ?? ?? ?? ⌚️ A spatial analysis library written in Swift for native iOS, macOS, tvOS, watchOS, and Linux applications, ported from Tu

Mapbox 175 Sep 20, 2022
GitHub Action for Swift with warning/error annotations.

GitHub Action for Swift This action executes Swift and generates github action annotations from swift warnings/errors. Usage An example to executing S

Jaehong Kang 2 Aug 18, 2022
Drawing and Geometry made easy on iOS - now in Swift 3.0

InkKit Swift Support Swift 4.0 InkKit is Swift 4.0 by default, so to use that just include InkKit in your podfile: pod 'InkKit' Swift 3.2 In order to

Shaps 372 Sep 9, 2022
Imagine Engine - a fast, high performance Swift 2D game engine for Apple's platforms

Welcome to Imagine Engine, an ongoing project that aims to create a fast, high performance Swift 2D game engine for Apple's platforms that is also a j

John Sundell 1.8k Sep 24, 2022
Palico Engine: Metal-Based Game Engine in Swift 🐑

Palico Engine: Metal-Based Game Engine in Swift ?? Implement a game engine on macOS using Metal API. Still in development. Currently I am working on a

Junhao Wang 18 Sep 19, 2022
The demo app demonstrates a real-time application using FindSurface to search point clouds, which ARKit provides, for geometry shapes.

FindSurface-GUIDemo-iOS (Swift) CurvSurf FindSurface™ GUIDemo for iOS (Swift) Overview This demo app demonstrates a real-time application using FindSu

CurvSurf 27 Aug 24, 2022
An example project showing how to extract and color anchor geometry in RealityKit

RealityKit - Extracting anchor geometry to create a custom Mesh An example project showing how to extract anchor geometry from ARMeshAnchor, create a

Travis Hall 8 Aug 16, 2022
A minimal iOS AR app that displays a wave animation using RealityKit2 Geometry Modifier

AR Simple Sea A minimal iOS AR app that displays a wave animation using RealityKit2 Geometry Modifier. Xcode 13.3 Target: iOS / iPadOS 15.0+ SwiftUI,

Yasuhito Nagatomo 14 Aug 5, 2022
Tiny http server engine written in Swift programming language.

What is Swifter? Tiny http server engine written in Swift programming language. Branches * stable - lands on CocoaPods and others. Supports the latest

null 3.6k Sep 27, 2022
High performance Swift treemap layout engine for iOS and macOS.

Synopsis YMTreeMap is a high performance treemap layout engine for iOS and macOS, written in Swift. The input to YMTreeMap is a list of arbitrary numb

Yahoo 113 Sep 14, 2022
XAnimatedImage is a performant animated GIF engine for iOS written in Swift based on FLAnimatedImage

XAnimatedImage is a performant animated GIF engine for iOS written in Swift based on FLAnimatedImage. An illustration is shown below: Features Plays m

Khaled Taha 561 Sep 9, 2022
Tiny http server engine written in Swift programming language.

What is Swifter? Tiny http server engine written in Swift programming language. Branches * stable - lands on CocoaPods and others. Supports the latest

null 3.6k Sep 18, 2022
A game engine built with SDL and Swift.

Lark A game engine made with Swift and SDL. This is a pre-alpha work-in-progress. Don't try to use this unless you really know what you're doing. I ba

June Bash 41 Mar 11, 2022
2D ECS game engine in 100% Swift + SwiftUI for iOS, macOS, tvOS

OctopusKit A 2D game engine based on ECS and written in 100% Swift for iOS, macOS and tvOS. If you've tried making a game in Swift while sticking to t

null 327 Aug 31, 2022
Camera engine for iOS, written in Swift, above AVFoundation. :monkey:

?? The most advanced Camera framework in Swift ?? CameraEngine is an iOS camera engine library that allows easy integration of special capture feature

Remi ROBERT 575 Aug 30, 2022
XAnimatedImage is a performant animated GIF engine for iOS written in Swift based on FLAnimatedImage

XAnimatedImage is a performant animated GIF engine for iOS written in Swift based on FLAnimatedImage. An illustration is shown below: Features Plays m

Khaled Taha 561 Sep 9, 2022