Skip to content

Instantly share code, notes, and snippets.

@karzak
Created February 7, 2017 19:07
Show Gist options
  • Save karzak/555cd200ec33fda65da3a479d9808c3b to your computer and use it in GitHub Desktop.
Save karzak/555cd200ec33fda65da3a479d9808c3b to your computer and use it in GitHub Desktop.
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<div style=\"text-align: right\"> <b>Kevin Davis<br>USDA-APHIS-PPQ-ALB Worcester<br>2/7/2017<b> </div>"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Davey Roam GDB Sample\n",
"\n",
"#### GroundSurveyNegative sample from 2/7/2017"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"import arcpy, os\n",
"gdb = r'D:\\GIS_Data\\Davey_Roam_Testing\\Geodatabase_Samples\\sample_gdb_02072017.gdb'"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"[u'GroundSurveyNegative']"
]
},
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"arcpy.env.workspace = gdb\n",
"\n",
"arcpy.ListFeatureClasses()"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"fc = 'GroundSurveyNegative'"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"OBJECTID, OID, 4\n",
"Shape, Geometry, 0\n",
"species, String, 254\n",
"dbh, String, 254\n",
"inspection, String, 254\n",
"manicured, String, 254\n",
"inventory, String, 254\n",
"public, String, 254\n",
"hazard_pre, String, 254\n",
"hazard_typ, String, 254\n",
"resurvey_n, String, 254\n",
"toughpad_u, String, 254\n",
"inspecti_1, String, 254\n",
"std_locati, String, 254\n",
"ext_locati, String, 254\n",
"std_tree_c, String, 254\n",
"ext_tree_c, String, 254\n",
"picpath1, String, 254\n",
"picture1, String, 254\n",
"picpath2, String, 254\n",
"picture2, String, 254\n",
"inspecti_2, Date, 8\n",
"resurvey_r, String, 254\n",
"resurvey_o, String, 254\n",
"resurvey_m, String, 254\n",
"resurvey_t, String, 254\n",
"resurvey_i, String, 254\n",
"resurvey_1, String, 254\n",
"resurvey_c, String, 254\n",
"resurvey_d, Date, 8\n",
"pp_address, String, 254\n",
"pp_parcel_, String, 254\n",
"pp_azu, String, 254\n",
"pp_city, String, 254\n",
"pp_state, String, 254\n",
"pp_zip, String, 254\n",
"pp_survey_, String, 254\n",
"pp_resurve, String, 254\n",
"pp_survey1, String, 254\n",
"pp_timesta, Date, 8\n",
"record_uid, String, 50\n",
"record__ti, Date, 8\n",
"flagged, String, 254\n",
"reason_fla, String, 254\n",
"marked_for, String, 254\n",
"data_quali, String, 254\n",
"data_qa_st, String, 254\n",
"data_qa_co, String, 254\n",
"data_qa_ti, Date, 8\n",
"gdb_timest, Date, 8\n",
"uniqueid, String, 50\n"
]
}
],
"source": [
"# Look at the field names and types\n",
"for field in arcpy.Describe(fc).fields:\n",
" print \"{}, {}, {}\".format(field.name, field.type, field.length)"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"ALB_fc = r'I:/ROAM_Data/GDBs/MA_Staging.gdb/GroundSurveyNegative'"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"OBJECTID, OID, 4\n",
"Shape, Geometry, 0\n",
"species, String, 255\n",
"dbh, Double, 8\n",
"inspection_result, String, 255\n",
"manicured, String, 10\n",
"inventory, String, 10\n",
"public, String, 10\n",
"hazard_present, String, 10\n",
"hazard_type, String, 256\n",
"resurvey_needed, String, 10\n",
"inspection_org, String, 255\n",
"inspection_method, String, 255\n",
"toughpad_user, String, 255\n",
"inspection_staff, String, 256\n",
"std_location_comments, String, 256\n",
"ext_location_comments, String, 256\n",
"std_tree_comments, String, 256\n",
"ext_tree_comments, String, 256\n",
"picpath1, String, 256\n",
"picture1, String, 255\n",
"picpath2, String, 256\n",
"picture2, String, 255\n",
"inspection_date, Date, 8\n",
"resurvey_result, String, 255\n",
"resurvey_org, String, 255\n",
"resurvey_method, String, 255\n",
"resurvey_toughpad_user, String, 255\n",
"resurvey_inspection_staff, String, 256\n",
"resurvey_issue, String, 256\n",
"resurvey_comments, String, 256\n",
"resurvey_date, Date, 8\n",
"pp_address, String, 256\n",
"pp_parcel_id, String, 255\n",
"pp_azu, String, 255\n",
"pp_city, String, 255\n",
"pp_state, String, 20\n",
"pp_zip, String, 20\n",
"pp_survey_group, String, 255\n",
"pp_resurvey_group, String, 255\n",
"pp_survey_cycle, String, 255\n",
"pp_timestamp, Date, 8\n",
"record_uid, String, 255\n",
"record_timestamp, Date, 8\n",
"flagged, String, 255\n",
"reason_flagged, String, 256\n",
"marked_for_deletion, String, 255\n",
"data_quality_assured, String, 255\n",
"data_qa_staff, String, 255\n",
"data_qa_comments, String, 256\n",
"data_qa_timestamp, Date, 8\n",
"gdb_timestamp, Date, 8\n"
]
}
],
"source": [
"# Compare to feature class in Worcester ALB ROAM geodatabase\n",
"for field in arcpy.Describe(ALB_fc).fields:\n",
" print \"{}, {}, {}\".format(field.name, field.type, field.length)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Issues (beyond what was stated in the email)\n",
"\n",
"* DBH should be field type DOUBLE"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 2",
"language": "python",
"name": "python2"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.8"
}
},
"nbformat": 4,
"nbformat_minor": 1
}
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<div style=\"text-align: right\"> <b>Kevin Davis<br>USDA-APHIS-PPQ-ALB Worcester<br>2/7/2017<b> </div>"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Davey Roam GDB Sample\n",
"\n",
"#### GroundSurveyNegative sample from 2/7/2017"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"import arcpy, os\n",
"gdb = r'D:\\GIS_Data\\Davey_Roam_Testing\\Geodatabase_Samples\\sample_gdb_02072017.gdb'"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"[u'GroundSurveyNegative']"
]
},
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"arcpy.env.workspace = gdb\n",
"\n",
"arcpy.ListFeatureClasses()"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"fc = 'GroundSurveyNegative'"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"OBJECTID, OID, 4\n",
"Shape, Geometry, 0\n",
"species, String, 254\n",
"dbh, String, 254\n",
"inspection, String, 254\n",
"manicured, String, 254\n",
"inventory, String, 254\n",
"public, String, 254\n",
"hazard_pre, String, 254\n",
"hazard_typ, String, 254\n",
"resurvey_n, String, 254\n",
"toughpad_u, String, 254\n",
"inspecti_1, String, 254\n",
"std_locati, String, 254\n",
"ext_locati, String, 254\n",
"std_tree_c, String, 254\n",
"ext_tree_c, String, 254\n",
"picpath1, String, 254\n",
"picture1, String, 254\n",
"picpath2, String, 254\n",
"picture2, String, 254\n",
"inspecti_2, Date, 8\n",
"resurvey_r, String, 254\n",
"resurvey_o, String, 254\n",
"resurvey_m, String, 254\n",
"resurvey_t, String, 254\n",
"resurvey_i, String, 254\n",
"resurvey_1, String, 254\n",
"resurvey_c, String, 254\n",
"resurvey_d, Date, 8\n",
"pp_address, String, 254\n",
"pp_parcel_, String, 254\n",
"pp_azu, String, 254\n",
"pp_city, String, 254\n",
"pp_state, String, 254\n",
"pp_zip, String, 254\n",
"pp_survey_, String, 254\n",
"pp_resurve, String, 254\n",
"pp_survey1, String, 254\n",
"pp_timesta, Date, 8\n",
"record_uid, String, 50\n",
"record__ti, Date, 8\n",
"flagged, String, 254\n",
"reason_fla, String, 254\n",
"marked_for, String, 254\n",
"data_quali, String, 254\n",
"data_qa_st, String, 254\n",
"data_qa_co, String, 254\n",
"data_qa_ti, Date, 8\n",
"gdb_timest, Date, 8\n",
"uniqueid, String, 50\n"
]
}
],
"source": [
"# Look at the field names and types\n",
"for field in arcpy.Describe(fc).fields:\n",
" print \"{}, {}, {}\".format(field.name, field.type, field.length)"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"ALB_fc = r'I:/ROAM_Data/GDBs/MA_Staging.gdb/GroundSurveyNegative'"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"OBJECTID, OID, 4\n",
"Shape, Geometry, 0\n",
"species, String, 255\n",
"dbh, Double, 8\n",
"inspection_result, String, 255\n",
"manicured, String, 10\n",
"inventory, String, 10\n",
"public, String, 10\n",
"hazard_present, String, 10\n",
"hazard_type, String, 256\n",
"resurvey_needed, String, 10\n",
"inspection_org, String, 255\n",
"inspection_method, String, 255\n",
"toughpad_user, String, 255\n",
"inspection_staff, String, 256\n",
"std_location_comments, String, 256\n",
"ext_location_comments, String, 256\n",
"std_tree_comments, String, 256\n",
"ext_tree_comments, String, 256\n",
"picpath1, String, 256\n",
"picture1, String, 255\n",
"picpath2, String, 256\n",
"picture2, String, 255\n",
"inspection_date, Date, 8\n",
"resurvey_result, String, 255\n",
"resurvey_org, String, 255\n",
"resurvey_method, String, 255\n",
"resurvey_toughpad_user, String, 255\n",
"resurvey_inspection_staff, String, 256\n",
"resurvey_issue, String, 256\n",
"resurvey_comments, String, 256\n",
"resurvey_date, Date, 8\n",
"pp_address, String, 256\n",
"pp_parcel_id, String, 255\n",
"pp_azu, String, 255\n",
"pp_city, String, 255\n",
"pp_state, String, 20\n",
"pp_zip, String, 20\n",
"pp_survey_group, String, 255\n",
"pp_resurvey_group, String, 255\n",
"pp_survey_cycle, String, 255\n",
"pp_timestamp, Date, 8\n",
"record_uid, String, 255\n",
"record_timestamp, Date, 8\n",
"flagged, String, 255\n",
"reason_flagged, String, 256\n",
"marked_for_deletion, String, 255\n",
"data_quality_assured, String, 255\n",
"data_qa_staff, String, 255\n",
"data_qa_comments, String, 256\n",
"data_qa_timestamp, Date, 8\n",
"gdb_timestamp, Date, 8\n"
]
}
],
"source": [
"# Compare to feature class in Worcester ALB ROAM geodatabase\n",
"for field in arcpy.Describe(ALB_fc).fields:\n",
" print \"{}, {}, {}\".format(field.name, field.type, field.length)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Issues (beyond what was stated in the email)\n",
"\n",
"* DBH should be field type DOUBLE"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 2",
"language": "python",
"name": "python2"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.8"
}
},
"nbformat": 4,
"nbformat_minor": 1
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment