SlideShare une entreprise Scribd logo
1  sur  37
Télécharger pour lire hors ligne
Accessing and Administering your
 Enterprise Geodatabase through
         SQL and Python

        Brent Pierce @brent_pierce
     Russell Brennan @russellbrennan
             hashtag: #sqlpy
Assumptions



  •   Basic knowledge of SQL, Python and relational
      databases


  •   Basic knowledge of the Geodatabase


  •   We’ll hold all questions till end



             Please turn off cell phones
What is the Geodatabase?

 • A physical store of geographic data
     -   Scalable storage model supported on different platforms


 •   Core ArcGIS information model
     -   A comprehensive model for representing and managing
         GIS data
     -   Implemented as a series of simple tables


 •   A transactional model for managing GIS workflows


 •   Set of components for accessing data
Geodatabase is based on relational principles


 •   The geodatabase is built on an extended relational
     database
     -   Relational integrity
     -   Reliability, Flexibility, Scalability
     -   Supports continuous, large datasets
     -   Standard relational database schema
     -   Base short transaction model
     -   Supports structured query language (SQL)
Geodatabase is based on relational principles …

 •   Leverages key DBMS principles and concepts to
     store geographic data as tables in a DBMS
     -   Data is organized into tables
     -   Tables contain rows
     -   All rows in a table have the same attributes
     -   Each attribute has a type
     -   Relational integrity rules exist for tables
Geodatabase is based on relational principles …

 •   A feature class is stored as a simple DBMS table
 •   Each row represents a feature
 •   The fields in each row represent various
     characteristics or properties of the feature
 •   One of the fields holds the feature geometry which is
     stored as a spatial type
Geodatabase is based on relational principles …

 •   A feature class is stored as a simple DBMS table
 •   Each row represents a feature
 •   The fields in each row represent various
     characteristics or properties of the feature
 •   One of the fields holds the feature geometry which is
     stored as a spatial type
Geodatabase Schema

•   There are two sets of tables
    -   Dataset tables (user-defined tables)
    -   Geodatabase system tables




                                     System tables    XML



                                        User data
                                                     SQL type
User-defined tables

-   Stores the content of each dataset in the
    geodatabase
•   Datasets are stored in 1 or more tables
•   Spatial Types enhance the capabilities of the
    geodatabase
    -   SQL access to geometry
    -   Industry standard storage model and API



                                   System tables    XML



                                      User data
                                                   SQL type
Geodatabase system tables

•   System tables store definitions, rules, and behavior for
    datasets
•   Tracks contents within a geodatabase
•   4 primary tables
•   Geodatabase schema is stored within an XML field




                                System tables    XML



                                   User data
                                                SQL type
Geodatabase Schema…




                 System tables     XML



                      User data
                                  SQL type
Geodatabase Schema…




                  System tables    XML



                      User data
                                  SQL type
Geodatabase Schema…




                  System tables    XML



                      User data
                                  SQL type
Geodatabase Schema…




                  System tables    XML



                      User data
                                  SQL type
Geodatabase Schema…




                  System tables    XML



                      User data
                                  SQL type
What is a spatial type?

 •   A spatial type (ST_Geometry) is a type that stores
     geometry data in a single spatial attribute
     -   Geometry type, coordinates, dimension, spatial
         reference


 •   Spatial Index
     -   Access path for quick retrieval


 •   Relational and geometry operators and Functions
     -   Constructors
     -   Accessor
     -   Relational
     -   Geometry
What are the benefits of a spatial type?


 •   Efficiency
     -   Spatial data and methods are stored in the database
     -   Applications access native dbms type


 •   Accessed using common API’s and SQL
     -   C, C++, C#, Java
     -   Adheres to standards for SQL access
What are the benefits of a spatial type?

  •   Using SQL with a spatial type you can
      -   Create tables with a spatial attributes
      -   Read and analyze the spatial data
      -   Insert, update, and delete simple features

          Spatial Type                 SQL
Accessing Geodatabase through SQL

•   Access schema and properties of existing datasets
     -   Use SQL statements and XPath queries to query the definition
         attribute on the gdb_items table


•   Editing tables/feature classes, whether versioned or not
     -   Versioned classes are edited through versioned views


•   Create tables with SQL containing spatial types


•   Leverage SQL functions to evaluate attributes and spatial
    relationships, perform spatial operations, and return, set spatial
    properties
Accessing Geodatabase through SQL

•   With SQL accessing the data at the
    DBMS level
    -   Bypass behaviors and functionality     Python
        enforced by the geodatabase or
        ArcGIS clients
•   Need to be aware of what you can
                                               ArcGIS
    and cannot edit
    -   Relationship classes
    -   Geometric networks                                 SQL
                                             Geodatabase
    -   Topology…


                                               DBMS
Accessing Geodatabase through SQL

  •   One can use SQL to create, insert and update tables
      -   Need to register the table with the geodatabase to
          participate in geodatabase functionality


CREATE TABLE hazardous_sites
 (oid INTEGER NOT NULL, site_id INTEGER,
  name VARCHAR(40), location sde.st_geometry)



  •   Cannot modify schema of registered tables (i.e add a
      field) or create geodatabase items (i.e domains)
      through SQL
Accessing Geodatabase through SQL

•   Editing feature classes with SQL
     -   Points, lines, polygons (single or multipart)
     -   Ability to modify geometry when stored as a spatial type
     -   Without geodatabase behavior
          -   Not part of topology, geometric network, etc…

•   Editing tables/feature classes
     -   Use SQL statements
     -   Directly editing the database tables (no delta tables)
     -   Nonversioned editing in ArcGIS terminology
•   Editing versioned tables/feature classes
     -   Requires versioned views
Editing tables/feature classes

  •   Can use SQL to update, insert and delete data from
      tables that are not versioned
  •   Can leverage DBMS functionality
      -   Unique indexes, constraints, referential integrity, default
          values, triggers
  •   Requires a unique identifier (ObjectID) when
      inserting
      -   Used to uniquely identify rows in tables in a
          geodatabase
      -   Obtained from classes sequence or procedure
      -   Object ID is used by ArcGIS to do such things as display
          selection sets and perform identify operations on
          features
Editing versioned tables/feature classes

  •   Use versioned views
      -   Versioned Views are automatically created when class is
          registered as versioned


  •   Perform edits within the new version
  SELECT sde.sde_edit_version('WorkOrder1701',1);

      -   Unlike non-versioned editing, ObjectID values for new
          records are automatically generated
      -   Changes are made to the delta tables
      -   Versions must be reconciled through ArcGIS
Demo
Accessing a geodatabase through SQL
Geodatabase Administration
       with Python
                   Russell Brennan
Second Half Agenda


  •   Why use Python?
  •   Tips for using Python with geodatabases
  •   Demo: Creating geodatabase schema
  •   Demo: Performing geodatabase maintenance
  •   Demo: Publishing
Why use Python for Administration?


  •   Numerous tools available
      -   Schema creation and administration
      -   Maintenance
  •   Cross platform.
  •   Easy access to complex behavior.
  •   Easy to schedule tasks.
Using Python to access your geodatabase


  •   Connection files.
      -   Create Database Connection tool.
  •   Version access is defined in the connection file.
  •   Connected user is defined in the connection file.
  •   Multiple connections = multiple connection files.
Demo
Creating a Geodatabase
Demo 1: Creating a geodatabase


  •   Create an enterprise geodatabase.
  •   Create database roles.
  •   Create users.
  •   Create schema.
  •   Apply privileges.
  •   Register data as versioned.
  •   Create edit versions.
Demo
Performing maintenance
Demo 2: Geodatabase Maintenance


  •   Blocking and accepting connections
  •   Disconnecting users.
  •   Reconcile/Post versions
  •   Compress database
  •   Updating statistics and indexes
  •   Email notifications
  •   Scheduling
Demo
Publishing
Publishing


  •   Creating a script tool
  •   Publishing using the geoprocessing framework
  •   Consuming the tool
Slide Deck




  http://www.slideshare.net/brentpierce/enterprise-
     geodatabase-sql-access-and-administration
Thanks for attending
    Questions?

  Please fill out session surveys
www.esri.com/sessionevals

Contenu connexe

Tendances

