Indexing Maps

People who have browsed the Community Atlas website have probably noticed that you can search maps, not just by name, but also by text in the map. So, how to I manage to do that, the maps on the website is just images, right? Granted, there are tools available that tries to understand text in images, but these are not good with noisy backgrounds like a map is. However, the community atlas website is of course backed by the actual community atlas product, the .fcw files themselves, and this is where the text comes from.

This is all done by using an excellent command in CC3+, the create index command. This command was originally made for searching through multiple drawings quickly without the search function having to read each map file every time, but the index it generates is a nice plain text file which can also be used by other tools, such as a web search. If you own products such as the Forgotten Realms Interactive Atlas or World War II Interactive Atlas, these come with an index file out of the box allowing you to quickly search the maps therein, but of course, you can also easily make your own index file for your own set of maps.

I am going to use the index file from the Community Atlas as an example here since it is a free download available for everyone (you may not be able to use all maps from it, each individual map have it’s own requirements regarding which add-ons you need, if any, but many of the maps only require the core product). But you can use an existing one, or just create your own, which is the first topic we will be visiting in this article anyway.

Creating the Index

To create the index, let us start with a folder full of maps. The main idea with an index is to be able to quickly search a set of maps, so just having a single map doesn’t really work. I’ll use the Alarius folder from the atlas download here, since it contains a nice selection of maps.

To start the process, simply open up Campaign Cartographer 3+, and open one of the maps in the folder. If you are following along using the atlas files, the main Alarius.fcw file should work for anyone without requiring additional add-ons, although you can use any file. Even if you see some red X’es because of add-ons you don’t own, that doesn’t stop you from indexing the map, it only makes it look a bit weird.

Now, type INDEX on the CC3+ command line and hit enter. The command line will then prompt you for the path to index. Simply type $*.fcw and hit enter, which will index all the map files in the current folder (as well as subfolders).

Remember here that the $-characters means the location of the current map, and *.fcw means all files that have the fcw file extension (CC3+ maps). This is why this particular path will work on all the maps in the same folder (and subfolders). Once you hit enter, CC3+ will start working on your index. This can take a little bit of time, depending on the number of maps in the folder and the amount of text in them. You’ll see that the message area of the top status bar turns red while it is working and your mouse cursor should turn into the waiting cursor instead of the normal arrow.

Once this process is done, CC3+ will have created a file in the folder called INDEX.IDX. This is your index file. If you add more maps to the folder, or remove some, just run the command again to generate a new file, this will automatically overwrite the old one.

Using the Index in CC3+

The main use of this file is to be able to search your maps from inside CC3+. So, click the Find in Files button to bring up the search dialog.

The first point I’ll call attention to here is the Search Path, the top input field. This specifies where to search. The default value for a fresh CC3+ installation is @*.FCW, which means search all maps in the CC3+ data directory, but do not use any search index (since one probably doesn’t exist). You can change this to $*.fcw to search maps in the same folder as the current map instead, but again without using an index. This is of course great if you don’t have an index, or it is out of date, but we do have one now, so let us try it. Change the search path to $\index.idx (Yes, the \-character needs to be in this time. If you leave it out, the search will appear to work, but you can’t open the maps from the result list correctly). By doing this, we point it to our index file instead of the individual map files in the folder. Now, type in something in the search field that exists in multiple files. I’ve just used the text string Alarius here, as it does appear in multiple maps. When you hit OK, the search results should appear almost immediately in the bookmarks dialog (CC3+ stores the latest search results in a temporary bookmark file, you can save this to a permanent bookmark file if you wish).

If you have show file paths checked, you probably want to turn it off to be able to read the file names. Now, all that is required is to select an entry and click the Open Selected Entry button. To get back the latest search results, you can just click the View Bookmarks button, or you can simply search again.

To prove the effectiveness of the index, you can also try a search with the search path set to $*.fcw instead of $\index.idx. Notice how much slower this search is. Also, it doesn’t find results from map notes, you need the index to do this (Turn off the File Notes option if you wish to search the index without looking in map notes), so with my example maps here, where I know the files contains notes, there is a huge difference.

The Atlas Index file

The atlas is a bit more complicated, due to the multiple subfolders, one for each continent. If you browse the folders in Windows Explorer, you’ll notice that the INDEX.IDX file resides outside these folders. To search from any atlas map, set the search path to $..\index.idx instead. Those extra two punctuation marks simply means parent folder, that is, the folder just outside the current one. It is set up this way so the index can include all the subfolders, so you can search all the maps at once, and not just by continent.

Looking at the Index File

The index file is just a simple text file. You can open it up using any text editor, such as notepad and look inside. And what you’ll find is just all the text from each map collected. Each map starts with the map name, prefixed by a $. (Actually, the full path to the map is here, but if we made the index using relative paths as we did, the path will be just a $, or if you look at the atlas index file, it will look like $continentname\mapname.fcw because all maps are in subdirectories here). You’ll then see some markers, like *T which means text in the map, and *N which means text from a map note, followed by the actual text entries in the map.

If you’re just going to use the file within CC3+, then opening it up an looking at it like this doesn’t give you much. But if you’re wanting to use it with an external program, like I do with the map search on the atlas site, you now have a nice file you can feed into your program.

 

If you have questions regarding the content of this article, please use the ProFantasy forums. It can take a long time before comments on the blog gets noticed, especially for older articles. The forums on the other hand, I frequent daily.

 

Comments are closed.