Skip To Content

Watch a Folder for New GeoJSON Files

The Watch a Folder for New GeoJSON Files input connector can be used to read and adapt event data, formatted as GeoJSON, from a system file.

When multiple event data records are specified in a GeoJSON file, organize them as a FeatureCollection as illustrated below. The GeoJSON inbound adapter will handle each feature record in the feature collection as a separate event data record. The GeoJSON illustrated below will be adapted to produce two event data records for a GeoEvent Service to process.

For more information and examples of GeoJSON data record formatting, see GeoJSON specification.

Event data formatted as GeoJSON

Usage notes

Keep the following in mind when using the Watch a Folder for New GeoJSON Files input connector:

  • Use this input connector to read event data, formatted as GeoJSON, from a system file and adapt it to create event records for processing.
  • This input connector pairs the GeoJSON inbound adapter with the File inbound transport.
  • The input connector watches the specified system folder and will read an entire file as soon as the file appears in the folder.
  • The entire file’s content will be reread if changes are made to the file and are saved.
  • All files in a watched folder will be reread, from the beginning of the files, in the following situations:
    • The input connector’s properties are updated and saved.
    • The input connector is stopped and restarted (or the ArcGIS GeoEvent Server service is restarted).
  • A GeoJSON feature record is expected to contain both geometry and properties members.
  • The GeoJSON inbound adapter does not support the Construct Geometry from Fields capability.
  • The registered server folder, specified in the Input Folder Data Store parameter, can be specified using either an absolute path or UNC path. If a UNC path is used, the Windows service account running ArcGIS GeoEvent Server must have read/write permission to the folder.
  • It is recommended that you use absolute paths—for example, C:\GeoEvent\input—for the Input Folder Data Store parameter.
  • The Input Directory parameter allows a subfolder relative to the registered server folder to be specified.
  • The Include Subfolders parameter allows you to specify whether folders beneath the folder specified in the Input Folder Data Store parameter will be searched recursively. Often, organizing data with different schemas into different folders, and changing Include Subfolders from its default to disable recursive search, allows a more direct and simpler configuration of this input connector.
  • Network latency can adversely impact the ability of GeoEvent Server to retrieve high volumes of event data.

Parameters

The following are the parameters for the Watch a Folder for New GeoJSON Files input connector:

ParameterDescription

Name

A descriptive name for the input connector used for reference in GeoEvent Manager.

Input Folder Data Store

The registered system folder under which files will be found.

Input Directory

A subfolder directly under the registered system folder. Input Directory should be left blank if a subfolder under the registered system folder does not exist.

Input File Filter

A regular expression pattern used to identify files appropriate for this input to ingest and adapt to create event data records for processing. Since GeoJSON is technically a subtype of generic JSON, the default value (.*\.json) is used to match any filename (.*) ending with the literal suffix (.json). Assuming your input files were all named using a (.geojson) extension, the default pattern could be changed to .*\.geojson to avoid confusion with more generic JSON files.

While this parameter is not required and can be left blank, it is recommended you specify a pattern which matches the file name of any file whose schema matches the GeoEvent Definition this input has been configured to use and exclude files (by name) which you do not want the input to ingest.

Default Spatial Reference

The well-known ID (WKID) or well-known text (WKT) of a spatial reference system in which the geometry's coordinates are expressed. This parameter has no default value.

Include Subfolders

Specifies whether subfolders under Input Folder Data Store and Input Directory (optional) are used for files. The default is Yes; however, organizing data with different schemas into different folders and changing this parameter to No, to disable recursive search, allows a simpler configuration.

  • Yes—Recursively search for files whose content will be ingested and adapted to create event data records.
  • No—Only the Input Folder Data Store and Input Directory (optional) subfolders will be searched for files.

Delete Files After Processing

Specifies whether the files in the registered system folder will be deleted after their content has been processed. Note that even if a file's content cannot be adapted, no event records are created, and no real-time event processing occurs, the inbound transport will still delete a file whose contents were successfully read. The default is No.

  • Yes—Files will be deleted from the registered system folder after being processed.
  • No—Files will not be deleted from the registered system folder after being processed.

Create GeoEvent Definition

Specifies whether a new or existing GeoEvent Definition should be used for the inbound event data. A GeoEvent Definition is required for GeoEvent Server to understand the inbound event data attribute fields and data types.

  • Yes—A new GeoEvent Definition will be created based on the schema of the first event record received.
  • No—A new GeoEvent Definition will not be created. Select an existing GeoEvent Definition that matches the schema of the inbound event data.

GeoEvent Definition Name (New)

(Conditional)

The name assigned to a new GeoEvent Definition. If a GeoEvent Definition with the specified name already exists, the existing GeoEvent Definition will be used. The first data record received will be used to determine the expected schema of subsequent data records, a new GeoEvent Definition will be created based on that first data record's schema.

The parameter is shown when Create GeoEvent Definition is set to Yes and is hidden when set to No.

GeoEvent Definition Name (Existing)

(Conditional)

The name of an existing GeoEvent Definition to use when adapting received data to create event data for processing by a GeoEvent Service.

The parameter is shown when Create GeoEvent Definition is set to No and is hidden when set to Yes.

Expected Date Format

The pattern used to match expected string representations of date/time values and convert them to Java Date values. The pattern's format follows the Java SimpleDateFormat class convention.

While GeoEvent Server prefers date/time values to be expressed in the ISO 8601 standard, several string representations of date/time values commonly recognized as date values can be converted to Java Date values without specifying an Expected Date Format pattern. These include the following:

  • "2019-12-31T23:59:59"—The ISO 8601 standard format
  • 1577836799000—Java Date (epoch long integer; UTC)
  • "Tue Dec 31 23:59:59 -0000 2019"—A common web services string format
  • "12/31/2019 11:59:59 PM"—Common format used in the United States (12-hour clock)
  • "12/31/2019 23:59:59"—Common format used in the United States (24-hour clock)

If the date/time values received are expressed using a convention other than one of the five shown above, you will have to specify an expected date format pattern so GeoEvent Server knows how the date/time values should be adapted.

Read File as Text Lines

Specifies how the content of the file should be read and parsed. The default is Yes.

  • Yes—The contents of the file will be read and parsed as individual lines of text.
  • No—The entire file will be read and parsed as a complete document.

When working with a text file with one or more geoJSON FeatureCollection Objects, it is recommended that you read the entire file's content rather than read the file's individual lines of text. GeoJSON documents are best read as a single document.

Max Number of Lines per Batch

(Conditional)

The maximum number of lines to read from the file in each batch or interval. The default is 1000 lines. Reduce this value if each event record contains many attributes to limit the amount of data sent to the Text adapter as a batch.

The parameter is shown when Read File as Text Lines is set to Yes and is hidden when set to No.

Batch Flush Interval (milliseconds)

(Conditional)

The number of milliseconds to wait before reading another batch of lines from the file. The default is 500. Reduce this value if file size is expected to be very large or if additional time is necessary to process each batch of lines retrieved from a file.

The parameter is shown when Read File as Text Lines is set to Yes and is hidden when set to No.

Number of Lines to Skip from Start of File

(Conditional)

The number of lines to skip from the start of the file. The default is 0. Increase this value if you want a skip a specific number of lines—for example, header lines specifying attribute field names or data types, because they do not contain actual data for processing.

The parameter is shown when Read File as Text Lines is set to Yes and is hidden when set to No.


En este tema
  1. Usage notes
  2. Parameters