|
POST
|
That is another approach. Although I like working with SQL, building SQL expressions via Python and passing them to Esri tools seems to be a hang up for lots of folks, so I decided against suggesting a where_clause, but it will work.
... View more
02-05-2015
08:57 AM
|
1
|
1
|
2043
|
|
POST
|
Haven't tested, but try: import arcpy
from arcpy import env
env.workspace = r"C:\SouthA\Bolivia.gdb"
listFCs = arcpy.ListFeatureClasses("*")
for fc in listFCs:
with arcpy.da.UpdateCursor(fc, ["field1", "field2", "field6", "field7"]) as cur:
for row in cur:
if 0 in row:
cur.deleteRow()
... View more
02-05-2015
06:54 AM
|
2
|
3
|
2043
|
|
POST
|
For starters, I encourage you to read up on the Arcpy Data Access module (arcpy.da). The cursors in the data access module are newer, more robust, and higher performing than the older cursors. I gotta step out but will post some code when I get back if someone hasn't already.
... View more
02-05-2015
06:48 AM
|
1
|
4
|
2043
|
|
POST
|
I am using ArcGIS Pro 1.0.0. Yes, it works, I tested it before posting the other day. I just tested it again, and it worked without any issues: arcpy.MakeFeatureLayer_management(r"D:\tmp\test.sqlite\webMerc1","webMerc")
<Result 'webMerc'> It is helpful if you can post specific code and error messages, especially since it keeps not working for you. I am not sure what is different between our machines. I recently re-imaged my machine using Windows 7 64-bit Enterprise Edition. I installed ArcGIS 10.3 before I got around to putting ArcGIS Pro on the machine, but the installations should be compartmentalized from each other. Anyhow, I was loading SQLite databases into Pro with the beta versions and pre-releases before I re-imaged my machine. Have you tried creating a layer file in ArcGIS Desktop that points to a SQLite data source and then load that layer file into ArcGIS Pro? As has been pointed out, SQLite isn't officially supported yet, so the best approach in the interim might be to find an alternate data store.
... View more
02-05-2015
06:44 AM
|
1
|
1
|
6203
|
|
POST
|
Is there a reason you are looking at 9.3 Help even though you are using 10.2? A lot has changed in nearly 7 years.
... View more
02-04-2015
11:12 AM
|
0
|
9
|
4603
|
|
POST
|
You might want to try: field = "COUNTY_CODE"
where_clause = "{} = '{}'".format(field, code[0]) or where_clause = "COUNTY_CODE = '{}'".format(code[0]) You don't need to put your field name in quotes, but the value itself will need to be in quotes if it is text. I strongly encourage you to read up on Python String Formatting. It is much more powerful and Pythonic for building SQL expressions than concatenating strings together.
... View more
02-04-2015
07:06 AM
|
5
|
2
|
2986
|
|
POST
|
Not completely sure this will address your need, although I think it is in the ballpark: Geodatabase Geek - THE “INVERSE” MULTI-VERSION VIEW Although I am not currently implementing it, I did implement it on a project years back. If my memory serves me, it worked well, and I especially liked that it was a SQL view so you can check for all of the edits at any time you want by refreshing the view.
... View more
02-03-2015
11:00 AM
|
1
|
0
|
2299
|
|
POST
|
It is helpful to review the Help for Building a query expression, where it states: If the string contains a single quote you will first need to use another single quote as an escape character. In Python, the backslash is the dominant escape character, but there are some additional escape sequences. ArcGIS wants users to escape a single quote by using another single quote. I see that Xander Bakker beat me to the punch with the actual code. That's what getting distracted while replying gets me. : )
... View more
02-02-2015
09:43 AM
|
1
|
1
|
3184
|
|
POST
|
It is helpful to post specific error messages, if any, as well. Try changing your second to last line to: arcpy.DeleteField_management(delete, ["Pump", "Well", "Tank"])
... View more
02-02-2015
08:34 AM
|
1
|
1
|
1320
|
|
POST
|
The tool won't "see" the SQLite database for the same reason the Project pane doesn't; however, the tool works with them. Don't rely on the tools Browse button, fully specify the path to the table in the SQLite database in the Input Features text box.
... View more
02-02-2015
07:35 AM
|
1
|
3
|
6203
|
|
POST
|
Are you trying to load spatial data or just a table? Was the SQLite database created by ArcGIS Desktop or some other application? If the latter, try making a SQLite database from ArcGIS Desktop and putting some data in it, and then see if ArcGIS Pro sees that database, especially if working with spatial data.
... View more
02-02-2015
06:32 AM
|
0
|
5
|
6203
|
|
POST
|
If communicating with Esri feels like screaming in the wind at times, dealing with Apple is like having that conversation in an asylum. I gave up on them a long time ago, which is too bad because they do make some good products.
... View more
02-02-2015
06:29 AM
|
0
|
0
|
2519
|
|
POST
|
It is easier for fellow GeoNet community members to provide feedback if you post relevant, functional parts of your code.
... View more
01-30-2015
03:12 PM
|
0
|
0
|
1000
|
|
POST
|
I think Esri would agree, i.e., SQLite isn't currently fully supported in ArcGIS Pro. Although "seeing" SQLite databases isn't possible through the Project pane/window, you can load SQLite databases using the Make Feature Layer tool either through the GUI or ArcPy. At least during beta testing, Spatialite-based spatial data wouldn't load because the correct DLLs weren't packaged with the installer, not sure if that changed. I have successfully loading ST_Geometry and GeoPackage spatial data into ArcGIS Pro.
... View more
01-30-2015
10:07 AM
|
1
|
7
|
6203
|
|
POST
|
You can force indexes through Query Hints (Transact - SQL). That said, forcing an index may not improve performance, sometimes it makes performance worse. Since it seems you are in a development/testing phase and not writing production code yet, it might not hurt to experiment with forcing the different indexes to see what happens. If forcing an index does help, especially dramatically, then the question becomes why isn't the query optimizer choosing to use either index. By the way, I believe it is still true that SQL Server can only use one spatial index in a single query, but that may have changed. If you haven't already, you may want to review SQL Server 2012 - Spatial Indexes Overview. The more you understand how MS has implemented spatial indexes, the less of a black box it will all seem, which makes for better SQL troubleshooting. Also, there are some very specific syntax rules for maximizing a nearest neighbor type of query, which you are trying to do in some form. Beyond reading MS's overview, there are some good blogs and MSDN discussions on tuning SQL Server spatial indexes. Taking a quick glance at your specific code, you are missing some of the requirements for a spatial index to be used. As the overview documentation I linked to above states: Geometry Methods Supported by Spatial Indexes Spatial indexes support the following set-oriented geometry methods under certain conditions: STContains(), STDistance(), STEquals(), STIntersects(), STOverlaps(), STTouches(), and STWithin(). To be supported by a spatial index, these methods must be used within the WHERE or JOIN ON clause of a query, and they must occur within a predicate of the following general form: ....
... View more
01-30-2015
09:30 AM
|
0
|
1
|
2360
|
| Title | Kudos | Posted |
|---|---|---|
| 2 | 3 weeks ago | |
| 1 | 05-29-2026 08:22 AM | |
| 1 | 4 weeks ago | |
| 3 | a month ago | |
| 1 | 05-22-2026 05:27 AM |
| Online Status |
Online
|
| Date Last Visited |
5 hours ago
|