Welcome, Guest. Please login or register.

Login with username, password and session length
Forums Search:  


Author Topic: Mapset Toolkit, CPreview, indexes, searching  (Read 10645 times)

93ToyTruck

  • Jr. Member
  • **
  • Posts: 41
  • Karma: 0
    • View Profile
    • California Trail Map
Mapset Toolkit, CPreview, indexes, searching
« on: May 15, 2013, 10:50:41 PM »
Even after reading the CGpsMapper manual it took a bit of time to figure things out so I thought I would share my findings. Please reply if I got anything wrong or missed a juicy detail.

CPreview is a command line utility (included with CGpsMapper) that creates the preview map and search indexes used by Garmin BaseCamp and Mapsource.

Mapset Toolkit is a GUI that calls CPreview to create the preview map and search indexes. It then compiles the preview map using CGpsMapper.

CPreview is used by first creating a "preview control file" with the details of your map set. It is a text file similar in format to the MP file. Having the details in a text file is helpful if you're building a map multiple times so you don't have to type it into MapsetToolkit every time you update your map. MapsetToolkit temporarily creates a preview control file in the mapset directory while it is running. If you're fast, you can select the pv file, copy and paste into the same directory to snatch a copy of the parameters used by MapsetToolkit. This is how I figured out that I needed the zoom entries. The manual details it in the FAQ section at the end instead of with the CPreview section.

The [IMG ID] section of your map file should contain:
POIIndex=Y
POINumberFirst=Y
POIZipFirst=N
Numbering=Y

Each [POLYLINE] to be indexed must have a value defined for each of the following fields:
Label=
CountryName=
RegionName=
CityName=

CPreview is executed with the control file as a command line parameter. The input to CPreview is your compiled map IMG and IMG.IDX (IDX only if you have a version of CGpsMapper that supports searching). The attached sample preview control file contains the required entries with comments.

Example command line where pv.txt = your control file:
"cpreview.exe pv.txt -r" - Standard search.
"cpreview.exe pv.txt -m" - Wildard search. Bigger indexes.

CPreview will create:
[Map Filename].mp - The preview map that needs to be compiled with CGpsMapper.
[Map Filename].TDB - Map index used by BaseCamp and Mapsource
[Map Filename].reg - Registry entries needed by BaseCamp and Mapsource.

CGpsMapper versions that support searching also create:
[Map Filename].MDX - Translation table?
[Map Filename]_MDR.IMG - Map search index. Used to search for POIs, etc.

[Map Filename].mp must be compiled using CGpsMapper to get [Map Filename].IMG

All IDX files can be deleted after CPreview completes and preview map is compiled.
Registry values must be imported for the map to work in BaseCamp or MapSource. If you move the mapset files to another directory or create an installer, you can edit the registry file or use it as a template for your installer script.

What else?
« Last Edit: February 27, 2015, 12:55:38 PM by 93ToyTruck »

popej

  • Expert Advisor
  • *****
  • Posts: 328
  • Karma: 29
    • View Profile
Re: Mapset Toolkit, CPreview, indexes, searching
« Reply #1 on: May 16, 2013, 01:12:49 AM »
You will get standard serch index executing cpreview without options:
"cpreview.exe pv.txt"

Option -r makes cpreview use region name instead of country name.
Option -m makes all words in name searchable. If a street name is for example "John Lennon" then it could be found as "John" and as "Lennon".

MDX is translation table between file name (it is a number) and MapID (tile ID number).

mjcross

  • Newbie
  • *
  • Posts: 1
  • Karma: 0
    • View Profile
Re: Mapset Toolkit, CPreview, indexes, searching
« Reply #2 on: December 22, 2013, 05:21:41 AM »
note that in the preview control file (e.g. pv.txt) you must close the MAP section with an END-MAP tag. It's probably safer to close the FILES section in the same way, too.

With cgpsmapper itself you can optionally close sections using just an END tag. But if you do this in the MAP section of the preview control file then cpreview will give no error but it won't read the FILES section. This will in turn means that when you try to compile the resulting .mp file, cgpsmapper will fail with a 'layer 0 cannot be empty' error!

This almost drove me insane while I was trying to figure out why my previews weren't working  :D

lsnead

  • Jr. Member
  • **
  • Posts: 3
  • Karma: 0
    • View Profile
