|
POST
|
You can create an XY Event Layer from the excel table using the Make XY Event Layer tool. You can then Append the output from this tool to the SLEEVES feature class.
... View more
02-19-2014
03:21 AM
|
0
|
0
|
1523
|
|
POST
|
1. You can add an 'else' statement with an alert message if the matching candidate is not greater than 80. Ex: if (candidate.score > 80) {
console.log(candidate.score);
var attributes = {
address: candidate.address,
score: candidate.score,
locatorName: candidate.attributes.Loc_name
};
geom = candidate.location;
var graphic = new Graphic(geom, symbol, attributes, infoTemplate);
//add a graphic to the map at the geocoded location
map.graphics.add(graphic);
//add a text symbol to the map listing the location of the matched address.
var displayText = candidate.address;
var font = new Font(
"16pt",
Font.STYLE_NORMAL,
Font.VARIANT_NORMAL,
Font.WEIGHT_BOLD,
"Helvetica"
);
var textSymbol = new TextSymbol(
displayText,
font,
new Color("#666633")
);
textSymbol.setOffset(0,8);
map.graphics.add(new Graphic(geom, textSymbol));
return false; //break out of loop after one candidate with score greater than 80 is found.
}
else{
alert("No results found, please enter another address");
}
}); 2. Add 'autofocus' property to the input tag. Ex: <input type="text" id="address" value="380 New York St, Redlands" size="30" autofocus="autofocus"/>
... View more
02-14-2014
07:22 AM
|
0
|
0
|
2729
|
|
POST
|
Hi Neil, Looks like you are trying to iterate through the shape field, which won't be possible, unless you are working with a multipoint feature class: for pnt in row[1]:
print("{0}, {1}".format(pnt.X, pnt.Y)) However, you can return the XY coordinates a couple ways: for row in arcpy.da.SearchCursor(infc, ["OID@", "SHAPE@"]):
print("Feature {0}:".format(row[0]))
print row[1].centroid.X, row[1].centroid.Y or: for row in arcpy.da.SearchCursor(infc, ["OID@", "SHAPE@XY"]):
print("Feature {0}:".format(row[0]))
print row[1]
... View more
02-13-2014
11:21 AM
|
0
|
0
|
1964
|
|
POST
|
You can use the datatype property of the Describe function to do this. Ex: desc = arcpy.Describe(fc)
print desc.datatype
... View more
02-13-2014
04:13 AM
|
0
|
0
|
822
|
|
POST
|
Right-click on your SQL Server Express database > Save Connection. This will save it as an SDE connection file under "Database Connections". Then set your workspace to this .sde connection file. Ex: workspace = r"Database Connections\<connection name>.sde" Do you still receive the error?
... View more
02-13-2014
02:33 AM
|
0
|
0
|
1390
|
|
POST
|
Try the following: with arcpy.da.SearchCursor(fc, ["AddressID"]) as cursor: for row in cursor: try: if "CC" in row[0]: list.append(int(row[0].strip("CC"))) except TypeError: pass del cursor
... View more
02-12-2014
11:41 AM
|
0
|
0
|
5856
|
|
POST
|
You can add an IF statement. Ex: with arcpy.da.SearchCursor(fc, ["AddressID"]) as cursor:
for row in cursor:
if "CC" in row[0]:
list.append(int(row[0].strip("CC")))
del cursor
... View more
02-12-2014
10:19 AM
|
0
|
0
|
2543
|
|
POST
|
Hi BC, One way you could do this is by creating a Start Editing and Stop Editing button. Once the Start Editing button is clicked, you will be able to add/update point features. When Stop Editing is clicked, you can identify the polygons. For some reason, I would receive an error after clicking 'Stop Editing' when a dynamic map layer was added to the app. To workaround this, I added the polygon layer as a feature layer. You can take a look at an example here.
... View more
02-12-2014
06:19 AM
|
0
|
1
|
3991
|
|
POST
|
Hello, If you want to delete fields, you will want to use the Delete Field function.
... View more
02-12-2014
02:19 AM
|
0
|
0
|
423
|
|
POST
|
What you need to do is strip 'CC' from the AddressID and then convert the value to an integer before appending it to the list. You can then sort the list, select the last value, add one and then append 'CC' back to this value. Ex: def onMouseDownMap(self, x, y, button, shift):
arcpy.env.workspace = r"C:\Temp\test.mdb"
fc = "points"
list = []
with arcpy.da.SearchCursor(fc, ["AddressID"]) as cursor:
for row in cursor:
list.append(int(row[0].strip("CC")))
del cursor
list.sort()
AddressID = list[-1] + 1
AddressID = 'CC' + str(AddressID)
row_values = [(x, y, (x, y), AddressID)]
cursor = arcpy.da.InsertCursor(fc, ["X_Coord", "Y_Coord", "SHAPE@XY", "ADDRESSID"])
for row in row_values:
cursor.insertRow(row)
del cursor
arcpy.RefreshActiveView()
... View more
02-12-2014
02:06 AM
|
0
|
0
|
2543
|
|
POST
|
In your case, you need every added point to be greater than the largest AddressID, i.e. CC56560? If that is the case, what is the larget AddressID? Or, is this tool going to be used for multiple feature classes, and the AddressID varies? i.e. CC00100 is the largest for one feature class, CC032232 is the largest for another feature class
... View more
02-11-2014
12:29 PM
|
0
|
0
|
3313
|
|
POST
|
I may not be understanding what you are looking to accomplish. Do you want the basemap to not display when the map is loaded? Then use the button to toggle the basemap on?
... View more
02-11-2014
11:22 AM
|
0
|
0
|
1749
|
|
POST
|
Hi Brandon, You can do this using the setVisibility method. Ex: aerialsLayer.setVisibility(false);
... View more
02-11-2014
11:04 AM
|
0
|
0
|
1749
|
|
POST
|
I would recommend creating a text input rather than textarea: <input type="text" id="address" value="380 New York St, Redlands" size="30"/>
... View more
02-11-2014
10:16 AM
|
0
|
0
|
2729
|
|
POST
|
Since AddressID is a text field, you will have to convert it to an int, add 1, then convert it back to a string. Replace: AddressID = list[-1] + 1 with: AddressID = int(list[-1].strip('CC0')) + 1
AddressID = 'CC0' + str(AddressID)
... View more
02-11-2014
10:08 AM
|
0
|
0
|
3313
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 07-08-2026 12:27 PM | |
| 4 | 05-07-2020 05:14 PM | |
| 1 | 03-25-2026 04:16 AM | |
| 1 | 03-16-2026 01:00 PM | |
| 1 | 12-22-2025 10:39 AM |
| Online Status |
Offline
|
| Date Last Visited |
yesterday
|