POST
|
Python is going to be your best friend for this kind of stuff. You have all the pieces that you need in order to calculate the new Location. And it will be far easier to create 200 new points than edit and move 200. Think of your initial points as your input. import arcpy import math #r tells python this is a literal string, ignore escape squeunces like \n for newline fc = r'Path to your feature class' newFc = r'Path to your new feature class' #the columns in your source table or feature class feilds = ['x', 'y', 'distance','bearing'] outFeilds = ['SHAPE@','x', 'y', 'distance','bearing'] sCursor = arcpy.da.SearchCursor = (fc,feilds) for row in sCursor: inputX = row[0] inputY = row[1] distance = row[2] bearing = row[3] #make sure you convert your bearing to Radians: bearing = radians(bearing) newX = inputX + distance * math.cos(bearing) newY = inputY + distance * math.sin(bearing) point = arcpy.point(newX,newY) #Insert the new point into the new FeatureClass iCursor = arcpy.da.InsertCursor(newFC,outFeilds ) temp = [point,newX,newY,distance,bearing] iCursor.insertRow(temp) del iCursor del sCursor Use Arcpy Data Access Module to create a Search Cursor and then a for loop to iterate through each record. output can be made by creating an Insert Cursor to a new feature class. It may take just as long to do it this way the first time, but you will have a new skill that can be utilized many times over, and quicker. Work hard to be lazy. That's it. Problem solved in less than 50 lines of code. Most of that is new lines. Should take about 15 seconds to process. Thanks, Jeff
... View more
12-22-2015
12:11 PM
|
2
|
1
|
5421
|
POST
|
Thanks for the quick reply. The Land grid is made up of polygons. I had not thought about selecting the feature to obtain its extent. Thanks for the idea!
... View more
05-02-2013
10:11 AM
|
0
|
0
|
384
|
POST
|
I am working on a python Add-in and in order to have the proper output I need to be able to snap to the corner point of a land grid. I have not been able to find any functions within arcpy that allows for this to happen. I need the same functionality found on the snapping toolbar in order to get the precise X,Y Coordinates as input into my python script. Has anyone tried this before or is anyone aware of this functionality within arcpy? Thanks,
... View more
05-02-2013
09:40 AM
|
0
|
4
|
559
|
POST
|
If I understand correctly you want to take one field "A" and create 4 new fields by splitting the contents of "A" based on the "^" symbol? if this is a correct assumption you could do this individually with the following code: PreLogic Code Block in Python: def s(a): x = a.split('^') y = x[0] return y B = s(!A!) This creates a function called s(). (a) represents the field that I pass. x = a.split('^') creates a list. y = x[0] assigns the the first value in the list to y. in your case it would be "PT COM 790 W INTER W LINE". B= s(!A!) is the original field being pased to the function s() in your next field you would change y = x[0] to y = x[1] I think that this would be easier to automate if you created a stand alone script that accessed your fields by search Cursor, then depending on the length of your list assign it to the appropriate field using an update cursor. Hope this point you in the right direction. I have attached a photo of my field calculator with the code above.
... View more
04-02-2013
01:05 PM
|
0
|
0
|
3600
|
POST
|
Is there a Geoprocessing tool that can be used within Model Builder, or within a Python Script? I am aware of how to acomplish this within ArcMap, but I am working on automating selected related records from one table to another. Thanks, Jeff
... View more
01-23-2013
04:55 AM
|
0
|
1
|
294
|
POST
|
I have followed all of the steps to set up a new project in xCode with the new iOS SDK, but receive and error that states: clang: error: no such file or directory: 'ArcGIS' Any ideas on what is preventing xCode from seening the other Linker flag "ArcGIS" I found that by re-aranging the other linker flags order solved my problem. -all_load -ObjC -framework ArcGIS After moving the order the error subsided.
... View more
04-04-2012
08:17 AM
|
0
|
0
|
265
|
POST
|
I have followed all of the steps to set up a new project in xCode with the new iOS SDK, but receive and error that states: clang: error: no such file or directory: 'ArcGIS' Any ideas on what is preventing xCode from seening the other Linker flag "ArcGIS"
... View more
04-04-2012
08:07 AM
|
0
|
2
|
1059
|
POST
|
instead of an array you should start with poplating your JSON String into a Dictionary. Then retrieve the Key Value pair that you need. Define a few Arrays in your .h NSArray *_layerArray; NSArray *_keys; NSArray *_name; and in my .m in viewDidLoad //Define your Service NSURL *_serviceURL = [NSURL URLWithString:@"http://"YourService"=json&pretty=true"]; //Create a string to read into your Dictionary NSString *_layerNames = [[NSString alloc] initWithContentsOfURL:_serviceURL encoding:NSASCIIStringEncoding error:NULL]; //Create a Dictionary for your jsonValues NSMutableDictionary* jSonDict = [_layerNames AGSJSONValue]; //Create an array for a specific Key Value Pair Layers are the array in the JSON String that I want to get. _keys = [jSonDict valueForKey:@"layers"]; //NSLog(@"Dictionary %@",_keys); //Create an Array from your Array of Keys to get ther Values, Name is the key for the Value that I want. _name = [[_keys valueForKey:@"name"] copy]; Hope this helps you out.
... View more
03-28-2012
07:36 AM
|
0
|
0
|
175
|
POST
|
found that if I copy the array my project does not crash. _name = [[_keys valueForKey:@"name"] copy]; Jeff
... View more
07-07-2011
07:14 AM
|
0
|
0
|
199
|
POST
|
See this thread I started. It may do what you need. http://forums.arcgis.com/threads/33344-Dynamic-Populating-list-of-available-Layers This should return a dictionary of array's and then you can populate your array based on the key in the dictionary. Jeff
... View more
07-07-2011
07:12 AM
|
0
|
0
|
271
|
POST
|
Add another wrinkle... I have half got this figured out. I have gone down the json route and am able to pull out the information that I need dynamically to populate a list. to do this I created a dictionary and read in the values from my rest service: - (void)viewDidLoad NSURL *_serviceURL = [NSURL URLWithString:@"yourWebServerAddress=json&pretty=true "]; NSString *_layerNames = [[NSString alloc] initWithContentsOfURL:_serviceURL encoding:NSASCIIStringEncoding error:NULL]; //Pick my dictionary from the rest service NSMutableDictionary* jSonDict = [_layerNames JSONValue]; _keys = [jSonDict valueForKey:@"layers"]; //_keys is an array that I have defined in the header. //get my array that I am interested in: _name = [_keys valueForKey:@"name"]; //_name is an array that I have defined in the header. //print the array to make sure it works NSLog(@"_name %@",_name); } - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { return 1; } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return [_name count]; } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease]; } //set up my tableview to populate the list. [[cell textLabel] setText:[_name objectAtIndex:indexPath.row]]; // Configure the cell. return cell; } My only issue now is that get a sigbart error when I scroll the list. hope this helps anyone else curious about dynamic lists. Will post if I find the issue with sigbart. jeff
... View more
06-29-2011
10:39 AM
|
0
|
0
|
199
|
POST
|
Hi All, I have created applications in the past by hard coding an NSArray of available layers that my company currently serves in our MapServices, but the services are constantly changing and layers are added or removed constantly within the map service. I have looked at trying to access the mapLayers function to return an array of available layers in the service but have not had any luck. So in Summary I am looking to: Create Dynamic List of Layers to display in a UITableView I am not sure if JSON is the correct route, or if there is an alternative. Any suggestions or hints on the direction to follow would be appreciated. Thanks, Jeff
... View more
06-23-2011
06:16 AM
|
0
|
3
|
299
|
POST
|
I have found that it is easier to start with the apple template and then add dependencies for ArcGIS for iOS. I went through this exercise of trying to use the ESRI template and enable AutoRotate without any success. I ended up comparing the apple template and ESRI template against eachother, and even after mimicking the apple template I was not able to produce the results that I needed (AutoRotate). It was much easier and less frustrating to just build it using the apple template as a starting point. ESRI has a very good help section on adding dependencies to your project to allow for the use of ArcGIS for iOS SDK.
... View more
06-01-2011
09:05 AM
|
0
|
0
|
396
|
POST
|
Thanks Mark, I will give it a try this week. Glad to know that you haven't had any issues other than performance.
... View more
03-15-2011
06:44 AM
|
0
|
0
|
207
|
POST
|
Has anyone tried using Xcode 4 with the ArcGIS for iOS API? I am hesitant to update to the newest version. Any volunteers?
... View more
03-14-2011
02:56 PM
|
0
|
3
|
682
|
Title | Kudos | Posted |
---|---|---|
2 | 12-22-2015 12:11 PM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|