goccy / iroonga

Groonga for iOS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

HOW TO INSTALL

this library supports cocoapods.

(1) Write the following line to Podfile

pod 'Iroonga', :git => 'https://github.com/goccy/iroonga.git'

(2) Install by pod install command

$ pod install

HOW TO USE

IroongaLocationDatabase *db = [IroongaLocationDatabase createWithName:@"example"];
IroongaLocationTable *table = [db tableWithName:@"Examples" indexColumnName:@"landmark"];
if (!([db isAlreadyCreated] && [table existsTable])) {
  [db drop];
  db    = [IroongaLocationDatabase createWithName:@"example"];
  table = [db createTableWithName:@"Examples"];
  [table createColumnWithName:@"location" withColumnType:IroongaColumnTypeCompressZlib type:IroongaTableKeyTypeWGS84GeoPoint source:@""];
  [table createLocationIndexColumnWithName:@"location" withTargetColumnName:@"landmark"];
  NSString *filePath = [NSString stringWithFormat:@"%@/groonga_data_dump_file.grn", [[NSBundle mainBundle] resourcePath]];
  [table loadDataFromJSONFile:filePath];
}
CLLocationCoordinate2D topLeftPoint     = ...;
CLLocationCoordinate2D bottomRightPoint = ...;
NSArray *landmarks = [table findWithTopLeftPoint:topLeftPoint withBottomRightPoint:bottomRightPoint];
for (NSDictionary *landmark in landmarks) {
    // access to landmark object and get parameter
}

About

Groonga for iOS


Languages

Language:C 94.5%Language:C++ 3.8%Language:Ruby 1.1%Language:Objective-C 0.5%Language:CMake 0.1%