Chap1 introduction to geographic information system (gis)
Chap1 introduction to geographic information system (gis)Chap1 introduction to geographic information system (gis)
Chap1 introduction to geographic information system (gis)Mweemba Hachita
 
Remote Sensing: Image Classification
Remote Sensing: Image ClassificationRemote Sensing: Image Classification
Remote Sensing: Image ClassificationKamlesh Kumar
 
TYBSC IT PGIS Unit I Chapter II Geographic Information and Spacial Database
TYBSC IT PGIS Unit I Chapter II Geographic Information and Spacial DatabaseTYBSC IT PGIS Unit I Chapter II Geographic Information and Spacial Database
TYBSC IT PGIS Unit I Chapter II Geographic Information and Spacial DatabaseArti Parab Academics
 
Introduction To Geographical Information System (GIS)
Introduction To Geographical Information System (GIS) Introduction To Geographical Information System (GIS)
Introduction To Geographical Information System (GIS) Ajay Singh Lodhi
 
Data base management system
Data base management systemData base management system
Data base management systemPramoda Raj
 
Data managing and Exchange GDB
Data managing and Exchange GDB Data managing and Exchange GDB
Data managing and Exchange GDB Esri
 
Digital image processing 1
Digital  image processing 1Digital  image processing 1
Digital image processing 1Dhaval Jalalpara
 
QGIS Open Source Desktop GIS
QGIS Open Source Desktop GISQGIS Open Source Desktop GIS
QGIS Open Source Desktop GISGIS Colorado
 
Getting started with GIS
Getting started with GISGetting started with GIS
Getting started with GISEsri India
 
GeoApps in the AWS Cloud - Jinesh Varia
GeoApps in the AWS Cloud - Jinesh VariaGeoApps in the AWS Cloud - Jinesh Varia
GeoApps in the AWS Cloud - Jinesh VariaAmazon Web Services
 
Introduction to ArcGIS 10.1
Introduction to ArcGIS 10.1Introduction to ArcGIS 10.1
Introduction to ArcGIS 10.1Claudio Montoni
 
6. Shapefiles in gis
6. Shapefiles in gis6. Shapefiles in gis
6. Shapefiles in gisKU Leuven
 
Introduction to GIS systems
Introduction to GIS systemsIntroduction to GIS systems
Introduction to GIS systemsVivek Srivastava
 
Geographical information system
Geographical information systemGeographical information system
Geographical information systemBipin Karki
 
Geographic information system
Geographic information system Geographic information system
Geographic information system Bhavik A Shah
 
Digitizing features_2 in ARC GIS
Digitizing features_2 in ARC GISDigitizing features_2 in ARC GIS
Digitizing features_2 in ARC GISKU Leuven
 
Terminology and Basic Questions About GIS
Terminology and Basic Questions About GISTerminology and Basic Questions About GIS
Terminology and Basic Questions About GISMrinmoy Majumder
 

Tendances (20)

Chap1 introduction to geographic information system (gis)
Chap1 introduction to geographic information system (gis)Chap1 introduction to geographic information system (gis)
Chap1 introduction to geographic information system (gis)
 
Gis
GisGis
Gis
 
Remote Sensing: Image Classification
Remote Sensing: Image ClassificationRemote Sensing: Image Classification
Remote Sensing: Image Classification
 
TYBSC IT PGIS Unit I Chapter II Geographic Information and Spacial Database
TYBSC IT PGIS Unit I Chapter II Geographic Information and Spacial DatabaseTYBSC IT PGIS Unit I Chapter II Geographic Information and Spacial Database
TYBSC IT PGIS Unit I Chapter II Geographic Information and Spacial Database
 
FINAL REPORT
FINAL REPORTFINAL REPORT
FINAL REPORT
 
Introduction To Geographical Information System (GIS)
Introduction To Geographical Information System (GIS) Introduction To Geographical Information System (GIS)
Introduction To Geographical Information System (GIS)
 
Data base management system
Data base management systemData base management system
Data base management system
 
Data managing and Exchange GDB
Data managing and Exchange GDB Data managing and Exchange GDB
Data managing and Exchange GDB
 
Digital image processing 1
Digital  image processing 1Digital  image processing 1
Digital image processing 1
 
