This release, 8.4, was made on 20th February 2022 and is based on commit 8.4-1-gcb08c572d in the Git repository.

The previous release, 8.2, was made on 9th December 2022 and was based on commit 8.2-57-g51a9fa561 in the Git repository.

mapinfo is the new name for ctm1_info

The tool to describe the contents of a CartoType map file (a CTM1 file) is now called mapinfo, not ctm1_info. The new name is more descriptive and easier to type.

mapinfo usage and command line options are now:

usage :mapinfo { -option1 ... -optionN } <CartoType map file (CTM1 file) name>
    options:
        -d<layer>{,<condition>}: dumps all map objects in a layer,
            optionally using a condition to select objects
        -D<layer>{,<condition>}: like -d but also dumps coordinates
        -a<layer>{,<condition>}: like -d but gives combined area and length of objects only
        -e<W,S,E,N> or <zoom,X,Y>: applies an extent to following -d or -D options
        -f<building>,<street>,<city>{,<postcode>}: finds addresses
        -i: uses imperial units (miles, yards, acres) instead of metric units (kilometres, metres, hectares)
        -n: no info (for use with -d, etc.) does not list global information, tables or layers
        -v: verbose: lists layers
        -V: more verbose: lists layers and low-res layers

Major standard style sheet changes

These changes affect the standard style sheet, style/standard.ctstyle. Users are free to use the standard style sheet in part or in whole, or use their own custom style sheets.

Cities and towns now have icons in the form of five-pointed stars at small scales. The icon for a capital city is a five-pointed star in a circle.

Routes are now drawn at large scales using a smooth envelope without the former kinks and overlaps, and at very large scales arrows are drawn in the direction of travel.

Country borders are drawn using as an inset semi-transparent colour, using a different colour for adjacent countries, when Natural Earth data is used containing the _MAPCOLOR7 attribute.

Major roads are no longer loaded at scales smaller than 1:15 million.

Style sheet XML schema changes

The <repeatedSymbol>, <oneWayArrow>, <startSymbol> or <endSymbol> element can now have a 'color' attribute. The specified color, if the attribute is present, is used to colorize any SVG icon used as a repeated symbol.

Polygon borders can be offset using the 'borderOffset' attribute in the <shape> element, which takes a dimension. To offset the border so that it is precisely inset in the polygon, use 'inset="yes"'.

The <icon> element has a new optional attribute, 'needsLabel'. If 'needsLabel' is 'true' or 'yes' the icon is drawn only if the label is present and can be drawn without overlap.

makemap standard import rules changes

Note that you can examine the standard import rules using the command 'makemap -writerules'.

When importing OSM data, the 'short_name' is now imported into all objects.

If the file land_polygons.shp (the standard file used for coastlines in combination with OSM data) is imported, all objects are now written to the 'outline' layer.

Most Natural Earth data files now have standard import rules, allowing Natural Earth data to be used easily and consistently.

Changes common to all APIs

Added a Framework function to insert elliptical map objects. The C++ function is

Result Framework::InsertEllipseMapObject(uint32_t aMapHandle,const String& aLayerName,
double aCenterX,double aCenterY,CoordType aCenterCoordType,double aRadiusX,double aRadiusY,CoordType aRadiusCoordType,double aRotationDegrees,
const String& aStringAttributes,FeatureInfo aFeatureInfo,uint64_t& aId,bool aReplace);

and other platform APIs are very similar except for iOS, where extra radiusX and radiusY properties have been added to the CartoTypeMapObjectParam class.

Added a function to return points along a great circle between to points given in degrees longitude and latitude. The C++ function is

std::vector<PointFP> GreatCircleLine(const PointFP& aStartPoint,const PointFP& aEndPoint,double aDistanceInMetres)

The NearestRoadInfo class, used by FindNearestRoad to return information, has a new member, SideOfRoad, which supplies
the side of the road on which the selected point lies, or SideOfRoad::None if the vehicle heading is not supplied.
It is Left if the heading vector is left of a vector from the chosen point to the nearest point on the road, otherwise Right.
Another way to understand it is: if the road as seen by the driver of the vehicle is to the left, the side of the road is Right, and vice versa.

Specific C++ API changes

There is a new function to create a MapRenderer object, trapping any errors so that they can be reported. In particular this allows desktop apps like the CartoType Maps App to attempt to load a large number of maps without crashing when there are no more file handles available. The new function is:

static std::unique_ptr<MapRenderer> New(Result& aError,Framework& aFramework,const void* aNativeWindow = nullptr);

specific .NET API changes

None

Specific UWP API changes

None

Specific Android API changes

Added the missing Legend methods setMainStyleSheet(), setLabelWrapWidth(), setDiagramColor(), setPolygonRotation(), hasTurnInstruction(),
setTurnInstruction(), and turnInstruction().

Specific iOS API changes

Added the CartoTypeMapObjectParam properties radiusX, radiusY and rotationDegrees to support the insertion of elliptical map objects.

Added the missing Legend functions setMainStyleSheet, setLabelWrapWidth, setDiagramColor, setPolygonRotation, hasTurnInstruction,
setTurnInstruction, and turnInstruction.

This release was made on 9th December 2022 and is based on commit 8.2-57-g51a9fa561 in the new Git repository.

The previous release was made on 5th July 2022 and was based on CartoType-mainline revision 10787 in the Mercurial repository.

Fast street address searching

