ngageoint / hootenanny-ui

Hootenanny UI is a submodule of the Hootennany vector conflation project.
ISC License
28 stars 7 forks source link

Translation Assistant on Selected Feature Classes #205

Closed sisskind closed 8 years ago

sisskind commented 8 years ago

As a user of Hootenanny, I need the ability to select an individual feature class or multiple feature classes from a file geodatabase when creating a new translation using Translation Assistant. In the user interface this would take the form of being able to display the contents of a file geodatabase followed by the user selecting the feature class or classes to be brought into the Translation Assistant. May need to take domains into account for this as well.

May be related to ngageoint/hootenanny#284 and ngageoint/hootenanny#285

sisskind commented 8 years ago

@mattjdnv Is this feasible to create new translation (forgetting the UI portion)?

sisskind commented 8 years ago

This functionality is already found within Hootenanny.

sisskind commented 8 years ago

@brianhatchl to confirm existing functionality

brianhatchl commented 8 years ago

Some findings:

We have a layer name filter that we use with FGDB. I'll have a try applying it to the renderDb translator. The TDS translations use this filter to remove o2s and SRC layers: // Layer name filter - Filter out all layers that match this regexp function layerNameFilter() { // Drop all of the "SRC" and "o2s" layers return "^(?!SRC|o2s_)"; } Command Line: === ogr.import.filter Data Type: string Default Value: `` The regexp to be used to filter the layer names when importing layers from an ESRI File Geodatabase. The default is to import all layers from a FGDB. Setting this variable will override the filter value that can be set by the layerNameFilter function inside a translation script.

brianhatchl commented 8 years ago

Regarding data sources with multiple layers (fgdb, zip of shps) TA would enforce that all attributes of all layers be either mapped or ignored before a translation script would be generated. By removing the 'ignore remaining' feature #193 and the request in this ticket to only define attributed mappings for select layers in a multi-layer dataset, the rules have been loosened to only require that at least one layer has a mapping for at least one attribute to save the translation.

The hope is that the Translation Assistant can use the list of layers without any attribute mapping to populate the layerNameFilter function mentioned above.

brianhatchl commented 8 years ago

@mattjdnv bringing you in to discuss.

brianhatchl commented 8 years ago

The ability to specify layer filters in the translation may be obviated by https://github.com/ngageoint/hootenanny/issues/283, if the upload dialog will already allow the user to specify a subset of feature classes to ingest.

brianhatchl commented 8 years ago

Learned today that returning null instead of {} hoot will drop the feature from the translate op.

mikejeffe commented 8 years ago

@brianhatchl I just want to clarify something. If I upload a .gdb to TA that has two feature classes (we'll call them fclass1 and fclass2), when I'm doing my mapping if I only map a single attribute in fclass1 e.g. F_CODE and then save the translation, I only see fclass1 in the resulting translation. I haven't ignored any other attributes as you can see but flcass2 is not included in the translation. Is that the expected behavior?

hoot.require('translation_assistant')
var attributeMapping = {
    "fclass1": {
        "F_CODE": {
            "Feature Code": {
                "AP030": "AP030: Road",
                "AP050": "AP050: Trail"
            }
        }
    }
};
var fcode;
var schema = 'TDSv61';

//translateToOsm - takes 'attrs' and returns OSM 'tags'
var translateToOsm = function(attrs, layerName) {
    return translation_assistant.translateAttributes(attrs, layerName, attributeMapping, fcode, schema);
};
brianhatchl commented 8 years ago

Yes, this lets you just translate the features in fclass1. All the features from fclass2 should be dropped by the translation when you use it during ingest.

mikejeffe commented 8 years ago

ok then its behaving as expected.