-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
127 additions
and
628 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
#if !os(Linux) | ||
import CoreLocation | ||
#endif | ||
import Foundation | ||
import GISTools | ||
|
||
@available(*, unavailable, renamed: "VectorTile.ExportOptions", message: "This struct has been moved to the VectorTile namespace") | ||
public struct VectorTileExportOptions {} | ||
|
||
extension VectorTile { | ||
|
||
/// Various export options. | ||
public struct ExportOptions { | ||
|
||
/// Options for the buffer around tiles. | ||
public enum BufferSizeOptions { | ||
/// Use the same dimension as ``ExportOptions.extent``. | ||
case extent(Int) | ||
/// Use pixels (see ``ExportOptions.tileSize``). | ||
case pixel(Int) | ||
} | ||
|
||
/// Gzip options. | ||
public enum CompressionOptions: Equatable { | ||
/// Don't compress the vector tile data. | ||
case no | ||
/// The default compression level (*6*). | ||
case `default` | ||
/// A compression level, between *0* (no compression) and *9* (best compression). | ||
case level(Int) | ||
} | ||
|
||
/// Options for Feature simplification. | ||
public enum SimplifyFeaturesOptions { | ||
/// Don't simplify featutes. | ||
case no | ||
/// Use the same dimension as ``ExportOptions.extent``. | ||
case extent(Int) | ||
/// Use meters. | ||
case meters(CLLocationDistance) | ||
} | ||
|
||
/// The grid width and height of one tile. Always 4096. | ||
public let extent = 4096 | ||
|
||
/// The tile size in pixels. Always 256. | ||
public let tileSize = 256 | ||
|
||
/// The buffer around the tile, either in pixels (see ``tileSize``) or in the same dimension as ``extent`` (default: **0**). | ||
public var bufferSize: BufferSizeOptions = .extent(0) | ||
|
||
/// Whether to enable compression or not (default: **no**) | ||
/// | ||
/// Uses Gzip. | ||
public var compression: CompressionOptions = .no | ||
|
||
/// Simplify features before encoding them (default: **no**). | ||
public var simplifyFeatures: SimplifyFeaturesOptions = .no | ||
|
||
public init( | ||
bufferSize: BufferSizeOptions = .extent(0), | ||
compression: CompressionOptions = .no, | ||
simplifyFeatures: SimplifyFeaturesOptions = .no) | ||
{ | ||
self.bufferSize = bufferSize | ||
self.compression = compression | ||
self.simplifyFeatures = simplifyFeatures | ||
} | ||
|
||
} | ||
|
||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.