Tag Info

New answers tagged

0

Loop through geodatabase (to get list of feature classes) Use Walk (arcpy.da) method Once you have the feature class you may want to verify data type (feature class, table,....etc) before you start the list field loop. To do this you may use the Describe Object property dataType. For checking data type you may reference this Q/A: Check layer data type ...


1

According to this example: public void RegisterDataset(IDataset dataset) { IVersionedObject3 versionedObject = (IVersionedObject3)dataset; bool IsRegistered; bool IsMovingEditsToBase; versionedObject.GetVersionRegistrationInfo(out IsRegistered, out IsMovingEditsToBase); if(IsRegistered) { if(IsMovingEditsToBase) { ...


1

A spatial reference is not a nominal metadata property which can be changed at will. Once set, it cannot be changed. Deletion is the only supported mechanism for changing an SRID. Once you register a table with ArcGIS, it should only be deleted with geodatabase-aware tools (Desktop, Python, ArcObjects .Net/Java). When registered only from ArcSDE ...


0

SDE stores geometry data in image field in SQLServer as a binary stream,so seems you have to add geometry(or) geography type field to your tables and then convert spatial data into this type using one of functions travis mentioned or STGeomFromText. geometry/geography user defined data types in SQLServer2008 are OGC complient as you know,so you can use ...


0

finally i can do it by create arcsde connection tools in work space in data management tools by using arc toolbox. it works. i do believe that toolboxes works properly when some short cut solution doesn't work. now i can see all feature tables in management studio.


0

I'm guessing the parameters are only relative to where the .py file exists. Maybe you could get the input parameters from a script tool form?


0

Yes, you can add columns to a table. The standard SQL statement follows the format of: "alter table add column xyz"


1

Your logic is correct. This help guide may help you out in the future for using python in the field calculator. There are already valid pythonic answers above I'll post another option, in VB (sometime's it is simplier than python). In field calculator choose "show codeblock" for "Q2" under "Pre-logic script code" write: In VB: if [Q1] = "a" then result ...


0

Can't try this since I am not near Arc* Try conditional expressions... Make field Q2 active use the python parser and try 1 if !Q1! == 0 else 0 If it doesn't work...never mind


3

Since you tagged this with python, you can also accomplish this with an updatecursor. Using field calculator in python for multiline statements is sometimes more difficult than the same function in a cursor. with arcpy.da.UpdateCursor("Mange_Waste", ("Q1", "Q2")) as cursor: for row in cursor: if row[0] == "a": row[1] = 1 else: ...


3

you need to use a block or to write everything in a single line (respecting the indentations) block (with Python parser) def myfunction(a,b): if a == 'a': return 1 else: return 0 then you call the function defined in your block myfunction(!Q1!, !Q2!) note that this is a general solution, but in your specific case you could ...


2

Well, before you convert the database, you could run the Domain to Table geoprocessing tool http://resources.arcgis.com/en/help/main/10.1/index.html#/Domain_To_Table/001700000022000000/ which should convert a domain to a stand-alone table that you could put in the database. Then, you should be able to just convert the database, including stand-alone tables ...


3

Those ArcPy functions utilize the SgShape functions lower in the API stack. The ST_GEOMETRY object was built using some of those same functions, but doesn't expose them all (just the set that implements those required by Spatial Types and Functions implementation, which doesn't include LRS). The LRS primitive list exposed at the ArcSDE API isn't large: ...


1

My eventual solution was to avoid the ArcSDE interface and arcpy and use cx_Oracle, as per answers to a question here. The below class returns privileges on an admin/owner connection for either tables (returning a list of users with access) or users (returning a list of tables they can access). I imagine there are more elegant ways to do this, but with my ...


0

To register a feature service residing on ArcGIS for Server on ArcGIS Online, you need to: Go to My Content > Add Item Set The item is On the web Choose ArcGIS Server Web Service Set the URL feature service REST end point (i.e. http://myserver.net:6080/arcgis/rest/services/MyFeatureService/FeatureServer) At this point the feature is editable by anyone ...


1

After some further research I have confirmed that this is a known bug. Hopefully adding this information here will save someone some time in the future as it was not easy to find using Google or the Esri site. Bug NIM-087927 Submitted: Jan 8, 2013 Status: Open http://support.esri.com/en/bugs/nimbus/TklNMDg3OTI3


1

Yes, that's it I think. They are probably libraries we aren't able to distribute, or we don't want to because they could interfere with your existing setup. This is another good resource page for setting up the connection. I'm thinking that if you have ArcGIS installed already then it's most the environment variables that need setting.


3

import arcpy, os, pyodbc def GetPrivileges(table): cnxn = pyodbc.connect('DRIVER={SQL Server};SERVER=servername;DATABASE=dbname;UID=user;PWD=password') cursor = cnxn.cursor() cursor.execute("EXEC sp_helprotect '" + table + "'") rows =cursor.fetchall() privileges = [] for row in rows: privileges.append(row.Grantee) return ...



Top 50 recent answers are included