Combine the --createItemsFromMidMif
option with the --addAllMidMifItems
option. All items in the midmif file will be added to the mcm map. Useful when generating mcm maps from midmif, and the country (top region) only has ONE mcm map, so all midmif items should be added to one and the same mcm map.
--createItemsFromMidMif
option with the --useCoordToFindCorrectMap
option. Used when adding extra items from midmif to mcm maps, e.g. in stitching in merge map generation. Not appropriate in the raw midmif map generation, since it requires street segments to be present in the map already.When all items have been added to the maps, the map generation continues with creation of boundry segments, various steps of post processing of the mcm maps, addition of map corrections and POIs from the WASP database, creation of external connections, country overview maps, overview maps and regions and map index file.
Here’s a description of the createItemsFromMidMif()
function:
gfxData
is created. The gfxData
creates itself from the mif file, given the coordinate system in the mif header.ID
and name
columns are read from the mid file and saved in a temporary name string.GMSItem
is created with the given item type. The item creates itself from the mid file and is then assigned the gfxData
.settlementId
from the mid file, or a map ssi coordinate at the end of the mid row, or based on a geographical test matching the item gfxData and map gfxData. If the item does not fit the map: skip to next mif feature…zipCode
item are created.Located in genfiles country directory structure: genfiles/countries/denmark/script
Parameters to define in variable files for generating a country from Wayfinder midmif.
MAPRELEASE="maprelease"
MAP_SUPPLIER="mapSupplierLongVersion_"
CO_CODE="alpha2_"
AREAPATH="areapath"
genfiles/countries/denmark/OSM_201005/areafiles
MAPPATH="mappath"
OSM_201005/wf_midmif/DK
AREALIST="munfiles"
"
.Optional parameters to define in variable files for generating a country from Wayfinder midmif format.
ONLYONEMAP="true"
SKIPBOUNDRYSEGMENTS="true"
buildings2D="fullFilePathWithoutSuffix"
ADDRPOINTFILE="fullpath/addressPointsUTF8.txt"
SECTIONEDZIPSDIR="fullpathToTheDirWithSectionizedZipFiles"
The midmif area files are located in AREAPATH
. They really are the municipal item mid, mif and mapmif files. The municipal item midmif file name without suffix is listed in AREALIST
. Each file will create one mcm map.
Example of one area file:
dk_whole_municipalItems.mid
dk_whole_municipalItems.mif
dk_whole_municipalItemsmap.mif
Create area files from the one file with municipals in Wayfinder midmif format, using midmif_areaFilesNewRelease
. See script documentation for example commands.
If it is a large country, the country need to be split in more than one map, else the mcm maps in the map generation will be too large to handle. The limit for “large” can be approx more than 500000 street segments or whatever limit you find out that your system has. However, it does not only depend on number of street segments but also how many other item types you have in your maps. If it is a rich map data the size of the mcm map will be larger for the same number of street segments.
Some rules for file names
WFferryItems.mid
, WFwaterItems_all.mid
, WFparkItems200912.mid
areaWFbuiltUpAreaItems.mid
and WFstreetSegmentItems.mid
will give correct result. This rule exists to make sure that other items can be added to a correct map based on eg built-up area settlement id = the midId
of built-up areas. The city parts mid file can refer to the built-up area as settlement id, so the built-up areas must be added to the mcm maps before the city parts are added. Using the file names areaWFbuiltUpAreaItems.mid
and areaWFcityPartItems.mid
will work.dk_whole_municipalItem.mid/mif
the municipal map mif file must be called dk_whole_municipalItemmap.mif
makemaps
script removes everything from the last _
and adds CO_CODE
from the variable file (if CO_CODE
already is included in the municipal file name it is first removed). Example: a municipal file name fr_whole_municipalItems.midmif
gives mcm map name fr_whole
.turntable.txt
. If the ssi file is called WFstreetSegmentItems.mid/mif
the turn table file must be called WFstreetSegmentItemsturntable.txt
.Names etc from item midmif files need to be converted to UTF-8 before added to the mcm maps. The easy way is to ave the Wayfinder midmif item files encoded in UTF-8 before map generation.
In reality the midmif files can have any char encoding. Because the NationalProperties::getMapToMC2ChEnc()
is used for building a CharEncoding
object that does the convert job. If having char encoding other than UTF-8, update the NationalProperties::getMapToMC2ChEnc()
to get the correct encoding for your specific combination of country and mapOrigin (supplier+release).
The ID in the Wayfinder mid file must be an uint32 (unsigned integer). It is used for linking the mid item to mcm map item, writing a midmif_ref file.
Some things to think about for the mif files
mc2
, mc2_lonlat
, wgs84_latlon_deg
, wgs84_lonlat_deg
, rt90
, rt90_lonlat
, utm
, utm_lonlat
GMSGfxData::readMifHeader()
Point
, Line
, Pline
, Region
Pline Multiple
. Split Pline Multiple
features into several Pline
with the midmif_fixPlineMultiple.pl
script. (this is part of the midmif_autoParseToWF
script).Pen
, Brush,
Center`, … are ignored (skipped). If there is a cosmetic mif feature on the last row of a mif files, this must be removed manually. Else the map generation will exit with error message.Here are a few examples to illustrate the Wayfinder midmif data format.
Examples of item mid files
##### > hu_municipalItem.mid<==
197,"Budapest","Budapest:officialName:hun"
215,"Érd","Érd:officialName:hun"
219,"Salgótarján","Salgótarján:officialName:hun"
##### > areaWFbuiltUpAreaItems.mid<==
197,"Budapest","Budapest:officialName:hun"
201,"Pécs","Pécs:officialName:hun"
205,"Székesfehérvár","Székesfehérvár:officialName:hun"
##### > areaWFcityPartItems.mid<==
3342,"I. kerület","I. kerület:officialName:hun 1. kerület:alternativeName:hun"
3343,"II. kerület","II. kerület:officialName:hun 2. kerület:alternativeName:hun"
3344,"III. kerület","III. kerület:officialName:hun 3. kerület:alternativeName:hun"
3345,"IV. kerület","IV. kerület:officialName:hun 4. kerület:alternativeName:hun"
##### > WFaircraftRoadItems.mid<==
1,"",""
2,"",""
##### > WFairportItems.mid<==
1,"Ferihegyi repülõtér","Ferihegyi repülõtér:officialName:hun"
2,"",""
##### > WFallparkItems.mid<==
1001,"","","cityPark"
1002,"","","cityPark"
1003,"","","cityPark"
1004,"","","regionOrNationalPark"
1005,"","","cityPark"
##### > WFferryItems.mid<==
38912,"","7102:roadNumber:invalidLanguage",3,5,5,0,0,0,0,"Y"
46502,"","5107:roadNumber:invalidLanguage",3,90,90,0,0,0,0,"Y"
61387,"","4522:roadNumber:invalidLanguage",3,90,90,0,0,0,0,"Y"
61673,"","4412:roadNumber:invalidLanguage",3,50,50,0,0,0,0,"Y"
##### > WFindividualBuildingItems.mid<==
2,"","","airportTerminal"
3,"","",""
4,"","","parkingGarage"
5,"","",""
##### > WFrailwayItems.mid<==
1,"",""
2,"",""
3,"",""
4,"",""
5,"",""
##### > WFstreetSegmentItems.mid<==
1,"","M1:roadNumber:invalidLanguage E60:roadNumber:invalidLanguage",0,130,130,3,0,,,,,0,0,0,0,"Y",0,0,"N","N","N","N","N","Y","N","","",197,197,8,"","Y",-1
2,"","M1:roadNumber:invalidLanguage E60:roadNumber:invalidLanguage",0,130,130,0,3,,,,,0,0,0,0,"Y",0,0,"N","N","N","N","N","Y","N","","",197,197,8,"","Y",-1
3,"","M1:roadNumber:invalidLanguage E60:roadNumber:invalidLanguage",0,130,130,0,3,,,,,0,0,0,0,"Y",0,0,"N","N","N","N","N","Y","N","","",197,197,8,"","",-1
4,"","M1:roadNumber:invalidLanguage E60:roadNumber:invalidLanguage",0,130,130,3,0,,,,,0,0,0,0,"Y",0,0,"N","N","N","N","N","Y","N","","",197,197,8,"","",-1
2677,"Hungaria körut","Hungaria körut:officialName:hun",1,70,70,3,0,,,,,44,58,0,0,"Y",0,0,"N","N","N","Y","N","N","N","1146","1146",197,197,8,"","",-1
3447,"","",1,70,70,0,3,,,,,0,0,33,41,"Y",0,0,"N","N","N","Y","N","N","N","1143","1143",197,197,8,"","",-1
58729,"Emma Utca","Emma Utca:officialName:hun",4,50,50,0,0,,,,,0,0,0,0,"Y",0,0,"N","N","N","N","N","N","N","2030","2030",215,215,8,"","",0
##### > WFwaterItems_all.mid<==
1,"Balaton","Balaton:officialName:hun","lake"
2,"Tisza","Tisza:officialName:hun","river"
3,"Duna","Duna:officialName:hun","river"
##### > WFstreetSegmentItemsturntable.txt<==
KEY NODE_ ARC1_ ARC2_ IMPEDANCE LAT LON
27651 -1 -1 3937 -1 0 0
284461 -1 -1 45868 -1 0 0
382068 -1 -1 62889 -1 0 0
484349 -1 -1 79976 -1 0 0
Examples of street segment item mif file
Version 300
Charset "WindowsLatin2"
Delimiter ","
CoordSys wgs84_lonlat_deg
Columns 33
id Decimal (11,0)
Name Char (25)
Allnames Char (254)
Roadclass Decimal (11,0)
Posspeed Decimal (11,0)
Negspeed Decimal (11,0)
PosEntryR Decimal (11,0)
NegEntryR Decimal (11,0)
Nbrlanes Decimal (11,0)
Width Decimal (11,0)
Height Decimal (11,0)
Weight Decimal (11,0)
Lstart Decimal (11,0)
Lend Decimal (11,0)
Rstart Decimal (11,0)
Rend Decimal (11,0)
Paved Char(2)
Level0 Decimal (11,0)
Level1 Decimal (11,0)
Roundabt Char (2)
Ramp Char (2)
Divided Char (2)
Multi Char (2)
roadToll Char (2)
contrAcc Char (2)
roundaboutish Char(2)
zipLeft Char(254)
zipRight Char (254)
adminAreaIdLeft Decimal (11,0)
adminAreaIdRight Decimal (11,0)
adminAreaOrder Decimal (11,0)
borderNode0 Char (2)
borderNode1 Char (2)
roadDisplayClass Decimal (11,0)
Data
Pline 5
17.123847 47.916151
17.120732 47.918038
17.111679 47.924296
17.111272 47.924545
17.110997 47.924705
Pline 6
17.123957 47.916303
17.122986 47.916887
17.120899 47.918155
17.111618 47.924464
17.111219 47.924713
17.111056 47.924801
Pline 2
17.124212 47.916149
17.123957 47.916303
Pline 2
17.124665 47.915656
17.123847 47.916151
Pline 3
17.127317 47.914269
17.125747 47.915218
17.124212 47.916149
Pline 2
17.127394 47.914004
17.124665 47.915656
Pline 10
17.142915 47.906592
17.141807 47.906957
17.139402 47.907863
17.137203 47.908763
17.135303 47.909621
17.133693 47.910396
17.132609 47.910956
17.130348 47.912264
17.128476 47.913349
17.127394 47.914004