QGIS Open Source Desktop GIS
QGIS Open Source Desktop GISQGIS Open Source Desktop GIS
QGIS Open Source Desktop GIS
 
Getting started with GIS
Getting started with GISGetting started with GIS
Getting started with GIS
 
GeoApps in the AWS Cloud - Jinesh Varia
GeoApps in the AWS Cloud - Jinesh VariaGeoApps in the AWS Cloud - Jinesh Varia
GeoApps in the AWS Cloud - Jinesh Varia
 
Introduction to ArcGIS 10.1
Introduction to ArcGIS 10.1Introduction to ArcGIS 10.1
Introduction to ArcGIS 10.1
 
6. Shapefiles in gis
6. Shapefiles in gis6. Shapefiles in gis
6. Shapefiles in gis
 
Introduction to GIS systems
Introduction to GIS systemsIntroduction to GIS systems
Introduction to GIS systems
 
GIS
GISGIS
GIS
 
Geographical information system
Geographical information systemGeographical information system
Geographical information system
 
Geographic information system
Geographic information system Geographic information system
Geographic information system
 
Digitizing features_2 in ARC GIS
Digitizing features_2 in ARC GISDigitizing features_2 in ARC GIS
Digitizing features_2 in ARC GIS
 
Terminology and Basic Questions About GIS
Terminology and Basic Questions About GISTerminology and Basic Questions About GIS
Terminology and Basic Questions About GIS
 

En vedette

Introducción a la geodatabase del SIOSE (II)
Introducción a la geodatabase del SIOSE (II)Introducción a la geodatabase del SIOSE (II)
Introducción a la geodatabase del SIOSE (II)Benito Zaragozí
 
Ozri 2013 Brisbane, Australia - Geodatabase Efficiencies
Ozri 2013 Brisbane, Australia - Geodatabase EfficienciesOzri 2013 Brisbane, Australia - Geodatabase Efficiencies
Ozri 2013 Brisbane, Australia - Geodatabase EfficienciesWalter Simonazzi
 
Null values, insert, delete and update in database
Null values, insert, delete and update in databaseNull values, insert, delete and update in database
Null values, insert, delete and update in databaseHemant Suthar
 
3D Web Services And Models For The Web: Where Do We Stand?
3D Web Services And Models For The Web: Where Do We Stand?3D Web Services And Models For The Web: Where Do We Stand?
3D Web Services And Models For The Web: Where Do We Stand?Camptocamp
 
Standard_Digital_Cadastral_Maps_2015_Adopted
Standard_Digital_Cadastral_Maps_2015_AdoptedStandard_Digital_Cadastral_Maps_2015_Adopted
Standard_Digital_Cadastral_Maps_2015_AdoptedMichael Prestridge
 
Tips for Manipulating Data in Esri Geodatabase using FME
Tips for Manipulating Data in Esri Geodatabase using FME Tips for Manipulating Data in Esri Geodatabase using FME
Tips for Manipulating Data in Esri Geodatabase using FME Safe Software
 
Introducción a la geodatabase del SIOSE (I)
Introducción a la geodatabase del SIOSE (I)Introducción a la geodatabase del SIOSE (I)
Introducción a la geodatabase del SIOSE (I)Benito Zaragozí
 
Digital cadaster in Bulgaria. Information system of cadaster and property reg...
Digital cadaster in Bulgaria. Information system of cadaster and property reg...Digital cadaster in Bulgaria. Information system of cadaster and property reg...
Digital cadaster in Bulgaria. Information system of cadaster and property reg...Geoskills+ Project
 
Oracle & sql server comparison 2
Oracle & sql server comparison 2Oracle & sql server comparison 2
Oracle & sql server comparison 2Mohsen B
 
Graduate Research Thesis Defense Presentation
Graduate Research Thesis Defense Presentation  Graduate Research Thesis Defense Presentation
Graduate Research Thesis Defense Presentation Johum Khushk
 
How to use R easily as GIS tools!
How to use R easily as GIS tools!How to use R easily as GIS tools!
How to use R easily as GIS tools!Omar F. Althuwaynee
 
Survey camp ii
Survey camp iiSurvey camp ii
Survey camp iiDraemmraj
 
