Maptitude GISDK Help

ExportGeoJson()

Summary

Export entities in layer_set to filename

 

Syntax

ExportGeoJson(string lyr_set_name,  string filename, array options)

 

Argument

Contents

lyr_set_name

The name of the layer or selection set to export

filename

A complete path and file name for the new geographic file.

 

Option

Type

Contents

Fields

Array

An array of field specs strings or null for no fields.  Use field names only if there is no ambiguity when resolving field names in joined views or null for no fields

ID

Array

Field spec to be used for unique feature ID

Output Field Names

Array

(Optional) An array  of the same length as Fields, with short field names that will be used in the output property names for each feature instead of the field specs

Output Headers

Boolean

"True" (default) to create the file from scratch and to include standard GeoJSON headers are included, or

"False"   to append the feature array to an existing file. The caller is responsible for writing the GeoJSON headers including the "features: [" line before calling ExportGeoJSON() and appending the closing "]" to the end of the file.

Include Whitespace

Boolean

"True" (default)  means some minimal formatting is used, or

 "False"  to omit white spaces and new lines, thus reducing the size of the output file

Centroids

Boolean

"False"(default) to export areas, or

"True" to export the centroids of the areas are exported to a point GeoJson.

NAD Conversion

Boolean

Input datum, output datum, and conversion file (if needed); the input and output datums should be different

Projection

String

The projection name and the array of options

Transform

String

Array indicating the transformation to apply to coordinates in the file. This can have three forms:

1. An array of two or more four-element arrays containing local and world coordinates for control points, for example, {{real localX1, real localY1, real longitude1, real latitude1}, ...}

2. An array of four elements - {real X_multiplier, real Y_multiplier, real X_offset, real Y_offset}

3. Center and Extent transform {c1_x, c1_y, width_1, c2_x, c2_y, width_2} where center is shifted from (c1_x,c1_y) to (c2_x,c2_y), and vector of length width_1 out of c_1 becomes a vector of length width_2 out of c_2.

 

 

Notes

Example

SetLayer("County (Low Res)")

qry = "Select * where Population/Area > 100"

SelectByQuery("Selection", "Several", qry)

ExportGeoJson("County (Low Res)|Selection", "highdesn.json",{

     {"Projection", "utm", {"zone=12", "units=m"}},

     {"NAD Conversion", "NAD27", "NAD83",}

 

 

Error Codes

Error Type

Meaning

Error

An error occured while creating the geographic file (e.g., out of disk space)

NotFound

The specified layer or set name does not exist

 

See Also

 

Function

Summary

CopyDatabase()

Copies either a standard- or compact-format geographic file

CreateStreetCDF()

Creates a compact format address-matchable street file

ExportDXF()

Exports features in a geographic file to a DXF file

ExportGeography()

Converts a geographic file between standard and compact format, or creates a new geographic file from a selection set

 

 

©2025 Caliper Corporation www.caliper.com