andreacremaschi / shapekit Goto Github PK
View Code? Open in Web Editor NEWThis project forked from mweisman/shapekit
iOS Geometry Library
License: GNU Lesser General Public License v2.1
This project forked from mweisman/shapekit
iOS Geometry Library
License: GNU Lesser General Public License v2.1
Heya!
Could you please tag and update the podspec? The changes that you pulled from me are actually not in the podspec yet, so when I updated I lost my changes xD
Thanks!
XCode 5 dropped support for llvm-gcc, so the default compiler now is LLVM 5, and it seems to have some issues with geos: WKB geometry types are correctly identified, but when it comes to read coordinate values ( Geometry * WKBReader::readGeometry()::285
) return values are incorrect.
This is a major issue since everything depends on geos..
I wrote this category for my self to use ShapeKitPolygon with MKMapView. However, I can't include it in the ShapeKit code (because that would make it dependent on the MapKit framework).
Can I put it somewhere? In the wiki, the readme, or maybe in a separate readme ("Using with MKMapView.md")?
Cheers
#import <Foundation/Foundation.h>
#import <ShapeKit.h>
@interface ShapeKitPolygon (MKPolygon)
- (MKPolygon*) MKPolygon;
@end
@implementation ShapeKitPolygon (MKPolygon)
// Recursive function
- (MKPolygon*) MKPolygon
{
// Copies only the exterior ring!
int numberOfCoordinates = [self numberOfCoords];
CLLocationCoordinate2D coordinates[numberOfCoordinates];
for (int i = 0; i < numberOfCoordinates; i++)
{
coordinates[i] = [self coordinateAtIndex: i];
}
// Copy the interior rings
NSMutableArray *interiorMKPolys = [NSMutableArray array];
for (ShapeKitPolygon *poly in self.interiors)
{
[interiorMKPolys addObject: [poly MKPolygon]];
}
return [MKPolygon polygonWithCoordinates:coordinates count:numberOfCoordinates interiorPolygons:interiorMKPolys];
}
@end
ShapeKitGeometry exposes GeomType, but no constants to compare against.
Inside the ShapeKitFactory:55 (classForGeometry:) it uses not a GeomType but the GeomTypeId, maybe it is an idea to expose the GeomTypeId, and the corresponding enum GEOSGeomTypes in geos_c.h:122 ?
What would be the best way to expose the type of a Geometry, and also expose constants to compare against? I can implement this and make a pull request if you want.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.