Giter Site home page Giter Site logo

smartiushev / shapekit Goto Github PK

View Code? Open in Web Editor NEW

This project forked from andreacremaschi/shapekit

0.0 0.0 0.0 558 KB

iOS Geometry Library

License: GNU Lesser General Public License v2.1

Shell 8.11% Ruby 0.33% Objective-C 60.27% Objective-C++ 31.30%

shapekit's Introduction

Note: this project will be discontinued soon.
If you are planning to build a new project using Swift, please consider GEOSwift.

ShapeKit

ShapeKit is a iOS/OSX library that offers an Objective-C interface to the powerful GEOS library. Through GEOS, ShapeKit includes all the OpenGIS Simple Features for SQL spatial predicate functions and spatial operators, as well as specific JTS enhanced topology functions. This fork is based on the original repository by Michael Weisman, with major customizations.

  • ShapeKit has been refactored to build in a static library (libShapeKit.a)
  • Apple's MapKit specific methods have been refactored in a dedicated category to generalize the code and remove Apple's MapKit dependency. ShapeKit just takes care of the model, so that you can choose the map library you prefer (Apple's MapKit, route-me in the original flavour or in Alpstein or Mapbox forks ecc..)
  • GEOS linearref functions (project and interpolate on a line) support was added

Usage

  • ShapeKitGeometries are standard cocoa objects
ShapeKitPoint *myPoint = [[ShapeKitPoint alloc] initWithCoordinate:CLLocationCoordinate2DMake(0, 0)];
  • ShapeKit has spatial predicates and topology operations
ShapeKitPolygon *bufferedPoint = [myPoint bufferWithWidth:0.005]
[bufferedPoint containsGeometry:myPoint]; // Returns YES
  • ShapeKit has support for linear projection and interpolation
ShapeKitPoint *middlePoint = [myLine interpolatePointAtNormalizedDistance: 0.5];
double projectedPosition = [myLine distanceFromOriginToProjectionOfPoint: myPoint];

Project setup

CocoaPods

The easy way is using CocoaPods: since mingling with ShapeKit's dependencies is not that easy, you are strongly encouraged to get this path.

But before you must install the GNU build system if you haven't already:

brew install automake autoconf libtool

Now you can create your Podfile as usual:

platform :ios, '5.0'
pod 'ShapeKit'

and execute pod install

Now an extra step is required: ShapeKit resides on C++ libraries and we should tell the compiler that our project files should be treated as Objective-C++. Just rename your main file main.m to main.mm and the trick is done.

Now you should be able to use Shapekit in your project, just #import <ShapeKit/ShapeKit.h> in your .m files

License

This is free software; you can redistribute and/or modify it under the terms of the GNU Lesser General Public Licence as published by the Free Software Foundation. See the COPYING file for more information.

License note: Be aware that LGPL v2.1 (GEOS license) and Apple Store compatibility is at least controversial (search for "LGPL iOS" on Google to know why).

shapekit's People

Contributors

andreacremaschi avatar giladgo avatar grgcombs avatar mweisman avatar scspijker avatar snorf avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.