Applications of Arc GIS
Applications of Arc GISApplications of Arc GIS
Applications of Arc GISExtraPDFs
 
Spatial Data in SQL Server
Spatial Data in SQL ServerSpatial Data in SQL Server
Spatial Data in SQL ServerEduardo Castro
 
raster data model
raster data modelraster data model
raster data modelRiya Gupta
 
WHAT'S THERE IN GEOMATICS ENGINEERING???
WHAT'S THERE IN GEOMATICS ENGINEERING???WHAT'S THERE IN GEOMATICS ENGINEERING???
WHAT'S THERE IN GEOMATICS ENGINEERING???Nepal Flying Labs
 
Arc gis introduction-ppt
Arc gis introduction-pptArc gis introduction-ppt
Arc gis introduction-pptAshok Peddi
 

En vedette (20)

Introducción a la geodatabase del SIOSE (II)
Introducción a la geodatabase del SIOSE (II)Introducción a la geodatabase del SIOSE (II)
Introducción a la geodatabase del SIOSE (II)
 
Ozri 2013 Brisbane, Australia - Geodatabase Efficiencies
Ozri 2013 Brisbane, Australia - Geodatabase EfficienciesOzri 2013 Brisbane, Australia - Geodatabase Efficiencies
Ozri 2013 Brisbane, Australia - Geodatabase Efficiencies
 
Null values, insert, delete and update in database
Null values, insert, delete and update in databaseNull values, insert, delete and update in database
Null values, insert, delete and update in database
 
Using unique and unusual archival records and data to illustrate and annotate...
Using unique and unusual archival records and data to illustrate and annotate...Using unique and unusual archival records and data to illustrate and annotate...
Using unique and unusual archival records and data to illustrate and annotate...
 
3D Web Services And Models For The Web: Where Do We Stand?
3D Web Services And Models For The Web: Where Do We Stand?3D Web Services And Models For The Web: Where Do We Stand?
3D Web Services And Models For The Web: Where Do We Stand?
 
Standard_Digital_Cadastral_Maps_2015_Adopted
Standard_Digital_Cadastral_Maps_2015_AdoptedStandard_Digital_Cadastral_Maps_2015_Adopted
Standard_Digital_Cadastral_Maps_2015_Adopted
 
Tips for Manipulating Data in Esri Geodatabase using FME
Tips for Manipulating Data in Esri Geodatabase using FME Tips for Manipulating Data in Esri Geodatabase using FME
Tips for Manipulating Data in Esri Geodatabase using FME
 
Curso de Geodatabase
Curso de Geodatabase Curso de Geodatabase
Curso de Geodatabase
 
Introducción a la geodatabase del SIOSE (I)
Introducción a la geodatabase del SIOSE (I)Introducción a la geodatabase del SIOSE (I)
Introducción a la geodatabase del SIOSE (I)
 
Digital cadaster in Bulgaria. Information system of cadaster and property reg...
Digital cadaster in Bulgaria. Information system of cadaster and property reg...Digital cadaster in Bulgaria. Information system of cadaster and property reg...
Digital cadaster in Bulgaria. Information system of cadaster and property reg...
 
Oracle & sql server comparison 2
Oracle & sql server comparison 2Oracle & sql server comparison 2
Oracle & sql server comparison 2
 
Arcgis training day_1
Arcgis training day_1Arcgis training day_1
Arcgis training day_1
 
Graduate Research Thesis Defense Presentation
Graduate Research Thesis Defense Presentation  Graduate Research Thesis Defense Presentation
Graduate Research Thesis Defense Presentation
 
How to use R easily as GIS tools!
How to use R easily as GIS tools!How to use R easily as GIS tools!
How to use R easily as GIS tools!
 
Survey camp ii
Survey camp iiSurvey camp ii
Survey camp ii
 
Applications of Arc GIS
Applications of Arc GISApplications of Arc GIS
Applications of Arc GIS
 
Spatial Data in SQL Server
Spatial Data in SQL ServerSpatial Data in SQL Server
Spatial Data in SQL Server
 
raster data model
raster data modelraster data model
raster data model
 
