POST
|
Hello everyone, I'm having some problems with an Arcpy script that I've attached below. It should be a simple script, it was converted from ModelBuilder so it mostly just a series of tools, although the script iterates between each feature (features = arcpy.GetParameterAsText(1)) and runs a different set of tools. The goal is to intersect all input features (mulitvalue in the toolbox settings) convert lines and polygons into points, merge all points than get a sum of how many points are in each "TWP" Polygon. The entire script functions fine except the Spatial Join, which I commented out at one point to check the later tools. I've run the Spatial Join with the same data in both ModelBuilder and ArcMap, both are done within seconds. In Arcpy, the script will run until ArcMap crashes, closing on its own. If the Spatial Join is commented out the script will run to completion. You can find the Spatial Join in line 127, and just above that you can see I have tried repairing the geometry, converting to feature layers, and adding spatial indices to both inputs. Please let me know if you have any other ideas, it would be a huge help, thanks. Ryan
... View more
12-02-2014
02:56 PM
|
0
|
12
|
5266
|
POST
|
Guh, looks like that was the problem, I changed it to OBJECTID and it worked. Still though, odd that the polygon script was the only one to give me "?feature=undefined"
... View more
08-04-2014
09:12 AM
|
0
|
0
|
1055
|
POST
|
Oh I see! I've been looking for an alternative to .length but I can't seem to have any documentation on it. I'm aware of the problem with OBJECTIDLINK, we're going add that back to the data later. So you happen to know the name for what .length is? I looking i the documentation for arrays.
... View more
08-04-2014
08:08 AM
|
0
|
2
|
1055
|
POST
|
Hmmm That will let me select points but still won't update the URL. Could the problem be in line #181 "if (selection.length > 0) {" I mean, it makes no sense for point but you would think it would work for line that do have a "length".
... View more
08-01-2014
12:02 PM
|
0
|
6
|
1055
|
POST
|
Hi everyone, I've been getting a problem here, my script generates a webmap. When a feature is selected a popup of the selected feature's attributes appears and the URL is updated to contain the object ID. Right now the click event will select polygons and the script will work, but I have two other identical scripts using lines and polygons. The "onmouseover" event will select them, but will not update the URL and I am unsure why. Any help would be greatly appreciated! The line in question is #152, or "map.on("click", function (e) {" Please find attached the three scripts. 2 is Polygons, 1 is Points, 0 is Lines.
... View more
08-01-2014
11:26 AM
|
0
|
8
|
1798
|
POST
|
Hey there, sorry we actually figured out the problem was that (on the same line you referenced) OBJECTID and to be changed to parcelid, sorry about that, but thanks for the help!
... View more
07-24-2014
07:40 AM
|
0
|
0
|
308
|
POST
|
. Hi everyone, I'm currently trying to work out issues with my script in the following thread and it was suggested I make a new one. https://community.esri.com/message/389731#389731 The end goal is to be able to send a link to a user, this link would than automatically select and zoom to the feature referenced by the link. This has already been done so we based the script off of a public Esri sample found here: Parcel Locator We just wanted to get it to work with our data but it seems like we've hit every problem in the book. Now everything's working except the script still will not pull the "OBJECTID" from the URL and use it to select the feature. I suspect the error is within lines 147-164. The script also updates the URL whenever a feature is selected by clicking, this coding can be found within lines 92-106.
... View more
07-22-2014
01:47 PM
|
0
|
2
|
567
|
POST
|
Nope, It's already doing that from the popup. The goal is that when an OBJECTID number is added to the url (in the format specified in line 101) the maps selects and zooms tot he corresponding feature, like in the example.That way, we could send a client a link to the map, and it would automatically select and zoom to whatever feature they are interested in. We're looking to do more with this script down the road, but I'll have time to check out more tutorials before than. My schooling in Javascript was unfortunately quite minimal.
... View more
07-22-2014
10:16 AM
|
0
|
2
|
378
|
POST
|
Sorry guys, haven't had time to check out those tutorials/ webinars and we're hoping to get htis script done today. Just have one last problem, I got every thing else working. When you type the OBJECTID into the url (?OBJECTID=) it will bring you to the map but will not link to the selected polygon. I think the problem is in lines 147-168 (where the parcel is selected from the url). Pretty sure the error is with the original code too, rather than my changes. Just like how I had to delete "mode: FeatureLayer.MODE_SELECTION" after my changes. Anyway, thanks for all the help fellas.
... View more
07-22-2014
09:54 AM
|
0
|
4
|
378
|
POST
|
Thanks, I have that bookmarked for whenever I have time!
... View more
07-21-2014
08:35 AM
|
0
|
0
|
378
|
POST
|
The works perfectly, thank you so much for your help Tim!
... View more
07-18-2014
08:47 AM
|
0
|
1
|
642
|
POST
|
Great! That's working like a charm! Thank you very much. I hate to be a leech, but I have one more thing I would like to get done, but isn't 100% nessesary. My map doesn't zoom to the extent of my data like the other one, is there somewhere in the code I have to just punch in the extent? Sorry about this, I'm still quite new to Javascript.
... View more
07-18-2014
08:33 AM
|
0
|
3
|
642
|
Title | Kudos | Posted |
---|---|---|
1 | 07-17-2014 02:59 PM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|