Ejemplo n.º 1
0
 def __init__(self,xmlDoc):
     self.xmlDoc = xmlDoc
     dataSettings = xmlDoc.getElementsByTagName("Settings")[0]
     self.cadFolder = eval(dataSettings.getAttributeNode("cadFolder").nodeValue.replace(os.sep,os.sep+os.sep))
     self.stagingWS = os.path.join(gse.sdeConnFolder,dataSettings.getAttributeNode("stagingWS").nodeValue)
     self.productionWS = os.path.join(gse.sdeConnFolder,dataSettings.getAttributeNode("productionWS").nodeValue)
     self.minTime = datetime.datetime.strptime(eval(dataSettings.getAttributeNode("minTime").nodeValue),"%d/%m/%Y %I:%M:%S %p")
     self.deleteCADFiles = gzSupport.strToBool(dataSettings.getAttributeNode("deleteCADFiles").nodeValue)
     self.autoSync = gzSupport.strToBool(dataSettings.getAttributeNode("autoSync").nodeValue)
     self.exitOnError = gzSupport.strToBool(dataSettings.getAttributeNode("exitOnError").nodeValue)
     self.fileExt = dataSettings.getAttributeNode("fileExt").nodeValue
     self.fmeExe = dataSettings.getAttributeNode("fmeExe").nodeValue
     self.sourceEPSG = dataSettings.getAttributeNode("sourceEPSG").nodeValue
     self.runas = dataSettings.getAttributeNode("runas").nodeValue
     try:
         self.truncate = dataSettings.getAttributeNode("truncate").nodeValue
     except:
         self.truncate = 'Y'
Ejemplo n.º 2
0
# ---------------------------------------------------------------------------
# addMissingFields.py
# Created on: 2014-08-14 SG
# Description: Add missing fields to a target Geodatabase using the provided field name, type, etc. using the Gizinta.xml
# ---------------------------------------------------------------------------
# Copyright 2012-2014 Vertex3 Inc
# This work is licensed under the Creative Commons Attribution-ShareAlike 3.0 Unported License.

import os, sys, traceback, time, arcpy,  xml.dom.minidom, gzSupport, myGizinta

gzSupport.xmlFileName = arcpy.GetParameterAsText(0) # xml file name as a parameter
gzSupport.workspace = arcpy.GetParameterAsText(1) # Gizinta Geodatabase
gzSupport.ignoreErrors = gzSupport.strToBool(arcpy.GetParameterAsText(2)) # boolean indicates whether to return False if errors encountered
SUCCESS = 3 # parameter number for output success value

gzSupport.startLog()
xmlDoc = xml.dom.minidom.parse(gzSupport.xmlFileName)
datasets = gzSupport.getXmlElements(gzSupport.xmlFileName,"Dataset")
rootElem = gzSupport.getRootElement(xmlDoc)
gzSupport.logTableName = rootElem.getAttributeNode("logTableName").nodeValue
gzSupport.errorTableName = rootElem.getAttributeNode("errorTableName").nodeValue
valueMappings = gzSupport.getXmlElements(gzSupport.xmlFileName,"ValueMaps")

def main(argv = None):
    success = True
    gzSupport.compressGDB(gzSupport.workspace)
    arcpy.ClearWorkspaceCache_management(gzSupport.workspace)
    tables = gzSupport.listDatasets(gzSupport.workspace)
    tNames = tables[0]
    tFullNames = tables[1]
Ejemplo n.º 3
0
# ---------------------------------------------------------------------------
# ExtractLayerToGDB.py
# Created on: 2013-05-06 SG
# rewritten in June 2013
# Description: Import a set of .lyr files to Geodatabase.
# ---------------------------------------------------------------------------
# Copyright 2012-2014 Vertex3 Inc
# This work is licensed under the Creative Commons Attribution-ShareAlike 3.0 Unported License.

import os, sys, traceback, time, arcpy, xml.dom.minidom, gzSupport

gzSupport.xmlFileName = arcpy.GetParameterAsText(
    0)  # xml file name as a parameter
sourceLayer = arcpy.GetParameterAsText(1)  # Source Layer File to load from
gzSupport.workspace = arcpy.GetParameterAsText(2)  # Gizinta Geodatabase
gzSupport.ignoreErrors = gzSupport.strToBool(arcpy.GetParameterAsText(
    3))  # boolean indicates whether to return False if errors encountered
SUCCESS = 4  # parameter number for output success value

gzSupport.startLog()
xmlDoc = xml.dom.minidom.parse(gzSupport.xmlFileName)
datasets = gzSupport.getDatasets(gzSupport.xmlFileName)

rootElem = gzSupport.getRootElement(xmlDoc)
gzSupport.logTableName = rootElem.getAttributeNode("logTableName").nodeValue
gzSupport.errorTableName = rootElem.getAttributeNode(
    "errorTableName").nodeValue


def main(argv=None):
    success = True
    name = ''