POST
|
#Setting Parameters for tool
inputLayer = arcpy.GetParameter(0) #Input layer
idField = arcpy.GetParameter(1) #Facility ID Field
i = arcpy.GetParameter(2) # Feature Class Code
grid = r"R:\GISPROJECTS\Dept_WaterUtilities\Tools\OceansideToolbar\Shapefiles\Grids.shp"
arcpy.MakeFeatureLayer_management(grid, 'grid_lyr')
grid_lyr = 'grid_lyr'
field_names = arcpy.UpdateCursor(grid_lyr)
cursor = arcpy.UpdateCursor(inputLayer)
for field in field_names:
C = field.getValue('COL')
R = field.getValue('ROW')
arcpy.AddMessage("Generating ID's...\n")
for row in cursor:
#Select by NULL attribute
selection = arcpy.SelectLayerByAttribute_management(inputLayer, 'NEW_SELECTION', '"FACILITYID" is NULL')
arcpy.MakeFeatureLayer_management(selection, 'selected_lyr')
selected_grid = arcpy.SelectLayerByLocation_management (grid_lyr, 'intersect', 'selected_lyr')
arcpy.MakeFeatureLayer_management(selected_grid, 'selected_grid')
ID = arcpy.GetCount_management(arcpy.SelectLayerByLocation_management (inputLayer, 'intersect', selected_grid)
FC = str(i).zfill(2)
Col = str(C).zfill(2)
Row = str(R).zfill(2)
Fno = str(ID).zfill(3)
Code = FC + Col + Row + Fno
row.setValue(idField, Code)
cursor.updateRow(row)
ID += 1
arcpy.Delete_management('grid_lyr')
arcpy.Delete_management('selected_lyr')
arcpy.Delete_management('selected_grid')
arcpy.AddMessage("\n\nFinished...")
arcpy.AddMessage("Last ID created: " + Code)
... View more
01-22-2018
04:48 PM
|
0
|
0
|
720
|
POST
|
Hi Dan, Could you look over my python script? I am having trouble for the continuation of the sequential order for a particular tile in the grid portion. I don't know what I should have for my "ID" variable. #Setting Parameters for tool inputLayer = arcpy.GetParameter(0) #Input layer idField = arcpy.GetParameter(1) #Facility ID Field i = arcpy.GetParameter(2) # Feature Class Code grid = r"R:\GISPROJECTS\Dept_WaterUtilities\Tools\OceansideToolbar\Shapefiles\Grids.shp" arcpy.MakeFeatureLayer_management(grid, 'grid_lyr') grid_lyr = 'grid_lyr' field_names = arcpy.UpdateCursor(grid_lyr) cursor = arcpy.UpdateCursor(inputLayer) arcpy.AddMessage("Generating ID's...\n") for row in cursor: #Select by NULL attribute arcpy.SelectLayerByAttribute_management(inputLayer, 'NEW_SELECTION', '"FACILITYID" is NULL') for field in field_names: C = field.getValue('COL') R = field.getValue('ROW') Fc = str(i).zfill(2) Col = str(C).zfill(2) Row = str(R).zfill(2) Fno = str(ID).zfill(3) Code = Fc + Col + Row + Fno row.setValue(idField, Code) cursor.updateRow(row) ID += 1 arcpy.Delete_management('grid_lyr') arcpy.AddMessage("\n\nFinished...") arcpy.AddMessage("Last ID created: " + Code)
... View more
01-22-2018
03:38 PM
|
0
|
2
|
720
|
POST
|
Great, thank you, I will look more into the fishnet. I think at that point it wont matter if its in order or not as long as its all within each cell.
... View more
01-17-2018
03:06 PM
|
0
|
1
|
720
|
POST
|
This is primarily used for manholes, but here is the basic schematic that my employers want. Example: The highlighted point is the tenth manhole (fc = 60) that was added in the 8th column (08) and the 22nd row (22) giving an ID by our standard of 600822010. There will be about a 35x35 grid. For how many times would be as many times new data is added. So far I just coded an ID generator without any new relationship to the grid.
... View more
01-17-2018
02:56 PM
|
0
|
4
|
720
|
POST
|
Would it be possible to create an ID generator with a grid system overlayed. For example, I have a point and I want the ID to be concatenated from the grid's row/column and a unique ID. For example if the point lands on grid the grid 30(column) and 23 (row) with it being the second point created in that box then the ID should look like this: 302302 being CCRRID. I am using 10.2.2 ArcMap.
... View more
01-17-2018
12:27 PM
|
0
|
9
|
953
|
POST
|
Hi Robert, I spoke with our IT staff, and they were saying that there arent anny HTTP filters being used. This is also hosted via GoDaddy. Would you think there is something else? Thank you!
... View more
01-05-2018
02:55 PM
|
0
|
1
|
582
|
POST
|
That's what I thought, but they arent that keen on GIS. Would you have an idea what I would be looking for in the configuration?
... View more
01-03-2018
12:10 PM
|
0
|
3
|
582
|
POST
|
Here is a screen shot. I hope this helps. Here is a link to the webpage. However, I am using the service from my County instead of the City's.Ideally I want to Search APNs using our Parcel Layer. Thank you for your help!
... View more
01-03-2018
11:04 AM
|
0
|
5
|
582
|
POST
|
I have applied other ArcServer's API's from different sources. Mainly from public agencies, and they all work besides for mine.
... View more
01-03-2018
10:13 AM
|
0
|
7
|
683
|
POST
|
Yes, that is why I did not put this in the CMV group. I think this is more of my organization's REST server, since I plugged in other REST servers's parcel data and they worked fine with the exact same code. I just do not know how to proceed within my organization/server setting.
... View more
09-13-2017
04:21 PM
|
0
|
1
|
574
|
POST
|
Am I missing something for my Search Widget? I am trying to customize the widget to search feature layers, but it only recognizes Integers and not String values. I believe my problem stems from my organization's configuration of its REST server. Any help is appreciated. I am running this in CMV 2.0.0beta2 define([ 'esri/tasks/locator', 'esri/dijit/Search', 'esri/layers/FeatureLayer', 'esri/InfoTemplate', 'dojo/has', 'dojo/domReady!' ], function (Locator, Search, FeatureLayer, InfoTemplate, has) { return { map: true, mapRightClickMenu: true, enableInfoWindow: true, enableButtonMode: has('mobile') ? false : true, expanded: true, enableSuggestions: true, allPlaceholder: 'Find an address or APN', sources: [{ placeholder: 'Find an address', locator: new Locator('http://gis.ci.oceanside.ca.us/gis/rest/services/AddressLocator_Composite2016/GeocodeServer'), singleLineFieldName: 'SingleLine', outFields: ['Loc_name'], name: 'Address Search', localSearchOptions: { minScale: 300000, distance: 50000 } }, { featureLayer: new FeatureLayer('http://gis.ci.oceanside.ca.us/gis/rest/services/WebService/Parcel/MapServer/0'), searchFields: ["APN"], name: "Assessor's Parcel Number", displayField: "APN", exactMatch: false, outFields: ["*"], placeholder: 'APN - ex 1470950400', maxResults: 6, maxSuggestions: 6, minCharacters: 0, infoTemplate: new InfoTemplate("Search result", "APN: ${APN}"), }] }; });
... View more
09-13-2017
02:02 PM
|
0
|
5
|
841
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|