Select to view content in your preferred language

Getting Extents of Runtime geodatabse

3471
7
Jump to solution
01-04-2016 08:13 PM
Bhargav_KumarK
Emerging Contributor

I created runtime geodatabase in Arc GIS Desktop and using in Arc GIS Qt application. One of my requirements is that I need to get extents of this runtime geodatabase, how to achieve this?  When I created feature layer from run time geodatabase and printing its extent it is giving total extent of map

but not only the extent of  geodatabase.

Regards,

Bhargav

0 Kudos
1 Solution

Accepted Solutions
LucasDanzinger
Esri Frequent Contributor

It works for me. Here is my code. Maybe you can try this and see if it works for you?

import QtQuick 2.3
import QtQuick.Controls 1.2
import ArcGIS.Extras 1.0
import ArcGIS.Runtime 10.26


ApplicationWindow {
    width: 500
    height: 500


    Map {
        anchors.fill: parent


        FeatureLayer {
            featureTable: gdbFeatureTable
        }
    }


    Geodatabase {
        id: gdb
        path: "~/ArcGIS/Runtime/Data/BirdSightings.geodatabase"
    }


    GeodatabaseFeatureTable {
        id: gdbFeatureTable
        geodatabase: gdb.valid ? gdb : null
        featureServiceLayerId: 0


        onGeodatabaseFeatureTableValidChanged: {
            console.log("Gdb feature table is initialized.")
            console.log(JSON.stringify(gdbFeatureTable.extent.json))
        }
    }
}













View solution in original post

0 Kudos
7 Replies
LucasDanzinger
Esri Frequent Contributor

Bhargav-

The extent shouldn't be on the Geodatabase itself, but rather on one of it its feature tables. Maybe once you load the feature layer with one of the feature tables, instead of printing out the extent of the feature layer, you print out the extent of the feature table.

Thanks,

Luke

0 Kudos
Bhargav_KumarK
Emerging Contributor

When I am printing extent on feature table it is not giving valid output. It is giving 'nan'  if I am printing any extent values of feature table.

0 Kudos
LucasDanzinger
Esri Frequent Contributor

Hmm, I am printing out the extent no problem with the Damage Inspection geodatabase that comes in the SDK sample data folder. Maybe you could try using some sample data to determine if it is an issue with the code or with the data somehow.

-Luke

0 Kudos
Bhargav_KumarK
Emerging Contributor

I am also getting extents printed with Damage Inspection geodatabase. So the problem is with my data. How to create runtime geodatabase such that I get extents in Qt Application? In my case while creating geodatabase, it has extents. One more thing is that what ever the extents I am getting for Damage Inspection geodatabase in Qt Application they  are not matching with values I saw for Damage Inspection geodatabase in Arc GIS Desktop.

0 Kudos
LucasDanzinger
Esri Frequent Contributor

I'm not sure why there is a difference. Maybe you can try re-creating your geodatabase and see if it works? Otherwise, it could be a data specific bug that we are not aware of. Perhaps you could contact support and troubleshoot this with them?

ZdeněkJankovský
Esri Contributor

Hi all,

is there something new in this?

I have offline *.geodatabase package exported from ArcGIS Desktop 10.3.1 and reading the featureTable Extent in AppStudio with:

var table = gdbModel.geodatabaseFeatureTableByLayerId(j);
...
var extent = table.extent.clone();

give me the nan values as well.

Thank you,

Zdenek J.

0 Kudos
LucasDanzinger
Esri Frequent Contributor

It works for me. Here is my code. Maybe you can try this and see if it works for you?

import QtQuick 2.3
import QtQuick.Controls 1.2
import ArcGIS.Extras 1.0
import ArcGIS.Runtime 10.26


ApplicationWindow {
    width: 500
    height: 500


    Map {
        anchors.fill: parent


        FeatureLayer {
            featureTable: gdbFeatureTable
        }
    }


    Geodatabase {
        id: gdb
        path: "~/ArcGIS/Runtime/Data/BirdSightings.geodatabase"
    }


    GeodatabaseFeatureTable {
        id: gdbFeatureTable
        geodatabase: gdb.valid ? gdb : null
        featureServiceLayerId: 0


        onGeodatabaseFeatureTableValidChanged: {
            console.log("Gdb feature table is initialized.")
            console.log(JSON.stringify(gdbFeatureTable.extent.json))
        }
    }
}













0 Kudos