Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Layername conversion fix #5767

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -196,3 +196,4 @@ hoot.env
.bash_history
.config
.npm
.vscode
2 changes: 1 addition & 1 deletion hoot-ui-2x
42 changes: 21 additions & 21 deletions scripts/jenkins/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ pipeline {
booleanParam(name: 'Services_tests', defaultValue: true)
booleanParam(name: 'UI_hoot1_tests', defaultValue: true)
booleanParam(name: 'UI_hoot2_tests', defaultValue: true)
booleanParam(name: 'Sonar', defaultValue: false)
// booleanParam(name: 'Sonar', defaultValue: false)
booleanParam(name: 'Halt_on_failure', defaultValue: true)
string(name: 'Box', defaultValue: 'hoot_centos7', description: 'Vagrant Box')
string(name: 'HOOT_AWS_ENV_TAG', defaultValue: 'testing')
Expand Down Expand Up @@ -104,26 +104,26 @@ pipeline {
sh "vagrant ssh ${params.Box} -c 'cd hoot; source ./SetupEnv.sh; ./scripts/TestConfigure.sh &> Hoot_Config_Test || { cat Hoot_Config_Test; false; }'"
}
}
stage("Sonar Config") {
when {
anyOf {
// Configure for sonar if user selected it, pull-request, or nightly run of master
expression { return params.Sonar }
changeRequest()
allOf {
triggeredBy 'TimerTrigger'
branch 'master'
}
}
}
steps {
sh "vagrant ssh ${params.Box} -c 'cd hoot; ./scripts/sonar/sonar-install.sh'"
// Compile with build watcher to allow for sonar scanning in subsequent steps
sh "sed -i 's/^make \$SILENT_MAKE -j\$(nproc)\$/build-wrapper-linux-x86-64 --out-dir bw-output make \$SILENT_MAKE -j\$(nproc)/' VagrantBuild.sh"
// Until PCH support is fixed in Sonar, run this to fix
sh "sed -i 's|^make \$SILENT_MAKE clean|make \$SILENT_MAKE clean\\n./scripts/sonar/sonar-prep-makefile.sh|g' VagrantBuild.sh"
}
}
// stage("Sonar Config") {
// when {
// anyOf {
// // Configure for sonar if user selected it, pull-request, or nightly run of master
// expression { return params.Sonar }
// changeRequest()
// allOf {
// triggeredBy 'TimerTrigger'
// branch 'master'
// }
// }
// }
// steps {
// sh "vagrant ssh ${params.Box} -c 'cd hoot; ./scripts/sonar/sonar-install.sh'"
// // Compile with build watcher to allow for sonar scanning in subsequent steps
// sh "sed -i 's/^make \$SILENT_MAKE -j\$(nproc)\$/build-wrapper-linux-x86-64 --out-dir bw-output make \$SILENT_MAKE -j\$(nproc)/' VagrantBuild.sh"
// // Until PCH support is fixed in Sonar, run this to fix
// sh "sed -i 's|^make \$SILENT_MAKE clean|make \$SILENT_MAKE clean\\n./scripts/sonar/sonar-prep-makefile.sh|g' VagrantBuild.sh"
// }
// }
stage("Configure Coverage") {
when {
anyOf {
Expand Down
22 changes: 20 additions & 2 deletions scripts/schema/ConvertMGCPSchema_XML.py
Original file line number Diff line number Diff line change
Expand Up @@ -488,13 +488,31 @@ def addExtra(schema):
{'name':'Boundaries','value':'9'}, {'name':'Waterbodies','value':'10'}, {'name':'Maritime','value':'11'}
]

schema['PZD040'] = {}
schema['PZD040'] = {'name':'PZD040','fcode':'ZD040','desc':'Text Point','geom':'Point','fcsubtype':'','fdname':'MGCP_Delta','thematic':'TextP'}
schema['PZD040']['columns'] = {}
schema['PZD040']['columns']['FCSubtype'] = {'name':'FCSubtype','desc':'Feature Class Subtype','optional':'R','definition':'A feature class subtype placeholder to avoid non-nullable field.','type':'String','defValue':''}
schema['PZD040']['columns']['NAM'] = {'name':'NAM','desc':'Name','optional':'R','type':'String','defValue':'UNK'}
schema['PZD040']['columns']['NFI'] = {'name':'NFI','desc':'Named Feature Identifier','optional':'R','type':'String','defValue':'N_A'}
schema['PZD040']['columns']['NFN'] = {'name':'NFN','desc':'Name Identifier','optional':'R','type':'String','defValue':'N_A'}
schema['PZD040']['columns']['ORD'] = {'name':'ORD','desc':'Relative Importance','optional':'R','type':'enumeration','defValue':'1'}
schema['PZD040']['columns']['ORD']['enum'] = [{'name':'First','value':'1'}, {'name':'Second','value':'2'},
{'name':'Third','value':'3'}, {'name':'Fourth','value':'4'}, {'name':'Fifth','value':'5'}
]
schema['PZD040']['columns']['THC'] = {'name':'THC','desc':'Thematic Classification','optional':'R','type':'enumeration','defValue':'1'}
schema['PZD040']['columns']['THC']['enum'] = [{'name':'Aeronautical','value':'1'}, {'name':'Vegetation','value':'2'},
{'name':'Utilities','value':'3'}, {'name':'Population','value':'4'}, {'name':'Physiography','value':'5'},
{'name':'Industry','value':'6'}, {'name':'Ground Transportation','value':'7'}, {'name':'Elevation','value':'8'},
{'name':'Boundaries','value':'9'}, {'name':'Waterbodies','value':'10'}, {'name':'Maritime','value':'11'}
]

# Add the missing attributes of features that had the default values being overwritten to null
schema['PAL130']['columns']['AOO'] = {'name':"AOO",'desc':"Angle of Orientation",'optional':"R",'units':"Degree",'definition':"The angular distance in the horizontal plane measured from true north (0 degrees) clockwise to the major axis of the feature. ( If the feature is square, the axis 0 up to 90 degrees is recorded. If the feature is circular, 360 degrees is recorded. )",'type':"Real",'defValue':"-32767.0"}



# Add the common attributes to each feature
for i in ['LCA010','PCA030','PCA035','LFA000','LFA110','LFC021','PZB050','PZD045','AFA002','AFA003']:
for i in ['LCA010','PCA030','PCA035','LFA000','LFA110','LFC021','PZB050','PZD040','PZD045','AFA002','AFA003']:
schema[i]['columns']['FCODE'] = {'name':'FCODE','desc':'Feature Code','type':'String','optional':'R','defValue':''}
schema[i]['columns']['ACC'] = {'name':'ACC','desc':'Horizontal Accuracy Category','type':'enumeration','optional':'R','defValue':'1','func':'full_ACC'}
schema[i]['columns']['ACC']['enum'] = [{'name':"Accurate",'value':"1"}, {'name':"Approximate",'value':"2"}]
Expand Down Expand Up @@ -602,7 +620,7 @@ def readFeatures(xmlDoc,funcList):
'AEC030':'TreesA','LEA020':'TreesL','LEC030':'TreesL','PEC030':'TreesP','ABJ110':'TundraA','AAQ130':'TunnelA',
'LAQ130':'TunnelL','PAJ051':'UtilP','PAT042':'UtilP','AZD020':'VoidA','ABH020':'WatrcrsA','ABH030':'WatrcrsA',
'ABH140':'WatrcrsA','LBH020':'WatrcrsL','LBH030':'WatrcrsL','LBH140':'WatrcrsL','PAA050':'WellsprP',
'PBH170':'WellsprP','LZD040':'AnnoL','LZD045':'AnnoL','PZD045':'AnnoP','PZD040':'AnnoP','LCA010':'ContourL',
'PBH170':'WellsprP','LZD040':'AnnoL','LZD045':'AnnoL','PZD045':'AnnoP','LCA010':'ContourL',
'PCA030':'ElevP','PCA035':'ElevP','PZB050':'ElevP','AFA002':'PolbndA','AFA003':'PolbndA','LFA000':'PolbndL',
'LFA110':'PolbndL','LFC021':'PolbndL'}

Expand Down
4 changes: 2 additions & 2 deletions translations/emgcp_osm_rules.js

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions translations/emgcp_rules.js

Large diffs are not rendered by default.

22 changes: 21 additions & 1 deletion translations/mgcp.js
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,8 @@ mgcp = {
['GB030', ['gb030']], // Helipad
['GB040', ['gb040']], // Launch Pad
['SU001', ['su001']], // Military Installation
['ZD040', ['zd040']], // Annotated Location
['ZD040', ['zd040']], // Text
['ZD045', ['zd045', 'annop', 'anno_p']] // Annotation
];
// Funky but it makes life easier
var llayerName = layerName.toString().toLowerCase();
Expand Down Expand Up @@ -684,6 +685,7 @@ mgcp = {
}
}


}, // End of applyToOsmPreProcessing