The makemap tool now creates a street index table. Street address searching is now faster and more accurate when using map files containing the new table. Fast street address searching is used automatically for searches with a street name, a city name or postal code,and an optional building name or number. Abbreviations, omitted words and fuzzy matching are supported.

Mutual accessibility checking for the time/distance matrix function

The TimeAndDistanceMatrix function can run slowly if not all the points supplied are connected together by the network of routable roads. A new Framework function, MutuallyAccessible, checks at high speed whether any group of points is mutually connected, and optionally returns the IDs of the connectivity groups to which the points belong; group 1 is the largest group, so in practice any point not belonging to group 1 is inaccessible. A group ID of zero means that a point is not connected to any other points.

The MutuallyAccessible function is implemented only for the turn-expanded router (/route=t).

Changes common to all APIs

Added function Description (Framework::Description, Util.Description, etc.) to return the Git description of the current version, for example 8.2-55-gb3dc270af.

Added new FeatureType values AdminArea1 ... AdminArea10, Address, PostCode, Position and Quarter.

Replaced Framework function RouteAccess by MutuallyAccessible, which is more useful, and removed the RouteAccess class.

Added experimental functionality to set and get label redraw speed and fix label positions during panning. This functionality consists of Framework functions or properties for label FPS (frames per second) and to enable fixed labels.

Removed Framework function UseSerializedNavigationData; navigation data is now always read in serialized form.

Added function or property LabelUpAngle.

Specific C++ API CHANGES

Added function Rect::Expanded to expand a rectangle by a certain size.

Added functions CartoType::FeatureTypeIsCity and CartoType::FeatureTypeIsPOI.

Removed function Framework::MapUnitSize because map units are now always 32nds of a meter, as defined by the new constant KMapUnitsPerMeter.

Replaced function Framework::SetPerspective(const PerspectiveParam& aParam) with SetPerspectiveParam(const PerspectiveParam& aParam), which no longer turns perspective mode on.

Simplified semantics of function Framework::InsertCopyOfMapObject: string attributes, if supplied, override the original string attributes rather than being added to them.

Changed function Framework::SetLabelUpAngle to return the previous setting.

Removed function TextMetrics::Clear.Added a constant MapTableType::KStreetIndexTable for the new street index.

Removed the point-scale argument from the Route constructor: map units are now always 32nds of a meter.

Removed the PointScale data member from the Route class.

The AbbreviationDictionary class now supports stop words (words which can be removed completely) and suffixes.

The function MString::Abbreviate now takes an optional argument allowing the deletion of stop words.

Added function MString::FuzzyCompare, which returns an integer (0 for equality).

Specific .NET API changes

Removed Get prefix from Util functions 

Specific UWP API changes

None

Specific Android API changes

None

Specific iOS API changes

None

 

This release was made on 5th July 2022 and is based on mainline revision 10787.

The previous release, 7.8, was made on 28th March 2022 and was based on mainline revision 10409.

This is a major release which introduces many source code incompatibilities. They fall into two categories: renaming of public identifiers, and the introduction of simpler and consistent feature types for map objects. The aim is to make CartoType applications easier to write, read and debug.

The previous release will continue to be supported until 31st July 2024 and will receive bug fixes but no new features.

Renaming

Classes, functions and other identifiers have been systematically renamed, with the aim of improving consistency and removing outdated and unnecessary conventions.

Renaming in the C++ API

The general principle for the C++ API is to use Pascal case (the first letter of each compound word in an identifier is capitalised).

For reasons of supporting .NET APIs, the main namespace is now named CartoTypeCore. However, the name CartoType is defined as an alias if the header cartotype.h is used. Therefore user applications can continue to use the CartoType namespace qualifier.

Classes no longer have C (class) and T (type) prefixes. The M (mixin or interface) prefix, as in MString, has been retained. In most cases the removal of the prefix is quite simple, but in a very few cases such as TContour and CContour, which have become ContourView and Contour, and TBitmap and CBitmap, which have become BitmapView and Bitmap, other changes were necessary to avoid ambiguity.

Public data members no longer have the i (instance) prefix. For example, the Point class has data members X and Y. The former TPoint class had data members iX and iY.

The Rect and RectFP classes now have Min and Max data members, not TopLeft and BottomRight.

The Get prefix has been removed where possible: that is, from functions which return a single value that is implied by their names.

The K prefix has been retained for public numeric constants.

Renaming in the .NET API

The general principle for the .NET API is to use Pascal case.

Public data members now use Pascal case instead of the former convention of prefixing with m_. Where possible, these public data members have become properties. For example, the public data member RouteProfile.m_vehicle_type has become the property RouteProfile.VehicleType.

As with the C++ API the Get prefix has been removed where possible. For example, the function Geometry.GetCoordType has become the property Geometry.CoordType.

The K prefix has been retained for public numeric constants.

Renaming in the Android API

The general principle for the Android API is to use Pascal case for classes, and camel case (the first letter is lower case and other words in a compound identifier are capitalised) for public methods and public data members.

The i prefix has been removed from public data members. For example, LocationMatchParam.iLocationAccuracyInMeters has become locationAccuracyInMeters.

The get prefix has been removed where possible. For example, Framework.getLastMapHandle has become Framework.lastMapHandle.

Renaming in the iOS API

The general principle for the iOS API is to use Pascal case for classes, prefixed by CartoType to avoid ambiguity, and camel case (the first letter is lower case and other words in a compound identifier are capitalised) for public methods and public data members.

This has resulted in relatively little renaming. One example is the change of the CartoTypeRect public data members from x_min, y_min, x_max, and y_max to minX, minY, maxX and MaxY.

