Skip to content

Instantly share code, notes, and snippets.

@emilepetrone
Created October 11, 2011 17:42
Show Gist options
  • Save emilepetrone/1278810 to your computer and use it in GitHub Desktop.
Save emilepetrone/1278810 to your computer and use it in GitHub Desktop.
// get voting districts for an area
SGEnvelope *envelope = [SGEnvelope envelopeWithNorth:40.613952
west:-105.90271
south:39.078908
east:-103.513184];
[query setFilters:[NSArray arrayWithObject:SGContextFilterFeatures]];
[query setFeatureCategories:[NSArray arrayWithObjects:SGFeatureCategoryLegislativeDistrict,
SGFeatureCategorySchoolDistrict,
nil]];
[client getContextForQuery:query
callback:[SGCallback callbackWithSuccessBlock:
^(id response) {
// you've got feature polygons!
// to create an array of SGFeature objects:
NSArray *features = [NSArray arrayWithSGCollection:response
type:SGCollectionTypeFeatures];
} failureBlock:^(NSError *error) {
// handle failure
}]];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment