Following is a query to determine the Centroid of EOs which can be run in Query Builder and exported to the desired output file type:
SELECT EO.EO_ID, EO.SHAPE_ID, SCIENTIFIC_NAME.SCIENTIFIC_NAME, SPATATT_LATITUDE.ATTRIBUTE_VALUE AS LATITUDE, SPATATT_LONGITUDE.ATTRIBUTE_VALUE AS LONGITUDE
FROM EO, SPATIAL_ATTRIBUTE SPATATT_LATITUDE, SPATIAL_ATTRIBUTE SPATATT_LONGITUDE, ELEMENT_SUBNATIONAL,SCIENTIFIC_NAME
WHERE EO.ELEMENT_SUBNATIONAL_ID=ELEMENT_SUBNATIONAL.ELEMENT_SUBNATIONAL_ID
and ELEMENT_SUBNATIONAL.SNAME_ID=SCIENTIFIC_NAME.SCIENTIFIC_NAME_ID
and EO.SHAPE_ID = SPATATT_LATITUDE.FEATURE_ID(+)
and SPATATT_LATITUDE.ATTRIBUTE_NAME='LATITUDE_DD'
and EO.SHAPE_ID = SPATATT_LONGITUDE.FEATURE_ID(+)
and SPATATT_LONGITUDE.ATTRIBUTE_NAME='LONGITUDE_DD'
Centroid is not calculated for Source Features by default. You can add that as a spatial attribute that you would like calculated for each of the SF Point, Lines, and Polygons by running the following statements in sqlplus, Tora, Toad, or SQL Developer, while logged in as the biotics_dlink user:
INSERT INTO "BIOTICS_USER"."AD_CALC_SPAT_ATT" (AD_CALC_SPAT_ATT_ID, FEATURE_CODE, ATTRIBUTE_NAME, UPDATE_SHAPEFILE, UPDATE_PBARC_COMM, SCRIPT_NAME, MANDATORY) VALUES (getnextseq('AD_CALC_SPAT_ATT '), '1008', 'Centroid', 'F', 'T', 'LGI.BioticsCalcCoordinates', 'N');
INSERT INTO "BIOTICS_USER"."AD_CALC_SPAT_ATT" (AD_CALC_SPAT_ATT_ID, FEATURE_CODE, ATTRIBUTE_NAME, UPDATE_SHAPEFILE, UPDATE_PBARC_COMM, SCRIPT_NAME, MANDATORY) VALUES (getnextseq('AD_CALC_SPAT_ATT '), '1009', 'Centroid', 'F', 'T', 'LGI.BioticsCalcCoordinates', 'N');
INSERT INTO "BIOTICS_USER"."AD_CALC_SPAT_ATT" (AD_CALC_SPAT_ATT_ID, FEATURE_CODE, ATTRIBUTE_NAME, UPDATE_SHAPEFILE, UPDATE_PBARC_COMM, SCRIPT_NAME, MANDATORY) VALUES (getnextseq('AD_CALC_SPAT_ATT '), '1007', 'Centroid', 'F', 'T', 'LGI.BioticsCalcCoordinates', 'N');
commit;
INSERT INTO "BIOTICS_USER"."AD_CALC_SPAT_ATT" (AD_CALC_SPAT_ATT_ID, FEATURE_CODE, ATTRIBUTE_NAME, UPDATE_SHAPEFILE, UPDATE_PBARC_COMM, SCRIPT_NAME, MANDATORY) VALUES (getnextseq('AD_CALC_SPAT_ATT '), '1009', 'Centroid', 'F', 'T', 'LGI.BioticsCalcCoordinates', 'N');
INSERT INTO "BIOTICS_USER"."AD_CALC_SPAT_ATT" (AD_CALC_SPAT_ATT_ID, FEATURE_CODE, ATTRIBUTE_NAME, UPDATE_SHAPEFILE, UPDATE_PBARC_COMM, SCRIPT_NAME, MANDATORY) VALUES (getnextseq('AD_CALC_SPAT_ATT '), '1007', 'Centroid', 'F', 'T', 'LGI.BioticsCalcCoordinates', 'N');
commit;
Once the spatial attributes are defined by running those statements, the next step is to Recalculate spatial attributes for the Centroid attribute for Source Feature Point, Source Feature Line, and Source Feature Polygon. Given the number of source features, we recommend you do these separately, overnight, and only for the Centroid attribute, not all attributes.
After the spatial attributes have been calculated, in Query Builder, run the following query to get the lat, long values for the Source Feature Centroids and export to the desired output file type:
SELECT SOURCE_FEATURE.SHAPE_ID, SOURCE_FEATURE.SOURCE_FEATURE_ID, SCIENTIFIC_NAME.SCIENTIFIC_NAME, SPATATT_LATITUDE.ATTRIBUTE_VALUE AS LATITUDE, SPATATT_LONGITUDE.ATTRIBUTE_VALUE AS LONGITUDE
FROM SOURCE_FEATURE, SPATIAL_ATTRIBUTE SPATATT_LATITUDE, SPATIAL_ATTRIBUTE SPATATT_LONGITUDE, ELEMENT_SUBNATIONAL,SCIENTIFIC_NAME
WHERE SOURCE_FEATURE.ELEMENT_SUBNATIONAL_ID=ELEMENT_SUBNATIONAL.ELEMENT_SUBNATIONAL_ID
and ELEMENT_SUBNATIONAL.SNAME_ID=SCIENTIFIC_NAME.SCIENTIFIC_NAME_ID
and SOURCE_FEATURE.SHAPE_ID = SPATATT_LATITUDE.FEATURE_ID(+)
and SPATATT_LATITUDE.ATTRIBUTE_NAME='LATITUDE_DD'
and SOURCE_FEATURE.SHAPE_ID = SPATATT_LONGITUDE.FEATURE_ID(+)
and SPATATT_LONGITUDE.ATTRIBUTE_NAME='LONGITUDE_DD'
FROM SOURCE_FEATURE, SPATIAL_ATTRIBUTE SPATATT_LATITUDE, SPATIAL_ATTRIBUTE SPATATT_LONGITUDE, ELEMENT_SUBNATIONAL,SCIENTIFIC_NAME
WHERE SOURCE_FEATURE.ELEMENT_SUBNATIONAL_ID=ELEMENT_SUBNATIONAL.ELEMENT_SUBNATIONAL_ID
and ELEMENT_SUBNATIONAL.SNAME_ID=SCIENTIFIC_NAME.SCIENTIFIC_NAME_ID
and SOURCE_FEATURE.SHAPE_ID = SPATATT_LATITUDE.FEATURE_ID(+)
and SPATATT_LATITUDE.ATTRIBUTE_NAME='LATITUDE_DD'
and SOURCE_FEATURE.SHAPE_ID = SPATATT_LONGITUDE.FEATURE_ID(+)
and SPATATT_LONGITUDE.ATTRIBUTE_NAME='LONGITUDE_DD'