|
POST
|
Is there a reason you're using an event layer in desktop? The below code could be modified to simply write the geometries into a new feature class rather than printing the values. It's untested code, but should be pretty close. It reprojects each row of your csv file into the new coordinate system with the transformation and prints it out.
import arcpy
infile = open("yourfilename.csv","r")
for line in iter(infile):
aRow = line.split(',')
point = arcpy.Point()
point.X = aRow[5] #array position of X value
point.Y = aRow[6] #array position of Y value
inputSR = arcpy.SpatialReference("c:/coordsystems/NAD 1983.prj")
outputSR = arcpy.SpatialReference("c:/coordsystems/NAD 1927.prj")
pointGeometry = arcpy.PointGeometry(point,inputSR)
projectedPointGeometry = pointGeometry.projectAs(outputSR,"Name_Of_The_Transformation")
outputPoint = projectedPointGeomtry.centroid
print outputPoint.X,outputPoint.Y
... View more
05-07-2013
09:35 AM
|
0
|
0
|
1622
|
|
POST
|
I see a school and 'Final Project' in your workspace, so a few ideas to point you in the right direction: -import statements at go at the top, then the function definitions (Clean style thing) -check on arcpy.AddMessage in addition to print if you want to see messages in your script console -arcpy.GetParameterAsText -Read these sections of the ArcGIS Help "Accessing parameters in a script tool", "Understanding script tool parameters", "Setting script tool parameters" (Pay attention to the 'Obtained from' property of the parameter).
... View more
05-06-2013
10:50 AM
|
0
|
0
|
681
|
|
POST
|
I'd like to update the owner of a domain using an update query in Oracle. Does anyone have an update query for oracle which will change the Owner text node value for a given item name?
... View more
04-24-2013
10:32 AM
|
0
|
0
|
2204
|
|
POST
|
I am attempting to import an XML workspace Document into a 10.1 Geodatabase (Same issue with File and Enterprise geodatabases). I receive the error "Import xml data failed" "Fatal error parsing xml. Line = 1677445, char = 0. Reason: invalid character 0x8". 0x8 appears to be the utf-8 backspace character for some reason. Im am exporting from 9.3.1 to import into 10.1. I have tried exporting using both 10.1 and 9.3 A schema only import works without any errors. Any idea what the error could be caused by? Is there a good way to get more information about what is happening?
... View more
04-15-2013
08:15 AM
|
0
|
3
|
4900
|
|
POST
|
I am attempting to setup ArcSDE 10.1 with a master geodatabase and multiple user schema geodatabases. I am working with an enterprise Oracle server which is shared with multiple parts of the business. As we have done in the past our DBAs have created the core table spaces and users in the database ahead of my geodatabase installation. I was able to use the Enable Enterprise Geodatabase to create my master SDE geodatabase and I can connect to it without issue. I now want to create my user schema geodatabases. Those users have been created in the same way. I've tried Enable Enterprise Geodatabase which errors with a geodatabase already exists when I attempt to use it through a user geodatabase connection to the Oracle instance. I assume this is because it already sees the master geodatabase. I've tried the Create Enterprise Geodatabase tool which errors with 'bad login user'. I'm assuming this is because I have not entered the sys password. I do not want to enter the sys password, mostly because I don't have it and getting it from the DBAs is not possible. I would also prefer not to need to engage them to type in a password for my testing ten times. If I know it will work and it is the only way I would attempt it. Thoughts? Can I create enterprise geodatabase in a user schema without the sys password? I used to do this with the sdesetup command, is that still possible with 10.1?
... View more
01-31-2013
04:13 AM
|
0
|
1
|
3537
|
|
POST
|
I uninstalled and tried to reinstall ArcGIS Server 10.1. On reinstallation I reached the create site option. I didn't have a useful site on the server, but the folders from a previous attempt were still on the server (c:\arcgisserver\directories c:\arcgisserver\config-store). When I attempted to create a new site it failed with "Unable to decrypt request parameters". Deleting the folders then creating the new site solved the issue. I didn't see the error message on the forum so here is is with a quick solution.
... View more
01-11-2013
03:19 AM
|
1
|
3
|
5258
|
|
POST
|
Was this ever resolved? I've been able to geocode with Python, but I can't get it to accept lower match scores. I've tried lowering the score in the locator,but no luck on making the matches happen lower. I have been able to make this work interactively in ArcMap.
... View more
12-19-2012
09:15 AM
|
0
|
0
|
522
|
|
POST
|
I believe it's data related. I think I've got it sorted. Marking the original answer as correct.
... View more
10-04-2012
09:58 AM
|
0
|
0
|
2601
|
|
POST
|
So I did miss that note, I see it right at the top of the arcpy.da.insertcursor documentation as well now. In the mean time I managed to get an error about the feature class not being editable outside an edit session which got me onto an edit session for an unrelated reason. I now have a far simplified chunk of code that gives me the same error. "workspace already in transaction mode". import arcpy
edit = arcpy.da.Editor(r'C:/Projects/GISPROD_ElectricDistribution_Extract.gdb')
edit.startEditing(False,False)
theIC = arcpy.da.InsertCursor(r'C:/Projects/GISPROD_ElectricDistribution_Extract.gdb/electric/servicepoint',['PHASEDESIGNATION', 'WORKORDERID', 'SUBTYPECD', 'PLACEMENTCONFIDENCE', 'SHAPE@'])
theIC.insertRow(['7', '280773', '1', '90', arcpy.Point(292840.72313, 4818098.69548)])
edit.stopEditing(False) Thoughts? There is a geometric network buried in there, but there are not objects that are not straight arcgis object classes that I am aware of.
... View more
10-03-2012
01:09 PM
|
0
|
0
|
2601
|
|
POST
|
Is this possible or do you have to delete one cursor before opening another? I create the first cursor, make a row, and insert it. I make the second cursor, make a row, attempt to insert it, and I get the error "workspace already in transaction mode". While creating cursors in the new form is much faster (I measured 10X) it should still be faster to have all of the cursors I`m going to use created once rather than 50000 times. I`m loading features in a random order from randomly ordered XML files.
... View more
10-03-2012
10:42 AM
|
1
|
6
|
12441
|
|
POST
|
Solved with a few different options. They required either modifying the SDE tables, or using ArcObjects to change the CLSID of the objects once they had been exported. Solution on the Telvent Forum
... View more
09-13-2012
08:28 AM
|
0
|
2
|
2387
|
|
POST
|
I am attempting to export data from my SDE geodatabase into a file geodatabase. It is important that all of the data comes out with the original objectIDs, globalIDs, and relationships intact. Right now I'm doing this with a python script and the copy_management tool and it works great, almost. The file geodatabase is populated correctly except that all of the objects in the database are ArcFM objects and not ESRI objects. I'd like them to be ESRI objects so that I can use the geodatabase on machines that don't have the ArcFM object reader. The only way I've been able to convert them so far is to manually create/upgrade ArcFM into the file geodatabase, convert to ESRI objects, then delete the ArcFM system tables. I'd like to do this all automatically. Any suggestions on a change or alternative to my process? Anything is fair game as long as it can be done in code without user interaction. Thanks
... View more
09-07-2012
06:59 AM
|
0
|
3
|
7964
|
|
POST
|
Apparently you have to stop editing, then everything is fine... I can leave the code up if it's useful for reference or delete the post.
... View more
07-18-2012
06:54 AM
|
0
|
0
|
1440
|
|
POST
|
I am attempting to export a set of map books using a common index layer which has an attribute telling me which map books each feature in the index belongs to. Interactively I can open ArcMap, change the definition query on the featureclass and refresh the data driven pages before exporting each map book. I am attempting to do this in python so I can schedule it to update the books at a regular interval. I could do this with a search cursor to loop through checking the attributes and append each page, although it appears the code below should work conceptually at doing what I'm attempting. It runs (with the exception of the mxd.dataDrivenPages.refresh() line), but exports all of the features in the original unmodified definition query. Any thoughts on if this can't work, why, or is the loop with a cursor my only option? import arcpy mxd = arcpy.mapping.MapDocument("c:/temp/MapTemplate32KOneLine.mxd") for myLayer in arcpy.mapping.ListLayers(mxd,'OneLineBoundaryTileEdit - 32K Index'): myLayer.definitionQuery = "SUBTYPECD = 3 AND DEPOT LIKE '%BAR%'" mxd.dataDrivenPages.refresh() mxd.dataDrivenPages.exportToPDF("C:/temp/BAR.pdf","ALL","","PDF_SINGLE_FILE","100","FASTEST") Note: The error I get from the mxd.dataDrivenPages.refresh() line is below. Traceback (most recent call last): File "testExportDataDrivenPages.py", line 13, in <module> mxd.dataDrivenPages.refresh() File "C:\Program Files (x86)\ArcGIS\Desktop10.0\arcpy\arcpy\_mapping.py", line 266, in refresh return convertArcObjectToPythonObject(self._arc_object.refresh(*gp_fixargs((args), True))) ValueError: PageLayoutObject: Error in refreshing RefreshDataDrivenPages
... View more
07-18-2012
06:22 AM
|
0
|
6
|
4073
|
|
POST
|
So the next logical step of the thread is upgrading them. My multiple services have been working well for a while and we'd like to upgrade. To do this do the steps below make sense? Upgrade the base installation with the upgrade application Stop the service I would like to upgrade Use the sdesetup command in the base installation directory to upgrade one of the geodatabases Replace the contents of the SDEHOME associated with the database I just upgraded with upgraded base installation except for the files unique to the service (dbinit, etc.) Do these steps make sense? Do I need to recreate the sde services as well?
... View more
02-10-2011
10:35 AM
|
0
|
0
|
566
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 02-04-2019 09:22 AM | |
| 1 | 07-10-2015 01:01 PM | |
| 1 | 06-30-2015 11:18 AM | |
| 1 | 01-29-2019 01:43 PM | |
| 1 | 01-25-2019 10:04 AM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:23 AM
|