GeoJSON Parser

Overview

You can use this Snap to parse geospatial data from a GML file or from a ZIP file that contains shapefiles.



Limitations

This Snap requires an upstream File Reader Snap or Multi File Reader Snap that reads the input files from a GML file or from a ZIP file that contains shapefiles (.shp). The File Reader Snap or Multi File Reader Snap must appear immediately before this Snap in the pipeline. Currently, only GML v3 is supported. Also, GeoJSON output is not supported as downstream output for any database Snaps.

Known issues

This Snap accepts only application/zip or
application/gml+xml;
      charset=utf-8
as a file input stream. However, the output content type from the File Reader Snap is binary/octet when the input file is read from SLDB.
Workaround: To read an input file (ZIP or GML) from SLDB, use the Mapper Snap to change the content type from binary/octet to one of the following:
  • ZIP file: Change the content type to application/zip .
  • GML file: Change the content type to
    application/gml+xml;
                charset=utf-8
    .

Snap views

View Description Examples of upstream and downstream Snaps
Input The Snap requires an upstream File Reader Snap or Multi File Reader Snap (immediately preceding it in the pipeline) that reads the input files from a ZIP file that contains shapefiles (.shp) or a single GML file.
  • File Reader Snap
  • Multi File Reader Snap
Output Output is GeoJSON, which can then be used for any geospatial analytics or map applications. The output can also be loaded to a database outside of the SnapLogic platform.
  • Mapper
  • File Writer
  • Snowflake
  • PostgreSQL
Error

Error handling is a generic way to handle errors without losing data or failing the Snap execution. You can handle the errors that the Snap might encounter when running the pipeline by choosing one of the following options from the When errors occur list under the Views tab. The available options are:

  • Stop Pipeline Execution Stops the current pipeline execution when an error occurs.
  • Discard Error Data and Continue Ignores the error, discards that record, and continues with the remaining records.
  • Route Error Data to Error View Routes the error data to an error view without stopping the Snap execution.

Learn more about Error handling in Pipelines.

Snap settings

Legend:
  • Expression icon (): Allows using pipeline parameters to set field values dynamically (if enabled). SnapLogic Expressions are not supported. If disabled, you can provide a static value.
  • SnapGPT (): Generates SnapLogic Expressions based on natural language using SnapGPT. Learn more.
  • Suggestion icon (): Populates a list of values dynamically based on your Snap configuration. You can select only one attribute at a time using the icon. Type into the field if it supports a comma-separated list of values.
  • Upload : Uploads files. Learn more.
Learn more about the icons in the Snap settings dialog.
Field / Field set Type Description
Label String

Required. Specify a unique name for the Snap. Modify this to be more appropriate, especially if more than one of the same Snaps is in the pipeline.

Default value: GeoJSON Parser

Example: myGeoJSON Parser
Input format Dropdown list

Select the format of the file used in the upstream file reader.

Default value: Shapefiles

Example: GML file
Read all files Checkbox Appears when you select Shapefiles as the Input format. Read all the files in the ZIP file. Read all the files in the zip file.
Shapefiles List all the shapefiles to be parsed. Click the Plus Icon to add a new shapefile.
Shapefile path String/Expression Specify the path to the shapefile you want to parse. The path should include all folders to the file from the root directory.

This property is a URL path to the directory where files will be searched. The expected syntax is:

root/folder1/subfolder1/line.shp

Default value: None

Example: limit
Snap execution Dropdown list
Choose one of the three modes in which the Snap executes. Available options are:
  • Validate & Execute: Performs limited execution of the Snap and generates a data preview during pipeline validation. Subsequently, performs full execution of the Snap (unlimited records) during pipeline runtime.
  • Execute only: Performs full execution of the Snap during pipeline execution without generating preview data.
  • Disabled: Disables the Snap and all Snaps that are downstream from it.

Default value: Execute Only

Example: Validate and Execute

Troubleshooting

Error Reason Resolution
Unsupported file format. File format is not supported. Check if the file provided is a ZIP file containing a .shp file.
Shapefile not found. No shapefile found at the root of the ZIP file. Check if the shapefile is at the root of the ZIP file. If not, provide the correct path to the shapefile inside the ZIP file.