// Post Processing: Lots of cleanup
Expand Down Expand Up @@ -1293,6 +1295,12 @@ mgcp = {
tags.navigationaid = 'als';
break;

case 'ZD040':
if (layerName.toLowerCase() == 'annop') {
// ArcMap supports an edge case where annotation points can have a ZD040 (normally text point) fcode
delete tags.named_location;
tags.annotated_location = 'yes';
}
} // End switch FCODE

// Content vs Product for storage tanks
Expand Down Expand Up @@ -1912,6 +1920,12 @@ mgcp = {
delete tags.natural;
}

if (tags.annotated_location)
// We need to get an annotation point out of the schema, then change back to the text point fcode, ZD040, after the attributes are populated
{
attrs.F_CODE = 'ZD045';
}

// Keep looking for an FCODE
// This uses the fcodeLookup tables that are defined earlier
if (!attrs.F_CODE)
Expand Down Expand Up @@ -3127,6 +3141,11 @@ mgcp = {
returnData.push({attrs: attrs, tableName: tableName});
} // End We DON'T have a feature

if (tags.annotated_location)
{
attrs.FCODE = 'ZD040';
}

// Debug:
if (mgcp.configOut.OgrDebugDumptags == 'true')
{
Expand All @@ -3138,6 +3157,7 @@ mgcp = {
print('');
}


return returnData;

} // End of toOgr
Expand Down
Loading