The get prefix has been removed where possible, and in many cases getters and setters have been replaced by properties.For example, the methods CartoTypeFramework.setNightModeColor and CartoTypeFramework.getNightModeColor have been replaced by the property CartoTypeFramework.nightModeColor.

The FeatureInfo class: consistent map object properties

The former integer attribute of a map object has been replaced by a FeatureInfo object. There is no size or efficiency overhead because FeatureInfo wraps a 32-bit integer.

Formerly the meaning of a map object's integer attribute was determined by convention, and without knowing those conventions it was impossible to discover the road type (e.g., Primary Road) or non-road feature type (e.g., Fuel Station) of a map object, or the access restrictions, level, one-way status, etc., of an object.

A FeatureInfo object has as one of its attributes a FeatureType. The FeatureType enumerated class combines the former TRoadType, OsmAttrib, and TPointOfInterestType types (to use the C++ names).

The main effect on the CartoType API of the FeatureInfo class is that a FeatureInfo object now needs to be supplied where formerly an integer attribute value was used, as in the functions to insert map objects.

The feature info for a route object contains:

  • discriminator: ordinary route, bridge or tunnel
  • a level in the range -8...+7
  • a feature type in the range 0...31; these are the route types, which also act as indexes into speed and bonus arrays in route profiles
  • flags for one-way, drive-on-left, roundabout and toll road
  • speed limit in kph
  • gradient code (only avalable in internal route calculation layers)
  • access flags (wrong-way, pedestrian, cycle, motor, emergency, other)

The feature info for a non-route object contains:

  • discriminator: always 0
  • a level in the range -8...+7
  • a feature type in the range 32...32767
  • a sub-type in the range 0...2047; sub-types are used to distinguish island sizes, settlement ranks, etc.

Simpler style sheets

CartoType 8.0 can read older style sheets correctly, with some very minor exceptions, but some attributes and other usages in style sheets have been simplified or abolished.

  • The roadflags attribute, used in the <CartoTypeStyleSheet> and <layer> elements, is no longer needed.
  • OsmType and RoadType in expressions have been replaced by @feature_type.
  • Type in expressions has been replaced by @sub_type, and it is no longer necessary to use a mask: for example, exp='(Type bitand #FFFF)=4' becomes exp='@sub_type=4'.
  • Attributes of a map object can be tested consistently in style sheet expressions using the variables @ or @type (map object type), @layer, @id, @feature_type, @feature_type_name, @sub_type, @level, @bridge, @tunnel, @one_way, @one_way_forward, @one_way_backward, @drive_on_left, @drive_on_right, @roundabout, @toll, @gradient, @private, @pedestrian_access, @cycle_access, @motor_vehicle_access, @other_access, and @wrong_way.

A new CTM1 format: CTM1 8.0

In the new CTM1 format, 8.0, FeatureInfo values are used consistently where either TRoadType, OsmType or KArc... values were used. The new version of makemap always creates CTM1 8.0 files. If you need to create CTM1 files in older versions (4.2 to 7.1) you can use the older version of makemap, now renamed makemap7.

Versions of CartoType before 8.0 cannot read CTM1 8.0 files.

CartoType 8.0 can read all CTM1 file formats from 4.2 to 8.0 inclusive.

New import rules

Many of the import rule commands have changed to support the new feature info system.

  • set_osm_type and set_road_type have been merged into set_feature_type; for example, <set_osm_type name='bou'/> becomes <set_feature_type name='bou'/>, and <set_road_type name='Motorway'/> becomes <set_feature_type name='motorway'/>.
  • set_road has been replaced by specific attribute setters such as set_cycle_access, set_pedestrian_access, etc.; set_feature_info_raw_value is available where low-level access is needed.
  • set_int_low has become set_sub_type.

The new version of makemap cannot read old-style import rule files (.makemap files) correctly. If you need to create CTM1 files using old-style .makemap files you can use the older version of makemap, now renamed makemap7.

This release was made on 29th March 2022 and is based on mainline revision 10409.

The previous release, 7.6, was made on 18th October 2021 and was based on mainline revision 10121.

Added time/distance matrix function

There is now a function to return a time/distance matrix giving the route time and distance for all combinations of a set of start points and a set of end points. It is implemented for the turn-expanded contraction hierarchy  /route=tech), turn-expanded (/route=t), and a-star (/route=a) routers. The fastest implementation by far is that for the TECH router, but that implementation does not support arbitrary run-time route profiles or dynamic road closures. The fastest flexible implementation, which does support those features, is that for the turn-expanded router.

There is a new makemap option, /hublabels=yes, which can be used in conjunction with /route=tech to add hub label data to the TECH route data to enable ultra-fast calculation of time/distance matrices.

Added route access function

There is now a function to return the accessibility of a point for routing purposes. It is implemented for the turn-expanded router (/route=t) only.

Added a function to get the traffic info speed limit

There is now a function to get the speed limit if any imposed by dynamic traffic information for a point. It returns the traffic info speed limit in kph for a given point and given vehicle types; that is, the most severe restriction applying to that point for polygonal restrictions containing the point, and for the nearest road to the point.

More consistent style sheet icons

Some standard style sheet icons have been changed for a more consistent appearance.

UWP support

CartoType is now available as a Universal Windows Platform (UWP) component. The API is very similar to the .NET API, but not identical because in UWP function overloading on anything other than number of arguments is not allowed.

C++ API changes

CFramework::EnableMapByHandle now returns TResult, not void
CFramework::EnableAllMaps now returns TResult, not void
Added CFramework::TimeAndDistanceMatrix
Added CFramework::RouteAccess
Removed CFramework::ObjectsDrawn
CFramework::GetMapGraphicsContext now returns std::shared_ptr<CGraphicsContext>, not CGraphicsContext&
The CFramework functions void AddNavigatorObserver(std::weak_ptr<MNavigatorObserver> aObserver) and
RemoveNavigatorObserver(std::weak_ptr<MNavigatorObserver> aObserver) have been replaced by
AddObserver(std::weak_ptr<MFrameworkObserver> aObserver) and
RemoveObserver(std::weak_ptr<MFrameworkObserver> aObserver)
Added CFramework::GetTrafficInfoSpeed
Removed the unused parameter aLabelMaxLength from CFramework::LoadIcon
The TFont class is now safer: it stores smart pointers to the engine, typeface and alt typeface, not raw pointers
Removed unused data members iWeight, iWorks, iToll and iLanes from CTrafficInfo
Added the CTimeAndDistanceMatrix class. An object of this type is returned by CFramework::TimeAndDistanceMatrix
Added the TRouteAccess enumeration. A value of this type is returned by CFramework::RouteAccess
Added the TAbbreviationType enumeration to specify where in a phrase an abbreviation can be used
Added the CAbbreviationDictionary type mapping a string to a TAbbreviation
MString::Abbreviate now takes a CAbbreviationDictionary instead of a CStringDictionary
Added a TText constructor taking null-terminated UTF-16 text
Added the TAbbreviation and TAbbreviationTableEntry classes to support the new abbreviation system

.NET API changes

Added PointValue: a value type for 2D points with floating-point coordinates
Added the TimeAndDistanceMatrix class
Added the RouteAccess enumeration
Added Framework.GetTimeAndDistanceMatrix
Added Framework.GetRouteAccess
Removed the unused parameter aLabelMaxLength from Framework.LoadIcon

Android API changes

Added Framework.timeAndDistanceMatrix
Added Framework.routeAccess
Added the TimeAndDistanceMatrix class
Added the RouteAccess class
Renamed Geometry.IntersectionType to intersectionType for consistency,
and renamed all other Geometry public functions starting with
capital letters to start with small letters in the same way
Removed unused data members iWeight, iWorks, iToll and iLanes from TrafficInfo

iOS API changes

Added the timeAndDistanceMatrix function to CartoTypeFramework
Added the routeAccess function to CartoTypeFramework
Added the CartoTypeTimeAndDistanceMatrix class
Added the CartoTypeRouteAccess enumeration
Added the CartoTypePointSet class for use by the timeAndDistanceMatrix function
Removed unused data members weight, works, toll and lanes from CartoTypeTrafficInfo

This release was made on 18th October 2021 and is based on mainline revision 10121.

The previous release, 7.4, was made on 27th July 2021 and was based on mainline revision 9961.

A new routing system with compact data

There is a new routing system, Turn-Expanded Compact. Use the option /route=tc in makemap. It requires much less run-time memory, but, unlike the contraction hierarchy systems, allows arbitrary route profiles to be set at run time. It is suitable for large areas such as the whole of the UK on mobile platforms like iOS and Android.

Map file metadata

There are new framework functions called MapMetaData, getMapMetaData, etc., in all APIs, to retrieve metadata from loaded maps. To get metadata for the first CTM1 file, call MapMetaData(0). The information returned includes the version of CartoType used to build the map, the type of route data it contains, its extent in degrees, and the projection name and parameters. The Maps App now displays metadata in its About dialog.

Labelling improvements (already merged into 7.4)

  • Fixed case 5909: not all labels are displayed in graphics accelerated mode.
  • Many more islands and polygons are now labelled.
  • Sea areas (bays and straits) are now imported and labelled.
  • Icons without labels are now displayed if the label position in the style sheet is 'icon'.

Improvements to tiled routing

Tiled routing now works even if an individual tile may be greater than 4Gb in size. If you get an error message like
'file position 0x1003be20b is too big to be stored in 4 bytes; try again using /largefile=yes', you can now act on the error
message and makemap will create both the main map and the tiles with 5-byte file positions.

Changes during the lifetime of 7.6

--- 7.6.0 ---
fixed case 5948: z-level adjustment not working for tiled NavStreets data
fixed case 5949: set_roundabout sets the one-way flag in XML input scripts (.makemap files) but not in ChaiScript; it no longer sets the one-way flag
implemented case 1361: pushpins that combine into one
--- 7.6.22 ---
fixed case 5953: crash in TileBitmap; parsing error in a style sheet caused write to a null pointer when assembling the error code
fixed case 5956: SetStyleSheet should parse style sheet at all zoom levels before installing it
fixed case 5957: segment fault when loading TIFF file; added default projection (Web Mercator) for images lacking a PRJ file or projection information in a TIFF table and new makemap command-line option /imageprojection=<EPSG code>
implemented case 5959: show parking icon only where parking is public; private car parks are no longer imported
implemented case 5960: suppress all duplicate strings in labels so that buildings and cities are not named twice
--- 7.6.30 ---
fixed case 5961: setting night mode does not work properly with the tile server
text drawing failed when a box formatting character (a Unicode private use character) was encountered
fixed case 5931: island label is duplicated
speeded up address finding by restricting the layers searched for nearby and surrounding items
CMapObject::VerboseDescription now reports the driving side
MPath::OffsetPath no longer smooths the offset path because parts of routes where the path goes back on itself disappear
fixed case 5964: extra turns around waypoints with CH routing
--- 7.6.39 ---
fixed regression: the Linux SDK no longer built the Qt map rendering library
fixed case 5965: two 15 weight turns at intersection to avoid one 20 weight traffic light turn for the turn-expanded router; turn delays should have been imposed even at junctions with no choice
fixed case 5964: extra turns around waypoints, for the other routing systems
fixed failure to create correct route data or use it correctly if route data was larger than 4Gb
--- 7.6.50 ---
CNavigator::Range did not restore the routing profile after changing it
the TECH routing data was written with many duplicate shortcut arcs; the new version of makemap writes TECH data that is half the size
--- 7.6.55 ---
fixed case 5969: horizontal bands flipped vertically in TIFF file
code to remove heading vector segment was wrong in turn expanded router
insertMapObject in the Android API was mistakenly private, not public
the turn-expanded router set the position in lat/long for backward roads incorrectly
retargeted the C# demo to use .NET 4.8 because earlier versions are no longer supported or will soon reach end of life
changed the Windows and .Net build scripts to use vs2022
an arc connected at both ends to the same node caused a crash in makemap when creating CH data for Latvia
--- 7.6.66 ---
CGeometry objects containing off-curve points were not converted into COutline objects correctly: the off-curve points were converted to on-curve points
setting traffic info now uses the current route profile, not a default car profile
fixed a possible crash in the tc router when adding traffic restrictions
fixes case 5978: polygon traffic restrictions defined by roads do not work in the A-star router
FindAddress did not obey the aMaxObjectCount argument
printing didn't work in the Windows maps app because the Windows printer support DLL wasn't distributed with the app
--- 7.6.73 ---
the turn-expanded router did not create turn information correctly at the start and end of routes
the delay-at-junction flag was not serialised in the turn-expanded router data
turn-expanded compact data now uses less RAM when being read, making it more likely for low-memory platforms to be able to load map data
fixed case 5984: shortest route option doesn't work
--- 7.6.81 ---

 

This release was made on 27th July 2021 and is based on mainline revision 9961.

The previous release, 7.2, was made on 13th May 2021 and was based on mainline revision 9870.

Setting colors of map objects individually

It is now possible to give every map object that is a line or a polygon its own main color and border color, overriding any colors set in the style sheet. Formerly that was possible only for
icons. The new feature is principally useful when inserting map objects at run time ('dynamic map objects') but can be used when building the CTM1 file by inserting appropriate logic in the .makemap rules.

The colors are set using the map object attributes _color and _border_color. They can use any color expression that is valid in a style sheet. For example: 'blue', 'orange+0.25white', '#A00', '#08123456'. Formally, a color expression consists of one or more sections separated by plus signs. The format of a section is

{ '+' { blend-ratio } } hex-color | color-name

where blend-ratio is an optional number; if it's between 0 and 1 inclusive it's treated as a fraction, otherwise as a number of 255ths; and hex-color is either #RGB, #RGBA, #RRGGBB or #RRGGBBAA. The plus sign and blend-ratio are legal only if there is a previous color to blend with.

Applying color effects to the entire style sheet: generalising night mode

Previous versions allowed a 'night mode' to be set, in which roads were made brighter and other layers were blended with a dark color to make them less prominent.

It is now possible to apply color changes to any layer or layers in the style sheet using a blend style set (TBlendStyleSet in the C++ API), which is a vector of blend styles. A blend style is a list of style names, which may include names with wild cards, and a series of colors to be blended with the main color, border color, text color, text glow color, and icon color for those styles. The blend styles are applied in order.

This generalisation of the idea of night mode allows, for example, all map objects to be drawn in a faint version of their usual colors, by blending with white, except for layers of interest, which can be drawn in brighter colors.

The colors in a blend style are treated as RGB colors. The alpha value is used as the blend ratio. The alpha value of the target color is preserved during blending, to maintain the overall visual intent of the style sheet.

New error codes to diagnose missing files and style sheet errors

There are three new error codes, KErrorMapNotFound (63), KErrorFontNotFound (64) and KErrorStyleSheetNotFound (65) to help identify the reason for a failure to create a Framework object.

In addition, style sheet errors can be located by line and column number. The error codes returned by XML parsing have been redesigned to hold the Expat parser error code, the line number, and the column number of the error. XML errors are now in the range KErrorXmlRangeStart (0x10000000) to  ErrorXmlRangeEnd (0x2AFFFFFF) inclusive. The high byte is 0x10 for errors specific to CartoType's style sheet system (e.g., nested <layer> sections), or is in the range 0x11 to 0x2A for Expat XML parser error codes. The low three bytes give the error location: one byte for the column number and the two low bytes for the line number.

The ErrorString function, which now exists on all platforms, unpacks this and other error codes into a readable string, which is supplied when an exception is thrown on the .NET, Android and iOS SDKs. In the C++ SDK the exception type remains TResult, but the user can easily call ErrorString to obtain the string version of the error.

Inserted objects are drawn in order of insertion

Map objects inserted at run-time are now drawn, if they are in the same layer and the same <condition> within the layer, in order of their map object IDs, which by default is the order in which they are inserted. Thus newer objects are consistently drawn over older objects so that user supplied graphics can be used to build up a picture.

This release was made on 5th March 2021 and is based on mainline revision 9722. It is a major release with incompatible changes to APIs, which are detailed below.

The previous release, 6.2, was made on 5th September 2020 and was based on mainline revision 9241.

Tiled route data

The makemap tool can now split contraction hierarchy route data into tiles. Any subset of the tiled maps from a particular makemap run can be used together, and routing will work using the tiles that are present. You can load and unload maps at any time. Routing will use the tiles that are available. If you load extra tiles and recreate a route, the new route may be different because of the added route data. If CartoType can't create a route because of missing tiles you will get the 'no route connectivity' error.

To create a set of tiled maps, use the makemap option /route=ct{N} for ordinary contraction hierarchy (the same system as /route=cs), or /route=tt for turn-expanded contraction hierarchy (the same system as /route=tech). The optional value N is the tile size in degrees, the default value being 1. Legal values are 1, 2, 4, 8 and 16. 4 is recommended for most purposes.

Removal of home-grown integer types

The integer types CartoType::int32, CartoType::uint16, etc., have been removed from the C++ API because they are no longer needed. The standard integer types int32_t, uint16_t are used instead.

Internal use of exception-based error handling

Nearly all internal functions now use exceptions of type TResult instead of error codes. This does not affect the public APIs, which still use error codes. The move to exceptions makes the code more reliable, less prone to memory leaks, and easier to maintain and debug. The error codes KErrorOverlap, KErrorPathLengthExceeded, KErrorMaxTurnExceeded, and KErrorCentralPath are no longer used, and a new error code KErrorXmlFeatureNotSupported (value = 62) has been added. No existing error codes have changed.

Removal of obsolete features

  • The ability to draw maps from a tile source has been removed.
  • The image server, which was a system to draw maps using cached tile bitmaps, has been removed.
  • Support for the web map service (WMS) system has been removed.

C++ API changes

  • CBitmap has a new constructor: explicit CBitmap(MInputStream& aInputStream)
  • The result constants KErrorNone, etc., now have type TResult, not int32_t, so that when they are thrown as exceptions the type is distinct.
  • The result constants KErrorOverlap, KErrorPathLengthExceeded, KErrorMaxTurnExceeded, KErrorCentralPath, have been removed.
  • Graphics operations now return TDrawResult, not TResult.
  • CFrameworkEngine::CancelDrawing has been removed.
  • TViewState has a new constructor: explicit TViewState(const char* aXmlText)
  • The CFramework::AppendStyleSheet functions now return TResult instead of being void.
  • A new function 'TFileLocation StyleSheetErrorLocation() const' returns error location information set by the last style sheet load operation.
  • CFramework::GetHeights now returns a vector of integers instead of writing to pointers supplied by the caller.
  • CFramework::SetNearbyObjectWarning now takes an extra parameter, a reference to TResult.
  • CFramework::SetVehicleTypeWarning now takes an extra parameter, a reference to TResult.
  • CFramework::SetVehiclePosOffset is now void instead of returning TResult.
  • There is a new function 'bool CFramework::TrackIsDisplayed'.
  • The deprecated overload of CFramework::InsertMapObject taking an object type has been removed.
  • The obsolete CFindFramework class has been removed.
  • Clipping and envelope functions have been added to CGeometry, allowing geometry objects to be built from operations on map objects.

The following functions now return TResult instead of being void:

  • CFramework::License
  • CFramework::SetTurnInstructions
  • CFramework::Resize
  • CFramework::SetScaleDenominator
  • CFramework::SetScaleDenominatorInView
  • CFramework::Zoom
  • CFramework::Rotate
  • CFramework::SetRotation
  • CFramework::SetViewLimits
  • CFramework::SetMainProfile
  • CFramework::AddProfile
  • CFramework::GetNavigationData
  • CFramework::DisplayTrack

.NET API changes

  • Clipping and envelope functions have been added to Geometry, allowing geometry objects to be built from operations on map objects. They use the new ClipOperation enum class.
  • There is a new GeometryList class which is a list of Geometry objects.
  • The function Framework.SetCase has been added to provide letter-case operations in a consistent way. It uses the new LetterCase enum class.

The following functions now return Result instead of being void:

  • Framework.License
  • Framework.SetTurnInstructions
  • Framework.SetScaleDenominator
  • Framework.SetScaleDenominatorInView
  • Framework.Zoom
  • Framework.Rotate
  • Framework.SetRotation
  • Framework.SetMainProfile
  • Framework.AddProfile

Android API changes

  • Clipping and envelope functions have been added to Geometry, allowing geometry objects to be built from operations on map objects. They use the new ClipOperation enum class.
  • The deprecated functions Framework.version, Framework.build and Framework.setAttribute have been removed. Use Util.version, Util.build and Util.setAttribute instead.
  • The deprecated version of Framework.insertMapObject that took a map object type parameter has been removed. Use the new version which
    deduces the map object type from the gemoetry object passed in.
  • The function Framework.getPolygonArea has been removed. Use the new function getArea, which takes a Geometry object. There is also
    a new function GetLengthOrPerimeter which takes a Geometry object.
  • The deprecated route creation functions taking coordinate arrays have been removed. Use the versions taking a RouteCoordSet object.
  • The function Framework.profile has been added to return one of the currently active route profiles.
  • The function Framework.getHeightProfile has been removed.
  • The function Framework.useImageServer has been removed because the image server system is no longer supported.
  • There is a new function Framework.setCase to set the letter case of a string. It uses the new LetterCase enum class.

The following functions now return an integer error code instead of being void:

  • Framework.license
  • Framework.setTurnInstructions
  • Framework.resize
  • Framework.setScale
  • Framework.setScaleDenominatorInView
  • Framework.zoom
  • Framework.zoomIn
  • Framework.zoomOut
  • Framework.rotate
  • Framework.setRotation
  • Framework.setRotationAt
  • Framework.setMainProfile
  • Framework.addProfile

iOS API changes

All methods taking 'const char *' in the Objective C interface now take 'NSString*'.

Structures called CartoTypePointAndResult, CartoTypeIdAndResult, and CartoTypeAreaLengthAndResult have been added to make it possible
to return multiple results without using unsafe pointers.

  • The CartoTypeCoordSet struct has been removed.
  • The CartoTypePath protocol's point method now returns a CartoTypePathPoint directly instead of taking a pointer to CartoTypePathPoint.
  • CartoTypeMapObject now implements the CartoTypePath protocol.
  • Clipping and envelope functions have been added to CartoTypeGeometry, allowing geometry objects to be built from operations on map objects. They use a new enum, CartoTypeClipOperation.
  • There is a new method in CartoTypeFramework called setCase to set the letter case of a string. It uses the new CartoTypeLetterCase enum.
  • The CartoTypeFramework method loadMapWithTileParam has been removed because tiled map data sources are no longer supported.
  • The CartoTypeFramework methods insertPushPin and insertCopyOfMapObject now return CartoTypeIdAndResult so as to return the new object's ID without having to use an unsafe pointer.
  • The CartoTypeFramework method deleteObjectsFromMap now returns the number of objects deleted, not a CTResult.
  • The CartoTypeFramework method convertCoords now takes a CartoTypeGeometry object instead of a CartoTypeCoordSet.
  • The CartoTypeFramework method convertPoint now returns CartoTypePointAndResult so as to return the converted point without having to use an unsafe pointer.
  • The CartoTypeFramework method getHeights now takes a CartoTypeGeometry and returns an array of NSNumber.
  • The CartoTypeFramework method getHeightProfile has been removed.
  • The deprecated route creation methods taking CartoTypeCoordSet have been removed. Use the versions taking a CartoTypeRouteCoordSet object.
  • The CartoTypeFramework method getProfile has been added to return one of the currently active route profiles.
  • The CartoTypeFramework method getBuiltInProfile now returns a CartoTypeRouteProfile object instead of a CTResult.

The following CartoTypeFramework methods now return CTResult instead of being void:

  • license
  • setTurnInstructions
  • setMapWidth:andHeight
  • setScaleDenominator
  • setScaleDenominatorInView
  • zoom
  • rotate
  • setRotation
  • setMainProfile
  • setMainProfileType
  • addProfile

 

 

This release was made on 13th May 2021 and is based on mainline revision 9870.

The previous release, 7.0, was made on 5th March 2021 and was based on mainline revision 9722.

Map object editing functions

There are new functions to make it easier to add interactive editing to a CartoType application. They manage the creation and editing of linear and polygonal objects by means of pointer presses and movements and allow the new objects to be added to any layer of the map.

The Maps App demonstrates some of the new functions using these actions:

  • Double-click starts a new linear object OR select an existing object; when selecting an object the action selects an existing point if near enough, otherwise creates a new point.
  • Shift-double-click starts a new polygonal object OR selects an existing object if near enough in the same way as plain double-click.
  • Escape terminates editing the current object.
  • Backspace deletes the last point if there are more than two (for a line) or more than three (for a polygon). It then terminates editing the current object.
  • Delete removes the current object, asking for confirmation first.

During editing, the length or area of the current object is shown in the status bar at the bottom of the window.

The map editing functions are as follows in the C++ API. They have similar names in the other APIs.

 /**
Sets the map used to store editable objects. Does not affect objects already created.
If this function is not called, editable objects are stored in the map used for
route objects.
*/
TResult CFramework::EditSetWritableMap(uint32_t aMapHandle);
 /** Creates a new editable line object starting at the specified point. */
TResult CFramework::EditNewLineObject(const TPointFP& aDisplayPoint);

/** Creates a new editable polygon object starting at the specified point. */
TResult CFramework::EditNewPolygonObject(const TPointFP& aDisplayPoint);

/** Moves the editable object's current point if any. */
TResult CFramework::EditMoveCurrentPoint(const TPointFP& aDisplayPoint);

/** Adds a new point to the editable object by copying the current point. */
TResult CFramework::EditAddCurrentPoint();
 /** Deletes the editable object's current point unless that would result in a line object of fewer than 2 points, or a polygon object of fewer than 3. */
TResult CFramework::EditDeleteCurrentPoint();

/** Deletes the current editable object. */
TResult CFramework::EditDeleteCurrentObject();

/**
Selects an editable object by selecting the nearest point of any editable object within a given radius.
If the point is not within the given radius of an existing point, creates a new point.
*/
TResult CFramework::EditSelectNearestPoint(const TPointFP& aDisplayPoint,double aRadiusInMillimeters);
 /**
Inserts the currently edited object into a chosen layer, converting it from an edited object into an ordinary object.
If aId is non-zero and aReplace is true, replaces any existing object with that ID, otherwise creates a new object.
The ID of the new object is returned in aId.
*/
TResult CFramework::EditInsertCurrentObject(const CString& aLayer,uint64_t& aId,bool aReplace);
 /** Sets a string attribute in the currently edited object. If aKey is empty, sets the label. If aValue is empty, deletes the attribute. */
TResult CFramework::EditSetCurrentObjectStringAttribute(const CString& aKey,const CString& aValue);