Re: Mapset Toolkit, CPreview, indexes, searching
« Reply #3 on: March 14, 2014, 12:15:34 PM »
Sorry to dig up an old thread, but I think this is where I need to be.

My custom mapset is not searchable in Basecamp.
I'm using the free CGPSMapper version, and the website states there is no POI Indexing in this version.  My MP files have POIIndex=Y, but I'm wondering if it's just being ignored?

My buddy's custom mapset is searchable, and he said he's using the free version.  Maybe an older version that allowed POI indexing?

Thanks!

Lance

93ToyTruck

  • Jr. Member
  • **
  • Posts: 41
  • Karma: 0
    • View Profile
    • California Trail Map
Re: Mapset Toolkit, CPreview, indexes, searching
« Reply #4 on: March 17, 2014, 07:03:11 PM »
Something else I just remembered...

Your roads must have the following fields defined:
CountryName=
RegionName=
CityName=

I'm not sure why but the fields are disabled in my version of GPSMapEdit(address tab). I don't want to set the value manually on all of my objects so I add the lines via script before compiling the map.
« Last Edit: November 05, 2014, 10:50:56 PM by 93ToyTruck »

lsnead

  • Jr. Member
  • **
  • Posts: 3
  • Karma: 0
    • View Profile
Re: Mapset Toolkit, CPreview, indexes, searching
« Reply #5 on: March 25, 2014, 01:39:43 PM »
Thanks for the suggestion ToyTruck.  I added those attributes to my POIs in GlobalMapper , populated them, and they show up in my exported MP file.  However I'm still not able to search for them Basecamp. Must be something wrong in my dictionary file or something.  Not able to find the answer in the CGPSMapper manual.  I am able to search and find them on the GPS unit though. I'm just stuck and not sure what else to try.

Attached is my dictionary and exported GlobalMapper MP file if someone could take a look, maybe the answer will pop out to them.  I'd really appreciate it.

[IMG ID]
ID=
Name=Big Bend National Park
DrawPriority=31
LBLcoding=9
Codepage=1252
Marine=N
Elevation=f
Copyright=2014 BigBendMaps.com
Preprocess=F
POIIndex=Y
Transparent=N
TreSize=1024
RgnLimit=500
Levels=8
Level0=24
Level1=23
Level2=22
Level3=21
Level4=20
Level5=19
Level6=18
Level7=17
Zoom0=0
Zoom1=1
Zoom2=2
Zoom3=3
Zoom4=4
Zoom5=5
Zoom6=6
Zoom7=7
[END-IMG ID]


popej

  • Expert Advisor
  • *****
  • Posts: 328
  • Karma: 29
    • View Profile
Re: Mapset Toolkit, CPreview, indexes, searching
« Reply #6 on: March 25, 2014, 03:48:27 PM »
Cgpsmapper free doesn't support indexed search,  only search near is available.
Try for mkgmap instead.

lsnead

  • Jr. Member
  • **
  • Posts: 3
  • Karma: 0
    • View Profile
Re: Mapset Toolkit, CPreview, indexes, searching
« Reply #7 on: March 28, 2014, 01:53:02 PM »
Cgpsmapper free doesn't support indexed search,  only search near is available.
Try for mkgmap instead.

Thanks, I bought the $30 shareware version with limited POI indexing, but that did not solve the problem.  My buddy has the free version and I can search his maps and get results in BaseCamps for POIs.  Also bought Mapwel Advanced, and that didn't resolve the issue.  Was really disappointed in the contour lines with Mapwel's exported IMG files.  Not nearly as smooth as CGPSmapper.  Not something I could have evaluated in the free version.  Maybe I'll find it useful in some other part of the mapping process. Anyhow..

I went ahead and made my own pv.txt file and tried to run cpreview from the command line outside of MapSetToolKit, but it doesn't generate any output files at all?  From MapSetToolKit, I get the MDX and TBD output files, but they're only 1KB so that indicates to me the POI indexing information is not there.

I'm using GlobalMapper to export the MP files and I'm starting to think the root cause is because of some attribute I might be missing in my source data.  I did add the CountryName, RegionName, and CityName like ToyTruck suggested, but I'm thinking I'm missing something else.  Just not sure.  Pretty frustrating.. :-\