|
POST
|
I think the bug here is that either of the statements work at all with the cursor! (So its a documented limitation) arcpy.da.SearchCursor Doc: SQL prefix supports None, DISTINCT, and TOP. SQL postfix supports None, ORDER BY, and GROUP BY.
... View more
09-06-2017
07:03 AM
|
1
|
2
|
2518
|
|
POST
|
I cant tell you why, but you need to try work out why this script does not find the existing data: pntFc = r"\\abc\home\xxx\Documents\ArcGIS\treepoints" if not arcpy.Exists (pntFc):
print "I cant find the existing data"
... View more
08-24-2017
08:31 AM
|
0
|
1
|
441
|
|
POST
|
In that case I can only assume your if statement is always triggering too, add a print statement to test this: if not arcpy.Exists (pntFc):
arcpy.CopyFeatures_management(ptGeom, pntFc)
print "Deleting and replacing existing FC"
... View more
08-24-2017
08:09 AM
|
0
|
3
|
441
|
|
POST
|
EDIT - It looks like you are mixing cursor syntax between the new .da cursors, and the old Insertcursors. simple fix attached below using old style cursors I am familiar with: def onMouseDownMap(self, x, y, button, shift):
#adding points to the map
mxd = arcpy.mapping.MapDocument ("CURRENT")
sr = mxd.activeDataFrame.spatialReference
pntFc = r"\\abc\home\xxx\Documents\ArcGIS\treepoints"
pt = arcpy.Point(x,y)
x = float
y = float(y)
ptGeom = [arcpy.Geometry ("POINT", pt, sr)]
if not arcpy.Exists (pntFc):
arcpy.CopyFeatures_management(ptGeom, pntFc)
else:
icursor = arcpy.InsertCursor(pntFc)
row = icursor.newRow()
row.setValue("Lat", float(x))
row.setValue("Long", float(y))
row.setValue('Shape', ptGeom)
icursor.insertRow(row)
arcpy.RefreshActiveView()
print "Complete"
... View more
08-24-2017
07:29 AM
|
0
|
5
|
1545
|
|
POST
|
1) Did you try closing and reopening the table to see if the rows are there now? (It wont refresh even with .refreshActiveView() .... see the thread I linked.) 2) Did you try having the python window open to see any crashes? Its not a problem with your script....the cursor will never have multiple rows as theres no way for it to do that for pt in ptGeoms: Will always only have 1 geometry...as the event runs when you click the mouse and gives 1 point to the script... Im pretty sure its all working perfect, your just not seeing the updates inside the table.
... View more
08-23-2017
08:29 AM
|
0
|
0
|
1545
|
|
POST
|
Im interested too learn how you capture multiple points at a time with this code? onMouseDown will return 1 event per click with an xy, which should then run your code snippet and insert the geometry. How does ptGeoms get populated with more than a single point? UNLESS you mean when you use the tool multiple times The tool may crash second time round due to locking or something, try running it with the 'python' window open inside ArcGIS as you click points, which will show if any crashes happen. whilst looking at the attribute table - the table wont refresh by itself, you need to close it and reopen it to see the changes, or see this thread for some other tips: Refreshing open attribute table in ArcMap using ArcPy rather than ArcObjects? - Geographic Information Systems Stack Exc…
... View more
08-23-2017
05:04 AM
|
0
|
0
|
1545
|
|
POST
|
The message / stacktrace seems like a bug to me! (Or just a bad error message). Is your "InTable" correct... inTable = r"F:\DatabaseConnections\ANB-SQL-001_ANBGISv10_ISANBGIS.sde\V_BEHEEREENHEDEN_IVANHO_TEST1" All mine are like this: (Like in the example) inTable = r"F:\DatabaseConnections\ANB-SQL-001_ANBGISv10_ISANBGIS.sde\DATABASE.DataOwner.V_BEHEEREENHEDEN_IVANHO_TEST1" To test, use the "Add data" button in ArcMap, and see if your path can be pasted in directly to add the table.
... View more
08-04-2017
04:45 AM
|
0
|
0
|
1471
|
|
POST
|
We need to know exactly what was printed as your attempted SQL where clause, as Randy indicated: Quote: If that doesn't fix it , then I'd add a "print sql" around line 115, as indicated above, which should show you what the where query is. Please add a line: print sql as line 115 and tell us the result. Also, we need to know the line of the script that crashes, this should be printed in the error: Also, does the error message indicate which line it is happening on? It looks like the JSON response from the query is being printed out.
... View more
07-17-2017
06:41 AM
|
1
|
1
|
2200
|
|
POST
|
I love ArcGIS pro. Before I develop my templates for final delivery I wanted to check, can I deliver a project to a client, with a single ArcPRO license that I pay for upfront in full that wont expire. (They wont accept a product they can only access for 1 year) Is this possible?
... View more
06-30-2017
06:24 AM
|
0
|
1
|
1060
|
|
POST
|
Use tool "Feature Vertices to Points" to convert the lines to start and end points, then join to them.
... View more
06-13-2017
03:48 AM
|
1
|
1
|
1599
|
|
POST
|
I am unable to come up with a decent algorithym.... and I love a challenge! I feel ESRI have constructed a decent tool, and knowing this, put it behind an advanced license for 'commercial' reasons I would advise looking at the open source tools provided in our other threads, as this is a not a simple task to accomplish. Unless you have any good ideas of how the algorithm should work I could try to implement
... View more
06-06-2017
09:40 AM
|
1
|
0
|
480
|
|
POST
|
Put Simply, feature to polygon considers ALL INPUT FEATURES when creating shapes, and is a more complicated totally different algorithm than what you have begun to implement with your "Feature by Feature" code. You could look to dissolve the input lines, and then explode, as a pre-process, and then rewrite your own algorithym, but its probably a little complex to get good results!
... View more
05-22-2017
05:01 AM
|
1
|
2
|
2580
|
|
POST
|
I think what were saying is due to this being a Data Centric problem as a pose to a bug, there should be a method of choosing a "ZoomScale Field" / default scale value, similar to "Display Field" in the layer properties. Then you could populate the scale depending on your data / set a default thats relevant and it would seamlessly interface with the other ArcGIS windows / functionality
... View more
05-15-2017
08:43 AM
|
0
|
0
|
3279
|
|
POST
|
A single point could represent a city, or a 1 metre area of interest. I may have points located all around the globe...or not! So even taking a fraction of the total extent is not a good indicator, there is no right scale! You could make a zoom to point add-in just for your data, but I cant see how to override the default zoom to functionality where it exists. (file --> zoom to, in attribute tables, etc, this is where extra functionality exposed to arcpy would be great! )
... View more
05-15-2017
07:47 AM
|
0
|
1
|
3279
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 11-29-2019 07:45 AM | |
| 1 | 05-13-2013 07:11 AM | |
| 1 | 05-24-2011 07:53 AM | |
| 1 | 05-22-2017 05:01 AM | |
| 2 | 07-29-2019 05:34 AM |
| Online Status |
Offline
|
| Date Last Visited |
10-22-2024
10:40 AM
|