POST
|
Hi All, I've create AGSGDBFeatureServiceTable and AGSFeatureTableLayer from given url. Below is the code: AGSGDBFeatureServiceTable* fst = [[AGSGDBFeatureServiceTable alloc]initWithServiceURL:url credential:weakSelf.gdbTask.credential spatialReference:weakSelf.mapView.spatialReference]; AGSFeatureTableLayer* ftLayer = [[AGSFeatureTableLayer alloc]initWithFeatureTable:fst]; if([[fst.serviceURL absoluteString] isEqualToString:[[weakSelf.userInfo objectForKey:@"structureURL"] absoluteString]]) { [weakSelf.tiledLayer.mapView addMapLayer:ftLayer]; } I'm able to see feature layer on map. But when I'm trying to update any existing feature to AGSGDBFeatureServiceTable and commit my changes to arcgis server, I'm getting below error. 2015-10-23 19:19:15.572 TestApp[40839:325003] Error: Error Domain=NSCocoaErrorDomain Code=500 "Unable to complete operation." UserInfo=0x79a4a720 {NSURL=TestURL/0/applyEdits, responseJSON={ error = { code = 500; details = ( ); message = "Unable to complete operation."; }; }, NSLocalizedDescription=Unable to complete operation.} And when we tried to add new feature, we are able to add new feature and sync with arcgis server with AGSGDBFeatureServiceTable. Thanks in advance.
... View more
10-23-2015
07:20 AM
|
0
|
0
|
2260
|
POST
|
Hi All, I'm trying to load AGSFeatureLayer on map view. I'm able to show layer on map but its not showing Display Field which is there in feature layer. Below is my sample code. AGSFeatureLayer *fl = [AGSFeatureLayer featureServiceLayerWithURL:[weakSelf.userInfo objectForKey:@"structureURL"] mode:AGSFeatureLayerModeOnDemand]; NSLog(@"Display field: %@", fl.displayField); structureLayer = fl; [weakSelf.tiledLayer.mapView addMapLayer:fl]; I've tried to see Display field using NSLog but still it showing NULL. Anyone know how we can show it? Thank you in advance.
... View more
10-23-2015
03:45 AM
|
0
|
0
|
2850
|
POST
|
Hi All, From below method I'm able to get result but not able to access the object its crashing as it throwing uncaught exception. Please check below code. [self.structureFeatureTable queryResultCursorWithParameters:query completion:^(AGSGDBQueryResultCursor *cursor, NSError *error) { NSLog(@"%@",error); NSLog(@"%@",cursor); NSLog(@"%@",cursor.currentFeature); }]; While accessing cursor.currenttFeature getting below exception. libc++abi.dylib: terminating with uncaught exception of type Esri_runtimecore::Geodatabase::geodatabase_error: std::exception Can someone help me with this issue. Thanks and regards, Hrishikesh Pol.
... View more
08-18-2015
05:28 AM
|
0
|
0
|
234
|
POST
|
Hi All, I'm trying to find a particular record from AGSGDBFeatureTable. Below is my code. AGSQuery* query = [AGSQuery query]; query.whereClause = [NSString stringWithFormat:@"STR_ID = '%@'",self.currentStructure.strID]; [self.structureFeatureTable queryResultsWithParameters:query completion:^(NSArray *results, NSError *error) { NSLog(@"%@",results); }]; From code, I'm able to fetch properties of table. and query is also having right object. It giving me always empty array in result with error nil. Is something missing from my end. Please help me with this.
... View more
08-18-2015
04:36 AM
|
0
|
1
|
2432
|
POST
|
Hey How can we create geodatabase from multiple feature server's in iOSKristoffer, Thank you for your reply. It really help me to understand in more details. Thanks, Hrishikesh Pol.
... View more
06-30-2015
01:41 AM
|
0
|
0
|
663
|
POST
|
Hey Kristoffer, Thank you for your reply. Yes we can publish a new service which will have all services using by my application. But in future if any new service get added then in that case we have to publish the updated service. Correct me if my understanding is wrong. Or is there any other way to tackle this situation?
... View more
06-30-2015
01:25 AM
|
0
|
2
|
663
|
POST
|
Hi All, Currently I'm able to create geodatabase from single feature server and able to perform operations on it and able to sync back to arches server. But if we want to create single geodatabase from multiple server's how we can achieve that? Below is the code which I'm using to create single geodatabase. self.generateParameters = [[AGSGDBGenerateParameters alloc]initWithExtent:envelope layerIDs:@[@1,@3]]; self.generateParameters.syncModel = AGSGDBSyncModelPerLayer; AGSGDBLayerQuery *gdbQuery = [[AGSGDBLayerQuery alloc]init]; NSMutableArray *gdbQueries = [[NSMutableArray alloc]init]; gdbQuery.layerID = 2; NSArray *detectionArray = [ModelFacade listOfDetectionsForWorkOrder:self.currentWorkOrder.orderID]; self.allDetectionsList = [NSArray arrayWithArray:detectionArray]; NSMutableString *expressionString = [[NSMutableString alloc] initWithString:@"TREE_DETECTION_ID IN("]; for (Detection *detection in detectionArray) { [expressionString appendString:@"'"]; [expressionString appendString:stringForObject(detection.tID)]; [expressionString appendString:@"'"]; [expressionString appendString:@","]; } [expressionString deleteCharactersInRange:NSMakeRange([expressionString length]-1, 1)]; [expressionString appendString:@")"]; gdbQuery.whereClause = expressionString; [gdbQueries addObject:gdbQuery]; // self.generateParameters.outSpatialReference = self.mapView.spatialReference; self.generateParameters.queries = gdbQueries; //Create the geodatabase task self.geodatabaseTask = [[AGSGDBSyncTask alloc] initWithURL:[NSURL URLWithString:kFeatureServiceURL] credential:nil]; self.geodatabaseTask.loadCompletion = ^(NSError *error){ if (error) { dispatch_async(dispatch_get_main_queue(), ^{ [weakSelf.progressHUD hide:YES]; [weakSelf.navigationItem setHidesBackButton:NO animated:YES]; weakSelf.downloadButton.userInteractionEnabled = YES; }); NSLog(@"AGSGDBSyncTask failed to load!"); } else { NSString * geoDatabasePath = [NSString stringWithFormat:@"Library/Application Support/QuantamInspect/%@",workOrder.orderName]; NSString *geoDatabaseFilePath = [NSHomeDirectory() stringByAppendingPathComponent:geoDatabasePath]; if (![[NSFileManager defaultManager] fileExistsAtPath:geoDatabaseFilePath]) [[NSFileManager defaultManager] createDirectoryAtPath:geoDatabaseFilePath withIntermediateDirectories:NO attributes:nil error:&error]; //Generate the geodatabase (with parameters) weakSelf.geodatabaseJob = [weakSelf.geodatabaseTask generateGeodatabaseWithParameters:weakSelf.generateParameters downloadFolderPath:geoDatabaseFilePath useExisting:NO //Status block - provides feedback form the asynchronous job status:^(AGSResumableTaskJobStatus status, NSDictionary *userInfo){ NSNumber* totalBytesDownloaded = userInfo[@"AGSDownloadProgressTotalBytesDownloaded"]; NSNumber* totalBytesExpected = userInfo[@"AGSDownloadProgressTotalBytesExpected"]; if(totalBytesDownloaded!=nil && totalBytesExpected!=nil){ double dPercentage = (double)([totalBytesDownloaded doubleValue]/[totalBytesExpected doubleValue]); weakSelf.progressHUD.detailsLabelText = [NSString stringWithFormat:@"%.0f %@",dPercentage*100, @"%"]; } } //Completion block - executes when the job has completed. //This code creates a AGSFeatureTableLayer from the first table in the //returned geodatabase. completion:^(AGSGDBGeodatabase *geodatabase, NSError *error){ } ]; } }; self.geodatabaseTask = [[AGSGDBSyncTask alloc] initWithURL:[NSURL URLWithString:kFeatureServiceURL] credential:nil]; By this we are providing server url. Please see enclose list of server. From that I want to create geodatabse using 2-3 server's. Please let me know if anyone has any solution or question on this. Thanks
... View more
06-30-2015
12:34 AM
|
0
|
4
|
3554
|
POST
|
Hey, I'm trying to add features to feature layer. But unable add it. Below is my code. Can you help me to do this please? in viewDidLoad self.featureLayer1.queryDelegate = self; self.queryTask = [[AGSQueryTask alloc] initWithURL:self.featureLayer1.URL]; self.queryTask.delegate = self; self.query = [AGSQuery query]; User *user = [ModelFacade currentUserInContext:[ModelFacade currentContext]]; self.query.whereClause = [NSString stringWithFormat:@"UserID='{%@}'", user.userID]; self.query.geometry = envelope; [self.queryTask executeWithQuery:self.query] ; #delegate method. - (void)queryTask:(AGSQueryTask *)queryTask operation:(NSOperation*)op didExecuteWithFeatureSetResult:(AGSFeatureSet *)featureSet { NSInteger index; for (index = 0; index <featureSet.features.count; index++) { AGSSimpleFillSymbol * fillSym = [AGSSimpleFillSymbol simpleFillSymbol]; fillSym.style = AGSSimpleFillSymbolStyleSolid; fillSym.color = [UIColor blackColor]; AGSGraphic * graphic = [featureSet.features objectAtIndex: index]; graphic.symbol = fillSym; [self.featureLayer1 addFeatures:@[graphic]]; } [self.featureLayer1 refresh]; NSLog(featureSet.features); Able to get all records in log but not on map view. Can you please help me with this. }
... View more
02-02-2015
02:01 AM
|
0
|
1
|
244
|
POST
|
Hi Nimesh, I have created property for feature layer and I'm trying to add feature from query result. But unable to do that.....delegate methods are not getting called. Below is my code. Will you please help me with this. - (void)queryTask:(AGSQueryTask *)queryTask operation:(NSOperation*)op didExecuteWithFeatureSetResult:(AGSFeatureSet *)featureSet { NSInteger index; for (index = 0; index <featureSet.features.count; index++) { AGSSimpleFillSymbol * fillSym = [AGSSimpleFillSymbol simpleFillSymbol]; fillSym.style = AGSSimpleFillSymbolStyleSolid; fillSym.color = [UIColor orangeColor]; AGSGraphic * graphic = [featureSet.features objectAtIndex: index]; graphic.symbol = fillSym; [self.featureLayer1 addFeatures:@[graphic]]; } [self.featureLayer1 refresh]; }
... View more
02-02-2015
01:24 AM
|
0
|
0
|
313
|
POST
|
Hi Nimesh, Not able to get didLoadLayerForLayerView: this method. Will you please help me with this.
... View more
01-29-2015
05:50 AM
|
0
|
0
|
244
|
POST
|
Hey Nimesh, I have created instance variable for AGSFeatureLayer but still facing some issues. Below is the code from which I'm uploading 3 feature layers on basemap. I'm able to load it but it is not consistent. Please let me know if I'm making some mistake. Thank you in advance. // Add basemap. NSURL* url = [NSURL URLWithString: @"http://services.arcgisonline.com/arcgis/rest/services/World_Topo_map/mapserver"]; AGSTiledMapServiceLayer* layer = [AGSTiledMapServiceLayer tiledMapServiceLayerWithURL: url]; layer.delegate = self; [self.mapView addMapLayer:layer withName:@"Streets"]; //zoom to an area AGSEnvelope *envelope = [AGSEnvelope envelopeWithXmin:-1.34732920649E7 ymin:4533851.309500001 xmax:-1.3431785844E7 ymax:4641521.468800001 spatialReference:self.mapView.spatialReference]; [self.mapView zoomToEnvelope:envelope animated:NO]; // Structures. NSString *urlString = [self.currentWorkOrder.detectionURL substringToIndex:[self.currentWorkOrder.detectionURL length]-1]; self.featureLayerURL0 = [NSURL URLWithString:[NSString stringWithFormat:@"%@0",urlString]]; self.featureLayer0 = [AGSFeatureLayer featureServiceLayerWithURL:self.featureLayerURL0 mode:AGSFeatureLayerModeOnDemand]; self.featureLayer0.delegate = self; [self.mapView addMapLayer:self.featureLayer0 withName:@"CloudData0"]; // Alignment. self.featureLayerURL = [NSURL URLWithString:[NSString stringWithFormat:@"%@1",urlString]]; self.featureLayer = [AGSFeatureLayer featureServiceLayerWithURL:self.featureLayerURL mode:AGSFeatureLayerModeOnDemand]; self.featureLayer.delegate = self; [self.mapView addMapLayer:self.featureLayer withName:@"CloudData"]; // Detections. self.featureLayerURL1 = [NSURL URLWithString:[NSString stringWithFormat:@"%@2",urlString]]; self.featureLayer1 = [AGSFeatureLayer featureServiceLayerWithURL:self.featureLayerURL1 mode:AGSFeatureLayerModeOnDemand]; self.featureLayer1.delegate = self; PO(self.featureLayer1.fields); [self.mapView addMapLayer:self.featureLayer1 withName:@"CloudData1"]; self.featureLayer1.queryDelegate = self; AGSQuery *query = [AGSQuery query]; //no "where" clause because I want all the records query.outFields = [NSArray arrayWithObjects:@"Detection", @"Health", @"Circuit", nil]; [self.featureLayer1 selectFeaturesWithQuery:query selectionMethod:AGSFeatureLayerSelectionMethodNew]; [self.mapView.locationDisplay startDataSource];
... View more
01-29-2015
05:37 AM
|
0
|
0
|
207
|
POST
|
Hi All, I'm working on project which is related to ARCGIS server on iPad. So in my application I'm trying to load 3 feature layers on basemap. I'm able to do that. But problem is like not overtime it get loaded and second thing is how can I get more information about feature layer which has data in it. Below is the code which I used to show layers on map. // Add basemap. NSURL* url = [NSURL URLWithString: @"http://services.arcgisonline.com/arcgis/rest/services/World_Topo_map/mapserver"]; AGSTiledMapServiceLayer* layer = [AGSTiledMapServiceLayer tiledMapServiceLayerWithURL: url]; layer.delegate = self; [self.mapView addMapLayer:layer withName:@"Streets"]; //zoom to an area AGSEnvelope *envelope = [AGSEnvelope envelopeWithXmin:-1.34732920649E7 ymin:4533851.309500001 xmax:-1.3431785844E7 ymax:4641521.468800001 spatialReference:self.mapView.spatialReference]; [self.mapView zoomToEnvelope:envelope animated:NO]; // Structures. NSString *urlString = [self.currentWorkOrder.detectionURL substringToIndex:[self.currentWorkOrder.detectionURL length]-1]; self.featureLayerURL0 = [NSURL URLWithString:[NSString stringWithFormat:@"%@0",urlString]]; self.featureLayer0 = [AGSFeatureLayer featureServiceLayerWithURL:self.featureLayerURL0 mode:AGSFeatureLayerModeOnDemand]; self.featureLayer0.delegate = self; [self.mapView addMapLayer:self.featureLayer0 withName:@"CloudData0"]; // Alignment. self.featureLayerURL = [NSURL URLWithString:[NSString stringWithFormat:@"%@1",urlString]]; self.featureLayer = [AGSFeatureLayer featureServiceLayerWithURL:self.featureLayerURL mode:AGSFeatureLayerModeOnDemand]; self.featureLayer.delegate = self; [self.mapView addMapLayer:self.featureLayer withName:@"CloudData"]; // Detections. self.featureLayerURL1 = [NSURL URLWithString:[NSString stringWithFormat:@"%@2",urlString]]; self.featureLayer1 = [AGSFeatureLayer featureServiceLayerWithURL:self.featureLayerURL1 mode:AGSFeatureLayerModeOnDemand]; self.featureLayer1.delegate = self; PO(self.featureLayer1.fields); [self.mapView addMapLayer:self.featureLayer1 withName:@"CloudData1"]; If anyone has any idea. Please help me out. Thanks in advance.
... View more
01-29-2015
04:18 AM
|
0
|
1
|
3924
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|