WHAT'S THERE IN GEOMATICS ENGINEERING???
WHAT'S THERE IN GEOMATICS ENGINEERING???WHAT'S THERE IN GEOMATICS ENGINEERING???
WHAT'S THERE IN GEOMATICS ENGINEERING???
 
Arc gis introduction-ppt
Arc gis introduction-pptArc gis introduction-ppt
Arc gis introduction-ppt
 

Similaire à Enterprise geodatabase sql access and administration

Evolution of Esri Data Formats Seminar
Evolution of Esri Data Formats SeminarEvolution of Esri Data Formats Seminar
Evolution of Esri Data Formats SeminarEsri South Africa
 
Presentation MIG-T GeoPackage.pdf
Presentation MIG-T GeoPackage.pdfPresentation MIG-T GeoPackage.pdf
Presentation MIG-T GeoPackage.pdfssusera932351
 
Spatial Data in SQL Server
Spatial Data in SQL ServerSpatial Data in SQL Server
Spatial Data in SQL ServerEduardo Castro
 
FOSS4G 2017 Spatial Sql for Rookies
FOSS4G 2017 Spatial Sql for RookiesFOSS4G 2017 Spatial Sql for Rookies
FOSS4G 2017 Spatial Sql for RookiesTodd Barr
 
Ch1.2_DB system Concepts and Architecture.pptx
Ch1.2_DB system Concepts and Architecture.pptxCh1.2_DB system Concepts and Architecture.pptx
Ch1.2_DB system Concepts and Architecture.pptx01fe20bcv092
 
Query editor for multi databases
Query editor for multi databasesQuery editor for multi databases
Query editor for multi databasesAarthi Raghavendra
 
Materi Geodatabase Management - Fellowship 2022.pdf
Materi Geodatabase Management - Fellowship 2022.pdfMateri Geodatabase Management - Fellowship 2022.pdf
Materi Geodatabase Management - Fellowship 2022.pdfsakinatunnajmi
 
Sqlite
SqliteSqlite
SqliteKumar
 
Relational
RelationalRelational
Relationaldieover
 
Evolution of the Graph Schema
Evolution of the Graph SchemaEvolution of the Graph Schema
Evolution of the Graph SchemaJoshua Shinavier
 
Dv Analytics Course Contents
Dv Analytics Course Contents Dv Analytics Course Contents
Dv Analytics Course Contents DV Analytics
 
Presentazione jrc 24 ottobre
Presentazione jrc 24 ottobrePresentazione jrc 24 ottobre
Presentazione jrc 24 ottobresmespire
 
Database and Java Database Connectivity
Database and Java Database ConnectivityDatabase and Java Database Connectivity
Database and Java Database ConnectivityGary Yeh
 

Similaire à Enterprise geodatabase sql access and administration (20)

Sql Server2008
Sql Server2008Sql Server2008
Sql Server2008
 
Evolution of Esri Data Formats Seminar
Evolution of Esri Data Formats SeminarEvolution of Esri Data Formats Seminar
Evolution of Esri Data Formats Seminar
 
tw_242.ppt
tw_242.ppttw_242.ppt
tw_242.ppt
 
Presentation MIG-T GeoPackage.pdf
Presentation MIG-T GeoPackage.pdfPresentation MIG-T GeoPackage.pdf
Presentation MIG-T GeoPackage.pdf
 
Spatial Data in SQL Server
Spatial Data in SQL ServerSpatial Data in SQL Server
Spatial Data in SQL Server
 
Bb geodatabase
Bb geodatabaseBb geodatabase
Bb geodatabase
 
FOSS4G 2017 Spatial Sql for Rookies
FOSS4G 2017 Spatial Sql for RookiesFOSS4G 2017 Spatial Sql for Rookies
FOSS4G 2017 Spatial Sql for Rookies
 
Ch1.2_DB system Concepts and Architecture.pptx
Ch1.2_DB system Concepts and Architecture.pptxCh1.2_DB system Concepts and Architecture.pptx
Ch1.2_DB system Concepts and Architecture.pptx
 
Query editor for multi databases
Query editor for multi databasesQuery editor for multi databases
Query editor for multi databases
 
Essentials of R
Essentials of REssentials of R
Essentials of R
 