/** Sets the integer attribute of the currently edited object. */
TResult CFramework::EditSetCurrentObjectIntAttribute(uint32_t aValue);

/**
Returns the area and length of the currently edited object.
For line objects returns 0 and the length in meters.
For polygon objects returns the area in square meters and the perimeter in meters.
*/
TResult CFramework::EditGetCurrentObjectAreaAndLength(double& aArea,double& aLength) const;

Saving and loading maps to and from memory

There are new functions to save maps to memory and load them from data stored in memory. They are intended to allow applications to save small numbers of user-added objects, such as pushpins and objects added using the new editing functions, to serialised strings that can be stored in an application data system such as UserDefaults on iOS.

The new functions are as follows in the C++ API. They have similar names in the other APIs.

 /**
Saves selected objects to a map identified by its handle by writing them as an array of bytes in CTMS format.
aFindParam can be used to select the objects to be saved.
If aMapHandle is zero it means the in-memory map used for routing.
*/
TResult CFramework::SaveMap(uint32_t aHandle,std::vector<uint8_t>& aData,const TFindParam& aFindParam);
 /**
Reads map data from aData in CTMS format and merges it into the map identified by aHandle,
which must refer to a writable map database.
If aMapHandle is zero it means the in-memory map used for routing.
*/
TResult CFramework::ReadMap(uint32_t aHandle,const std::vector<uint8_t>& aData)

Map object convenience functions returning points in lat/long

There are new convenience functions in CMapObject or MapObject to return points in degrees of latitude and longitude.

The new functions are as follows in the C++ API. They have similar names in the other APIs.

 /**
Returns the center of a map object in degrees.
The center is defined as the center of gravity for polygons and arrays,
a point half way along the path for lines, and the point itself for points.
Because the center is calculated using map coordinates then converted to degrees,
it depends on the map projection used by the map object.
*/
TPointFP CMapObject::CenterInDegrees(TResult& aError) const;
 /** Returns the bounding box of a map object in degrees. */
TRectFP CMapObject::BoundsInDegrees(TResult& aError) const;
 /** Returns the geometry of a map object in degrees. */
CGeometry CMapObject::GeometryInDegrees(TResult& aError) const;

Finding the route taking the shortest time

The normal function of the 'shortest' flag in the route profile object (iShortest in C++) is to make routing provide the shortest route by distance. It is now possible to change that behaviour so that the shortest route by time, not distance, is found. To do that, set the new flag iShortestByTime to true It has an effect only when iShortest is also set; that is, it modifies the behaviour of iShortest.

Enable and disable hardware-accelerated drawing by a separate thread (Windows and .NET only)

A function has been added to enable and disable hardware-accelerated drawing by a separate thread:

 /**
Enables or disables drawing by a separate thread. Returns the previous state.
This function is intended for users who need the full capacity of the GPU
for a period when drawing is unnecessary.
When drawing is disabled, draw events can be handled by calls to Draw, but it is also necessary
to create a timer to redraw occasionally (e.g., once per second) to allow missing tiles to be
created and drawn after pans, zooms and other changes affecting the display.
*/
bool CMapRenderer::Enable(bool aEnable);

iOS-only changes

In anticipation of Apple removing support for GLKit, which provides an OpenGL ES 2.0 API, CartoType's iOS SDK now uses the open-source MetalANGLE framework instead of GLKit.

The iOS SDK is now supplied as a zip file, not a DMG file. It contains SDKs for both iOS on a device and iOS on a simulator. Note that when you create an app using this new SDK you have to add both the iOS and the MetalANGLE SDKs to your app. Select your app, then select your build under TARGETS, then Build Phases -> Embed Frameworks, then add both CartoType.framework and MetalANGLE.framework, and tick 'Code Sign On Copy'.

Added missing functions:

CartoTypeFramework.getHeight to get the heights above sea level of the points in a Geometry object
CartoTypeFramework.pixelsToMeters
CartoTypeFramework.metersToPixels

.NET-only changes

Removed deprecated functions and other obsolete functions:

MapObject.GetIntegerAttribute(int aIndex)
MapObject.GetIntegerAttributeCount()
MapObject.GetDistanceToRoute()
MapObject.GetDistanceAlongRoute()
Framework.InsertMapObject(int aMapHandle,MapObjectType aType,String^ aLayerName,Geometry^ aGeometry,
String^ aStringAttributes,int aIntAttribute,Int64% aId,bool aReplace)

For the last function, use the new version without aType. The type is now deduced from the type of the
geometry object.

Android-only changes

Added missing functions:

Framework.pixelsToMeters
Framework.metersToPixels
Framework.dataSetName

Removed obsolete functions:

MapObject.getDistanceToRoute()
MapObject.getDistanceAlongRoute()

Release date: 7th February 2018

Previous release: 4.4, 27th July 2017

Summary of changes

The graphics acceleration system known as CartoType GL is now incorporated into the standard version of CartoType. To use it, you create a CFramework object in the normal way, loading the map, style sheet and fonts, then create a CMapRenderer object referencing your framework. You can then draw the map at, for example, thirty frames per second, in response to a timer event.

The CMapRenderer class is a C++ class. For Android there is the Java class MapRenderer, and for iOS there is the Objective C class CartoTypeMapRenderer.

Graphics acceleration is available for iOS, Android, Windows (desktop), OS X (Macintosh), and Linux. It is available on the Qt framework for Windows (desktop), OS X (Macintosh) and Linux.