Alchemy Data Import Tool
Alchemy is a tool that allows custom GeoBase datasets to be created from shapefile or CSV data sources.
Alchemy uses SQL-like syntax, which provides powerful, selective data extraction and transformation.
To map your custom data you must have a Chameleon license. To DataQuery your custom data you must have a Custom Data License.
For more information about Chameleon licenses, limitations, and pricing contact GeoBase support at firstname.lastname@example.org. A member of the GeoBase support team will be glad to assist you.
The following chart indicates a typical work-flow in which one would use Alchemy. Note that it is not necessary to create a Map Style in order to perform data query functions.
Displaying Custom Data
GeoBase is familiar with many data types (such as roads, tunnels, freeways and water bodies) and will display these data types without requiring any specialized knowledge.
However, if you are importing custom data (such as sewer pipelines or power pylons) which GeoBase is not familiar with, a custom map style is required to provide the knowledge that GeoBase requires to display the data in an appropriate manner.
Custom map styles may be created using the Chameleon tool. Aside from being flexible and easy to develop, map styles created for your custom data set may have increased performance.
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.
An Alchemy import script is a text file containing an Alchemy query (see below for a simple example). Alchemy import scripts are plain text files, saved with a .alchemy file extension.
To use an Alchemy import script pass the name and path to the import script as an argument to the Alchemy tool.
The following is a very simple import. It reads data from the Name column of a shapefile into a GBFS file where the table name is borders. Note that Alchemy automatically appends .dbf and .shp to the path e:\europe and thus will expect to find both e:\europe.dbf and e:\europe.shp.
OUTPUT outputFile; DATASET "Europe Country Boundaries" ; COPYRIGHT "Telogis"; SELECT Name INTO borders FROM "e:\europe" ;
The output file, USA.gbfs, can be added to the GeoBase data folder and easily queried using the built-in DataQuery functions. For example:
BoundingBox bbox = new BoundingBox(new LatLon(34, -117), new LatLon(33.75, -117.5)); LatLon myLatLon = new LatLon(33.90, -117.25); string tableName = "borders"; // find all polygons within bbox in the "borders" table Telogis.GeoBase.Polygon results = Telogis.GeoBase.DataQuery.QueryPolygons(bbox, tableName); // find the nearest polygon to myLatLon Telogis.GeoBase.Polygon nearest = Telogis.GeoBase.DataQuery.FindNearestPolygons(myLatLon, tableName);
In your Start menu, under GeoBase Developer's Kit | Sample Code & Projects | Alchemy Data Import Tool you will find shortcuts to some sample shapefile data and import scripts.
There are a number of optional Attributes that you can specify at the start of an import file. These attributes let you provide optional data that is written into the GBFS files you create. You are not required to assign attributes to your custom data sets, but in some cases it can be useful so that your imported data works the way you expect.
The following Alchemy statements can be used to assign Attributes to your GBFS file:
OUTPUT - Sets the filename of the output GBFS file
DATASET - Sets an arbitrary name for this dataset
COPYRIGHT - Sets a copyright for this dataset
COUNTRY - Sets the name of the country that this dataset represents
UNITS - Sets the unit system that this dataset uses - Metric or Imperial
For more information about how each of these attributes is used, see the documentation for the corresponding statements.
By default Alchemy will generate .gbfs format files, but it can also be used to generate .gbtx format transactional files. See OUTPUT for more information.