Geovpf Reference Manual |
---|
GeovpfDatabaseLookup — A cached table of available databases and libraries.
struct GeovpfDatabaseLookupPrivate; struct GeovpfDatabaseLookup; struct GeovpfDatabaseLookupClass; void geovpf_database_lookup_set_search_path (GeovpfDatabaseLookup *database, const char *search_path); gpointer* geovpf_database_lookup_library (const char *name); GList* geovpf_database_lookup_databases (); GeovpfDatabaseLookup* geovpf_database_lookup_get_system (void);
A VPF database can consist of 100 or more libraries. In some cases it might be necessary to browse through multiple databases. The GeovpfDatabaseLookup object simplifies finding the a library by building a hash table at construction time. It builds the has table based on a pre-defined colon delimited directory search path. When the GeovpfDatabaseLookup object has been initialized, it is necessary only to specify the library_name to the theme.
Here an example:
/* The database lookup is a singleton object. The directory search path is * is colon delimited. */ g_object_new(GEOVPF_TYPE_DATABASE_LOOKUP, "search_path", "/home/username/dnc:/mnt/cdrom", NULL); foo_canvas_item_new(group, GEOVPF_TYPE_CANVAS_THEME, "library_path", "a1707420", "coverage", "ecr", "feature_class", "ecrarea", "expression", "F_CODE=BA030 or F_CODE=DA010", "fill_color_rgba", 0xBDAF1Bff, NULL);
void geovpf_database_lookup_set_search_path (GeovpfDatabaseLookup *database, const char *search_path);
This method causes the database object to initialize itself by setting up a lookup table for all of the database libraries found on the given search path. It should only be called once per GeovpfDatabaseLookup object instance. The search path can also be given as a property during object construction. If it is necessary to change the search path during the execution of the program, then the a new GeovpfDatabaseLookup object should be created. For very large datasets or datasets that are on the cdrom, calling this function may take a long time.
database : | |
search_path : | A colon delimited list of paths from which to search for VPF database. |
gpointer* geovpf_database_lookup_library (const char *name);
This routine searches the database for a library of the given name.
name : | The VPF library name, e.g., 'a1707420'. |
Returns : | A pointer to the library_type structure defined in vpfview.h. |
GList* geovpf_database_lookup_databases ();
All of the available databases. Note, it is allowable to have a database list in the database header table (the 'dht' file) that doesn't exist in the file structure. These will simply be ignored.
Returns : | A GList of const char* strings. |
GeovpfDatabaseLookup* geovpf_database_lookup_get_system (void);
Creates a singleton instance if none exists, else will increase the reference count on the singleton by one. Use g_object_unref when finished. Note also that the first g_object_new for this object type will create the singleton instance. The first database lookup object created becomes the systen object.
Returns : | A singleton instance of the database lookup object. |
"search-path" (gchararray : Read / Write) | Setting this property causes the database object to initialize itself by setting up a lookup table for all of the database libraries found on the given search path. It should only be called once per GeovpfDatabaseLookup object instance. If it is necessary to change the search path during the execution of the program, then the a new GeovpfDatabaseLookup object should be created. For very large datasets or datasets that are on the cdrom, setting this property may take a long time. |
<< GeovpfCanvasTheme | GeovpfLibrarySelector >> |