Materi Geodatabase Management - Fellowship 2022.pdf
Materi Geodatabase Management - Fellowship 2022.pdfMateri Geodatabase Management - Fellowship 2022.pdf
Materi Geodatabase Management - Fellowship 2022.pdf
 
Cheetah:Data Warehouse on Top of MapReduce
Cheetah:Data Warehouse on Top of MapReduceCheetah:Data Warehouse on Top of MapReduce
Cheetah:Data Warehouse on Top of MapReduce
 
GIS.pdf
GIS.pdfGIS.pdf
GIS.pdf
 
Sqlite
SqliteSqlite
Sqlite
 
Relational
RelationalRelational
Relational
 
SQL on Hadoop
SQL on HadoopSQL on Hadoop
SQL on Hadoop
 
Evolution of the Graph Schema
Evolution of the Graph SchemaEvolution of the Graph Schema
Evolution of the Graph Schema
 
Dv Analytics Course Contents
Dv Analytics Course Contents Dv Analytics Course Contents
Dv Analytics Course Contents
 
Presentazione jrc 24 ottobre
Presentazione jrc 24 ottobrePresentazione jrc 24 ottobre
Presentazione jrc 24 ottobre
 
Database and Java Database Connectivity
Database and Java Database ConnectivityDatabase and Java Database Connectivity
Database and Java Database Connectivity
 

Dernier

Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 

Dernier (20)

Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 

