AnsweredAssumed Answered

join oracle table and polyline layer into single layer to be used for webservice to AGO

Question asked by east_bay_sugar on Apr 5, 2016
Latest reply on Apr 7, 2016 by akk602dev

Clerks are creating polylines representing construction project locations in a polyline layer located in a file based .gdb


Attribute Table here is in the format



With PROJECTID being the unique key.


This is currently being  joined by PROJECTID  through “JOIN AND RELATES” to additional text data coming from an oracle view  SDEPCONSTR .CONSTRINFO in the format:



Creating webservices with this join is raising a lot of medium errors about it being possibly slow since I’m accessing the Oracle server through the ESRI server and the join to an Oracle view is causing other strange artifacts in AGO.


I want to create a python script that picks up everything the clerks have entered either through editing the polyline layer on their workstation, combine the polylines with the oracle descriptor data through the join, and save it into one Feature Class that is local on the server that can be used to create the webservice for AGO, and just run the script as a cron job so I don’t have to do this by hand anymore.


I’m already hitting a problem with arcpy.CopyFeatures_management() only writing to a **new** Feature Class. So I have to delete the target FeatureClass each time before copying?


So far my code looks like:


# ---------------

# Import arcpy module

import arcpy


# Local variables:

ActiveProjectsInField = "Z:\\APF.gdb\\ConstructionProjects\\ActiveProjectsInField"

SDEPUSER_FieldProjectsCopy = "Database Connections\\ArcSDE4.sde\\SDEPCONSTR.RPP\\SDEPCONSTR.ProjectCopy"

data_type = ""


# Process: Delete temporary geodatabase

  1. arcpy.Delete_management(SDEPUSER_FieldProjectsCopy, data_type)


# Process: Copy Features to a temporary geodatabase FieldProjectsCopy

  1. arcpy.CopyFeatures_management(ActiveProjectsInField, SDEPUSER_FieldProjectsCopy, "", "0", "0", "0")

# ----------------


Which is copying the polyline layer from the file based geodatabase into the server’s geodatabase as a new layer "ProjectCopy". But not sure how to access from within Python the additional fields needed for the Oracle data to be joined to the polylines. And should I be dropping this built table each time instead of just truncating it?


Am I on the right path, or is there a better practice for combining desktop editing of polylines with oracle data into a single feature to be exported as a webservice for display on AGO?