IMPORT Statement |
This statement converts GIS-formatted data to GBFS data. GeoBase supports the import of the following predefined data types:
IMPORT import_type [id = %src_id, dest_col1 = exp1, dest_col2 = exp2, ...] FROM "path\src_file" WHERE condition; IMPORT ... ; COMMIT;
Tip |
---|
A COMMIT statement only has effect after a street import |
Note |
---|
Specify the code page to be used for an import file by adding '@@1234', where '1234' denotes the codepage. For example, to import UTF-8, which has a Microsoft code page value of '65001': Alchemy IMPORT POLYGONS [ LABEL = %name, TYPE =5 ] FROM "buildings@@65001"; Without this code, accented characters in UTF-8 formatted data will be corrupted. |
import_type | Specifies the type of data to be collected. Can be one of: CITIES, LINES, POI, POINT_ADDRESSES, POLYGONS, CONSTRAINTS, or STREETS |
id | A required field of unique identifiers that cannot be omitted |
src_id | A column of unique identifiers in src_table |
dest_colX | One or more columns that have GBFS data passed to them. See CITIES, LINES, POI, POLYGONS, CONSTRAINTS or STREETS for a description of acceptable column names and data values |
expX | A logic expression that may contain references to one or more columns in src_file |
path\src_file | Specifies the path and file containing the shapefile data |
condition | A logic expression that is satisfied by a subset of the data in path\src_file. This expression, along with the WHERE keyword, is optional |
It is possible to define a local variable and a value within an initial pair of braces ({..}) that can then be used within the IMPORT statement. This capability allows for more advanced logic than would otherwise be possible within the import statement itself.
IMPORT STREETS [ ... , FUNC_CLASS = getType(%my_column), ... ; ]
Re-written to use a local variable:
IMPORT STREETS { ...; $my_type = getType(%my_column); ...; } [ ... , FUNC_CLASS = $my_type, ... ; ]