Alchemy Input Files
Alchemy is a tool that allows custom GeoBase datasets (known as GBFS files) to be created from shapefile, GeoBase Transactional (GBTx), or CSV data sources.
This topic outlines the types of file that Alchemy can read.
The Data File Storage Locations topic describes where the Alchemy output (GBFS) files should be placed in order for the files to be 'seen' by GeoBase.
The Alchemy tool can read three file types: CSV, shapefile and GeoBase Transactional (GBTx).
Alchemy can read CSV files. This is particularly useful for creating lookup tables (see: CREATE LOOKUP).
To load a CSV file specify the file path with a leading csv://, such as csv://directory_path\file.
The filename can be suffixed with a '^' and either P, T, or a comma to show that the separator between fields is a pipe, tab or comma, respectively. For example csv://c:\source\poi.txt^P will load the pipe-separated file poi.txt.
Each CSV file should have a header. If no header is specified Alchemy will use the first line of the file as column names. To specify a header, suffix the filename with :columnName, repeated as often as required. For example the following file is specified as having two columns, 'ID' and 'Name'.
Shapefiles may be referenced from within Alchemy by specifying either a relative or absolute path.
For an introduction to shapefiles, refer to the Common Concepts > Shapefiles topic.
Alchemy, unless explicitly instructed, will load all three shapefiles: the DBF, SHP and SHX files. To force Alchemy to only load the DBF file specify the file-path with a leading dbf://, such as dbf://directory_path\file. The DBF file must be loaded because the SHX and SHP files depend on the DBF file.
Loading only the DBF file when creating a lookup can significantly improve performance when the geometry portion of the shapefile is not to be used.
Alchemy does not support 3D Shapefiles (types 11, 13, 15 and 18). Attempts to import these Shapefile types will result in errors.
See the ESRI Shapefile Technical Description PDF document for more information about Shapefile types.
GeoBase works with the WGS84 (EPSG:4326) World Geodetic System. If your data is in a different projection you will need to reproject the points to work with them in GeoBase. For more information on WGS84 click here.
Alchemy can import data from a GeoBase Transactional (GBTx) database using either the IMPORT or SELECT statements.
To import data from a GBTx file, prepend the GBTx file path and name with gbtx:// and append the relevant table name with "#" as shown below:
For more information on GeoBase Transactional databases, see the Telogis.GeoBase.Transactional namespace in the GeoBase API Reference.
In order to render GeoBase Transactional data, a custom map style is required, which requires a valid Chameleon license.
For more information about Chameleon licenses, limitations and pricing, contact Verizon Connect Customer Support at firstname.lastname@example.org. A member of the GeoBase Support Team will be glad to assist you.
If you want to allow foreign characters and symbols to be encoded in your data, for example in street, city, or region names, you can use one of the following methods:
UTF-8 - This is the default method of character and symbol encoding. It is used when no .cpg file is present.
CPG files - If you use .dbf and .shp files, you can define a .cpg file that contains the code for the type of encoding to use in the files.
Code page syntax - If you use a file that does not have the extension .dbf or .shp, you can use the @@ syntax behind the file's name to define the type of encoding to use in the file.
If you use files with the extensions .dbf and .shp, you can use .cpg files to allow foreign characters and symbols to be encoded in the import data. The content of the .cpg file instructs Alchemy to use the specified encoding to interpret import data (such as street, city, or region names).
When creating a .cpg file, make sure that the filename is the same as for the .dbf and .shp files. For example, the files within a valid directory could be: data.dbf, data.shp, and data.cpg.
CPG files are text files that contain only the code to use for encoding. For example, for Western European characters, the .cpg file would contain the code "iso-8859-1". For a list of encoding names supported by Windows see: Windows Encoding Names
You can use code page syntax to specify which foreign characters and symbols to use in Alchemy import data. Code page syntax cannot be used with files that have the extensions .dbf and .shp.
To specify a code page using code page syntax append @@ followed by the numerical identifier for the code page to the file name.
For example: "C:\this_file_is_in_Greek@@1253".
For a list of code pages supported by Windows see: Code Pages Supported by Windows.
It might be necessary to use the Latin code page, even when working with English data, to ensure that special characters (such as the cedilla - ç and the diaeresis - ë) are interpreted correctly.
IMPORT POLYGONS [ ... ] FROM $basePath + "\lakes" + "@@1252"
For data with columns in Simplified Chinese append @@936 to filenames. This ensures that Alchemy (and hence GeoBase) interprets text within the columns correctly.
CREATE LOOKUP myLookup ON %col_name FROM "dbf://China_Data@@936" INDEX BY %index_col;