MSFContourTileDataSource
Objective-C
@interface MSFContourTileDataSource : MSFTileDataSource
Swift
class MSFContourTileDataSource : MSFTileDataSource
A tile data source generating vector contour lines on the fly from an RGB-encoded DEM data source, emitting one line layer (default “contour”) whose features carry ‘ele’ (meters) and ‘div’ (largest of 1000/500/250/200/100/50/20/10 dividing it). Note: this class is experimental and may change or even be removed in future SDK versions.
-
Constructs a ContourTileDataSource object.
Declaration
Objective-C
- (id)initWithDataSource:(MSFTileDataSource *)dataSource elevationDecoder:(MSFElevationDecoder *)elevationDecoder;Swift
init!(dataSource: MSFTileDataSource!, elevationDecoder: MSFElevationDecoder!)Parameters
dataSourceThe RGB-encoded elevation data source to generate contours from.
elevationDecoderThe decoder for tiles whose ‘dem_encoding’ metadata names none. If null, such tiles decode as mapbox.
-
Constructs a ContourTileDataSource object, inferring the elevation decoder from the data source ‘dem_encoding’ metadata (defaults to mapbox).
Declaration
Objective-C
- (id)initWithDataSource:(MSFTileDataSource *)dataSource;Swift
init!(dataSource: MSFTileDataSource!)Parameters
dataSourceThe RGB-encoded elevation data source to generate contours from.
-
Returns the name of the generated vector tile layer.
Declaration
Objective-C
- (NSString *)getLayerName;Swift
func getLayerName() -> String!Return Value
The layer name. The default is “contour”.
-
Sets the name of the generated vector tile layer. This must match the layer id used in the CartoCSS style.
Declaration
Objective-C
- (void)setLayerName:(NSString *)name;Swift
func setLayerName(_ name: String!)Parameters
nameThe layer name.
-
Returns the base contour interval in meters.
Declaration
Objective-C
- (float)getBaseInterval;Swift
func getBaseInterval() -> FloatReturn Value
The base contour interval in meters. The default is 10.
-
Sets the base contour interval in meters: the finest interval generated, see setIntervalMultiplier.
Declaration
Objective-C
- (void)setBaseInterval:(float)interval;Swift
func setBaseInterval(_ interval: Float)Parameters
intervalThe base contour interval in meters.
-
Sets the interval multiplier of BaseInterval used at tile zooms up to (and including) maxZoom. The default table is (9, 50), (11, 10), (13, 5), (any, 1). Multipliers must nest (each a multiple of the finer ones) or lines stop dead at borders between tiles of different zoom.
Declaration
Objective-C
- (void)setIntervalMultiplier:(int)maxZoom multiplier:(float)multiplier;Swift
func setIntervalMultiplier(_ maxZoom: Int32, multiplier: Float)Parameters
maxZoomThe highest tile zoom this multiplier applies to, or -1 for every zoom above the other entries.
multiplierThe multiplier of BaseInterval, >= 1.
-
Returns the interval multiplier that applies at the given tile zoom.
Declaration
Objective-C
- (float)getIntervalMultiplier:(int)zoom;Swift
func getIntervalMultiplier(_ zoom: Int32) -> FloatParameters
zoomThe tile zoom.
Return Value
The multiplier of BaseInterval.
-
Removes every interval multiplier entry, so BaseInterval is used at every zoom.
Declaration
Objective-C
- (void)clearIntervalMultipliers;Swift
func clearIntervalMultipliers() -
Returns the target grid resolution used for contour tracing.
Declaration
Objective-C
- (int)getResolution;Swift
func getResolution() -> Int32Return Value
The target grid resolution, 0 for the DEM’s own. The default is 128.
-
Sets the target grid resolution (max samples per side) used for contour tracing; lower is coarser but cheaper. Over 3D terrain use 0: a line traced on a subsampled grid cuts through the displaced surface between samples.
Declaration
Objective-C
- (void)setResolution:(int)resolution;Swift
func setResolution(_ resolution: Int32)Parameters
resolutionThe target grid resolution (clamped to at least 8), or 0 for the DEM’s own.
-
Sets the tracing grid resolution used at tile zooms up to (and including) maxZoom, overriding Resolution there. Empty by default: a coarse grid at low zoom is cheap but turns contours into visible straight chords.
Declaration
Objective-C
- (void)setResolutionForZoom:(int)maxZoom resolution:(int)resolution;Swift
func setResolutionForZoom(_ maxZoom: Int32, resolution: Int32)Parameters
maxZoomThe highest tile zoom this resolution applies to, or -1 for every zoom above the other entries.
resolutionThe target grid resolution (clamped to at least 8), or 0 for the DEM’s own.
-
Returns the tracing grid resolution that applies at the given tile zoom.
Declaration
Objective-C
- (int)getResolutionForZoom:(int)zoom;Swift
func getResolutionForZoom(_ zoom: Int32) -> Int32Parameters
zoomThe tile zoom.
Return Value
The target grid resolution, 0 for the DEM’s own.
-
Removes every per-zoom resolution entry, so Resolution is used at every zoom.
Declaration
Objective-C
- (void)clearResolutionsForZoom;Swift
func clearResolutionsForZoom() -
Returns the minimum zoom at which contour geometry is generated.
Declaration
Objective-C
- (int)getMinVisibleZoom;Swift
func getMinVisibleZoom() -> Int32Return Value
The minimum contour zoom. The default is 5.
-
Sets the minimum zoom at which contour geometry is generated; below it loadTile returns an empty tile. Note: in CartoCSS ‘zoom’ means the tile zoom, so the style must also draw that range.
Declaration
Objective-C
- (void)setMinVisibleZoom:(int)zoom;Swift
func setMinVisibleZoom(_ zoom: Int32)Parameters
zoomThe minimum contour zoom.
-
Returns whether seamless tile edges are enabled.
Declaration
Objective-C
- (BOOL)isSeamlessEdgesEnabled;Swift
func isSeamlessEdgesEnabled() -> BoolReturn Value
True if seamless edges are enabled. The default is true.
-
Sets whether to generate seamless tile edges, fetching the east/north/north-east neighbour DEM tiles so lines meet exactly at tile boundaries. Costs up to three extra DEM fetches/decodes per tile (usually cached).
Declaration
Objective-C
- (void)setSeamlessEdgesEnabled:(BOOL)enabled;Swift
func setSeamlessEdgesEnabled(_ enabled: Bool)Parameters
enabledTrue to enable seamless edges.
-
Returns the terrain options whose elevation manager the label stubs read.
Declaration
Objective-C
- (MSFTerrainOptions *)getTerrainOptions;Swift
func getTerrainOptions() -> MSFTerrainOptions!Return Value
The terrain options, or null.
-
Sets the terrain options whose elevation manager the label stubs are walked over, so stubs reuse the terrain’s decoded grid instead of decoding the DEM again. Must be driven by the same elevation data source this source wraps. Traced contour geometry still reads the DEM itself.
Declaration
Objective-C
- (void)setTerrainOptions:(MSFTerrainOptions *)terrainOptions;Swift
func setTerrainOptions(_ terrainOptions: MSFTerrainOptions!)Parameters
terrainOptionsThe terrain options, or null to decode a DEM tile of our own.
-
Returns whether only short label stubs are generated instead of full contour lines.
Declaration
Objective-C
- (BOOL)isLabelStubsEnabled;Swift
func isLabelStubsEnabled() -> BoolReturn Value
True if label stubs are generated. The default is false.
-
Sets whether to generate short label stubs (tagged ‘stub’ = 1) instead of full contour lines, for when the lines are drawn by HillshadeRasterTileLayer.setContourEnabled. Set LabelInterval to that layer’s ContourInterval (or leave both at defaults) or the labels sit between the lines.
Declaration
Objective-C
- (void)setLabelStubsEnabled:(BOOL)enabled;Swift
func setLabelStubsEnabled(_ enabled: Bool)Parameters
enabledTrue to generate label stubs only.
-
Returns the contour interval used for label stubs.
Declaration
Objective-C
- (float)getLabelInterval;Swift
func getLabelInterval() -> FloatReturn Value
The label interval in meters, or 0 to follow the zoom-dependent interval. The default is 0.
-
Sets the contour interval used for label stubs, in meters. Use 0 to follow the same zoom-dependent interval the traced geometry uses.
Declaration
Objective-C
- (void)setLabelInterval:(float)interval;Swift
func setLabelInterval(_ interval: Float)Parameters
intervalThe label interval in meters.
-
Returns the simplification tolerance in tile pixels.
Declaration
Objective-C
- (float)getSimplifyTolerance;Swift
func getSimplifyTolerance() -> FloatReturn Value
The simplification tolerance in tile pixels. The default is 1.5.
-
Sets the simplification tolerance in tile pixels. Use 0.0 to disable simplification.
Declaration
Objective-C
- (void)setSimplifyTolerance:(float)tolerance;Swift
func setSimplifyTolerance(_ tolerance: Float)Parameters
toleranceThe simplification tolerance in tile pixels.
-
Undocumented
Declaration
Objective-C
- (int)getMinZoom;Swift
func getMinZoom() -> Int32 -
Undocumented
Declaration
Objective-C
-(int)getMinZoomSwigExplicitMSFContourTileDataSource;Swift
func getMinZoomSwigExplicitMSFContourTileDataSource() -> Int32 -
Undocumented
Declaration
Objective-C
- (int)getMaxZoom;Swift
func getMaxZoom() -> Int32 -
Undocumented
Declaration
Objective-C
-(int)getMaxZoomSwigExplicitMSFContourTileDataSource;Swift
func getMaxZoomSwigExplicitMSFContourTileDataSource() -> Int32 -
Undocumented
Declaration
Objective-C
- (MSFMapBounds *)getDataExtent;Swift
func getDataExtent() -> MSFMapBounds! -
Undocumented
Declaration
Objective-C
-(MSFMapBounds*)getDataExtentSwigExplicitMSFContourTileDataSource;Swift
func getDataExtentSwigExplicitMSFContourTileDataSource() -> MSFMapBounds! -
Undocumented
Declaration
Objective-C
- (NSString *)getContainerMetaData:(NSString *)key;Swift
func getContainerMetaData(_ key: String!) -> String! -
Undocumented
Declaration
Objective-C
-(NSString*)getContainerMetaDataSwigExplicitMSFContourTileDataSource: (NSString*)key;Swift
func getContainerMetaDataSwigExplicitMSFContourTileDataSource(_ key: String!) -> String! -
Undocumented
Declaration
Objective-C
- (MSFTileData *)loadTile:(MSFMapTile *)tile;Swift
func load(_ tile: MSFMapTile!) -> MSFTileData! -
Undocumented
Declaration
Objective-C
-(MSFTileData*)loadTileSwigExplicitMSFContourTileDataSource: (MSFMapTile*)tile;Swift
func loadTileSwigExplicitMSFContourTileDataSource(_ tile: MSFMapTile!) -> MSFTileData! -
Undocumented
Declaration
Objective-C
-(void)dealloc;Swift
func dealloc()