Workspace templates

map.apps ETL requires a published FME workspace for every ETL tool. Even though almost all formats can be used, a few basic requirements are necessary for workspaces to be used in map.apps ETL.

The following templates are provided with map.apps ETL:

Template Use case FME service App configuration

extent_download.fmw

  • Provide your own data as a downloadable ZIP file to the user. A bounding box can be provided by the app in order to clip to features.

  • Similar to the db_export bundle from map.apps ETL 2.x.

Data Download Service

  • Input: Map extent selection

  • Output: Download

map_features_download.fmw

  • Export vector data from within the map and provide the features as a downloadable ZIP to the user.

  • Similar to the file_download bundle from map.apps ETL 2.x.

Data Download Service

  • Input: Features from the map

  • Output: Download

upload_to_map.fmw

  • Upload data from the local computer and display the results on the map. It is also possible to provide a bounding box from the map to clip the features.

  • Similar to the file_upload bundle from map.apps ETL 2.x.

Data Streaming Service

  • Input: File Upload (, Features from the map)

  • Output: Display results on the map

schema_analyzer.fmw

  • Support (analyze) workspace for upload.

  • Analyze uploaded data to provide validation (i.e. test for supported geometries and coordinate systems) and metadata of feature types.

Data Streaming Service

  • Input: File Upload, configure to use as analyze workspace

Map output

If features should be drawn on the map, the output always has to be a JSON document with the following structure:

{
    "layers": [
        // Multiple individual layers are possible. Each layer has to consist of only one geometry type (point, line, area)
        // See EsriJSON Layer for more details
    ],
    //Optional
    "errors":[
        // multiple error messages are possible
        {
            // "msg" refers to a key in the i18n configuration (parent key: transformationErrors). If missing in i18n, it will be used as the error message in the gui.
            // defaults are: NO_FEATURE_WRITTEN,FILE_COULD_NOT_BE_READ,TOO_MANY_FEATURES
            "msg": "FILE_COULD_NOT_BE_READ",
            "detail": "corrupt_shape.shp"
        }
    ],
    // Optional: This object can contain HTML code (e.g. through FME HTMLReportGenerator Transformer) that will be opened as a new tool windows in map.apps in an iFrame.
    "message": ""
}

EsriJSON layer

{
        // EsriJSON representation of a feature. Can be created using an EsriJSON Writer or the CreateEsriJsonLayer Custom Transformer from the map.apps ETL templates
          "RecordSet" : {
            "geometryType" : "esriGeometryPolygon",
            "spatialReference" : {
               "wkid" : 3857
            },
            "features" : [
               {
                  "geometry" : {
                     "hasZ" : true,
                     "hasM" : false,
                     "rings" : [
                        [
                           [ 848483.3378490285, 6792708.083335426, 0 ],
                           [ 848754.450433705, 6792945.754720229, 0 ],
                           [ 848981.3728614079, 6792589.844807314, 0 ],
                           [ 849217.8499176458, 6792462.051650667, 0 ],
                           [ 848834.4704476842, 6792385.61462239, 0 ],
                           [ 848483.3378490285, 6792708.083335426, 0 ]
                        ]
                     ],
                     "spatialReference" : {
                        "wkid" : 3857
                     }
                  },
                  "attributes" : {
                     "myAttribute1" : "hi",
                     "myAttribute2": 1
                  }
               }
            ]
         },

        // Can be any esri renderer from https://developers.arcgis.com/javascript/latest/api-reference/esri-renderers-Renderer.html
        // You can use the Custom Transformer "EsriJsonRenderer" form the map.apps ETL Templates to create renderers.
         "renderer" : {
            "type" : "simple",
            "symbol" : {
               "type" : "simple-fill",
               "size" : 8,
               "color" : [ 0, 112, 191, 0.65 ],
               "outline" : {
                  "width" : 1,
                  "color" : [ 256, 256, 256, 0.65 ]
               }
            }
         },

        // Name will be used as the layer title in the map.apps TOC
         "name" : "My custom layer name",

        // Optional: Labeling Information. Replace "NAME" for the attribute you want to display.
        // For more configuration details: https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GeoJSONLayer.html#labelingInfo
        "labelingInfo": [{
            "labelPlacement": "below-center",
            "labelExpressionInfo": {
               "expression": "$feature.NAME"
            },
            "symbol": {
               "type": "text",
               "font": {
                     "size": 10,
                     "wheight": "bold"
               },
               "color": "black"
            }
         }]
      }

More information see JSON specification for geometries .