Enterprise geodatabase sql access and administration

  • 1. Accessing and Administering your Enterprise Geodatabase through SQL and Python Brent Pierce @brent_pierce Russell Brennan @russellbrennan hashtag: #sqlpy
  • 2. Assumptions • Basic knowledge of SQL, Python and relational databases • Basic knowledge of the Geodatabase • We’ll hold all questions till end Please turn off cell phones
  • 3. What is the Geodatabase? • A physical store of geographic data - Scalable storage model supported on different platforms • Core ArcGIS information model - A comprehensive model for representing and managing GIS data - Implemented as a series of simple tables • A transactional model for managing GIS workflows • Set of components for accessing data
  • 4. Geodatabase is based on relational principles • The geodatabase is built on an extended relational database - Relational integrity - Reliability, Flexibility, Scalability - Supports continuous, large datasets - Standard relational database schema - Base short transaction model - Supports structured query language (SQL)
  • 5. Geodatabase is based on relational principles … • Leverages key DBMS principles and concepts to store geographic data as tables in a DBMS - Data is organized into tables - Tables contain rows - All rows in a table have the same attributes - Each attribute has a type - Relational integrity rules exist for tables
  • 6. Geodatabase is based on relational principles … • A feature class is stored as a simple DBMS table • Each row represents a feature • The fields in each row represent various characteristics or properties of the feature • One of the fields holds the feature geometry which is stored as a spatial type
  • 7. Geodatabase is based on relational principles … • A feature class is stored as a simple DBMS table • Each row represents a feature • The fields in each row represent various characteristics or properties of the feature • One of the fields holds the feature geometry which is stored as a spatial type
  • 8. Geodatabase Schema • There are two sets of tables - Dataset tables (user-defined tables) - Geodatabase system tables System tables XML User data SQL type
  • 9. User-defined tables - Stores the content of each dataset in the geodatabase • Datasets are stored in 1 or more tables • Spatial Types enhance the capabilities of the geodatabase - SQL access to geometry - Industry standard storage model and API System tables XML User data SQL type
  • 10. Geodatabase system tables • System tables store definitions, rules, and behavior for datasets • Tracks contents within a geodatabase • 4 primary tables • Geodatabase schema is stored within an XML field System tables XML User data SQL type
  • 11. Geodatabase Schema… System tables XML User data SQL type
  • 12. Geodatabase Schema… System tables XML User data SQL type
  • 13. Geodatabase Schema… System tables XML User data SQL type
  • 14. Geodatabase Schema… System tables XML User data SQL type
  • 15. Geodatabase Schema… System tables XML User data SQL type
  • 16. What is a spatial type? • A spatial type (ST_Geometry) is a type that stores geometry data in a single spatial attribute - Geometry type, coordinates, dimension, spatial reference • Spatial Index - Access path for quick retrieval • Relational and geometry operators and Functions - Constructors - Accessor - Relational - Geometry
  • 17. What are the benefits of a spatial type? • Efficiency - Spatial data and methods are stored in the database - Applications access native dbms type • Accessed using common API’s and SQL - C, C++, C#, Java - Adheres to standards for SQL access
  • 18. What are the benefits of a spatial type? • Using SQL with a spatial type you can - Create tables with a spatial attributes - Read and analyze the spatial data - Insert, update, and delete simple features Spatial Type SQL
  • 19. Accessing Geodatabase through SQL • Access schema and properties of existing datasets - Use SQL statements and XPath queries to query the definition attribute on the gdb_items table • Editing tables/feature classes, whether versioned or not - Versioned classes are edited through versioned views • Create tables with SQL containing spatial types • Leverage SQL functions to evaluate attributes and spatial relationships, perform spatial operations, and return, set spatial properties
  • 20. Accessing Geodatabase through SQL • With SQL accessing the data at the DBMS level - Bypass behaviors and functionality Python enforced by the geodatabase or ArcGIS clients • Need to be aware of what you can ArcGIS and cannot edit - Relationship classes - Geometric networks SQL Geodatabase - Topology… DBMS
  • 21. Accessing Geodatabase through SQL • One can use SQL to create, insert and update tables - Need to register the table with the geodatabase to participate in geodatabase functionality CREATE TABLE hazardous_sites (oid INTEGER NOT NULL, site_id INTEGER, name VARCHAR(40), location sde.st_geometry) • Cannot modify schema of registered tables (i.e add a field) or create geodatabase items (i.e domains) through SQL
  • 22. Accessing Geodatabase through SQL • Editing feature classes with SQL - Points, lines, polygons (single or multipart) - Ability to modify geometry when stored as a spatial type - Without geodatabase behavior - Not part of topology, geometric network, etc… • Editing tables/feature classes - Use SQL statements - Directly editing the database tables (no delta tables) - Nonversioned editing in ArcGIS terminology • Editing versioned tables/feature classes - Requires versioned views
  • 23. Editing tables/feature classes • Can use SQL to update, insert and delete data from tables that are not versioned • Can leverage DBMS functionality - Unique indexes, constraints, referential integrity, default values, triggers • Requires a unique identifier (ObjectID) when inserting - Used to uniquely identify rows in tables in a geodatabase - Obtained from classes sequence or procedure - Object ID is used by ArcGIS to do such things as display selection sets and perform identify operations on features
  • 24. Editing versioned tables/feature classes • Use versioned views - Versioned Views are automatically created when class is registered as versioned • Perform edits within the new version SELECT sde.sde_edit_version('WorkOrder1701',1); - Unlike non-versioned editing, ObjectID values for new records are automatically generated - Changes are made to the delta tables - Versions must be reconciled through ArcGIS
  • 26. Geodatabase Administration with Python Russell Brennan
  • 27. Second Half Agenda • Why use Python? • Tips for using Python with geodatabases • Demo: Creating geodatabase schema • Demo: Performing geodatabase maintenance • Demo: Publishing
  • 28. Why use Python for Administration? • Numerous tools available - Schema creation and administration - Maintenance • Cross platform. • Easy access to complex behavior. • Easy to schedule tasks.
  • 29. Using Python to access your geodatabase • Connection files. - Create Database Connection tool. • Version access is defined in the connection file. • Connected user is defined in the connection file. • Multiple connections = multiple connection files.
  • 31. Demo 1: Creating a geodatabase • Create an enterprise geodatabase. • Create database roles. • Create users. • Create schema. • Apply privileges. • Register data as versioned. • Create edit versions.
  • 33. Demo 2: Geodatabase Maintenance • Blocking and accepting connections • Disconnecting users. • Reconcile/Post versions • Compress database • Updating statistics and indexes • Email notifications • Scheduling
  • 35. Publishing • Creating a script tool • Publishing using the geoprocessing framework • Consuming the tool
  • 36. Slide Deck http://www.slideshare.net/brentpierce/enterprise- geodatabase-sql-access-and-administration
  • 37. Thanks for attending Questions? Please fill out session surveys www.esri.com/sessionevals