Documentation ¶
Overview ¶
Diglet is a set of geospatial tools focused around rendering large feature sets efficiently.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( CsvExt = "csv" GeojsonExt = "geojson" )
View Source
var Cmd = cli.Command{ Name: "mbt", Aliases: []string{"build"}, Usage: "Builds an mbtiles database from the input data source", Description: "Builds an mbtiles database from the given format", ArgsUsage: "input_source", Action: func(c *cli.Context) { out := c.String("output") desc := c.String("desc") layer := c.String("layer-name") zmin := c.Int("min") zmax := c.Int("max") extent := uint(c.Int("extent")) upsert := c.Bool("upsert") force := c.Bool("force") if len(c.Args()) == 0 || out == "" { util.Die(c, "input_source & --out required") } else if zmax < zmin || zmin < 0 || zmax > 23 { util.Die(c, "--max > --min, --min > 0 --max < 24 not satisfied") } source, err := getSource(c) util.Check(err) if force { os.Remove(out) } tiles, err := InitTiles(out, upsert, desc, extent) util.Check(err) err = tiles.Build(source, layer, zmin, zmax) util.Check(err) file, _ := os.Open(out) defer file.Close() stat, _ := file.Stat() exp := float64(stat.Size()) / float64(1<<20) util.Info("%s was successfully caught!", out) util.Info("Diglet gained %f MB of EXP!", exp) }, Flags: []cli.Flag{ cli.StringFlag{ Name: "o, output", Usage: "REQUIRED: Path to write mbtiles to", }, cli.StringFlag{ Name: "input-type", Value: "sniff", Usage: "Type of input files, 'sniff' will pick type based on the extension", }, cli.BoolFlag{ Name: "f, force", Usage: "Remove the existing .mbtiles file before running.", }, cli.BoolFlag{ Name: "u, upsert", Usage: "Upsert into mbtiles instead of replacing.", }, cli.StringFlag{ Name: "layer-name", Value: "features", Usage: "Name of the layer for the features to be added to", }, cli.StringFlag{ Name: "desc, description", Value: "Generated from Diglet", Usage: "Value inserted into the description entry of the mbtiles", }, cli.IntFlag{ Name: "extent", Value: 4096, Usage: "Extent of tiles to be built. Default is 4096", }, cli.IntFlag{ Name: "max, max-zoom", Value: 10, Usage: "Maximum zoom level to build tiles for", }, cli.IntFlag{ Name: "min, min-zoom", Value: 5, Usage: "Minimum zoom level to build tiles from", }, cli.StringFlag{ Name: "filter", Usage: "Only include fields keys in this comma delimited list.\t" + "EXAMPLE --filter name,date,case_number,id\t" + "NOTE all fields are lowercased and non-word chars replaced with '_'", }, cli.StringFlag{ Name: "csv-lat", Usage: "Column containing a single longitude point", }, cli.StringFlag{ Name: "csv-lon", Usage: "Column containing a single longitude point", }, cli.StringFlag{ Name: "csv-shape", Usage: "Column containing shape in geojson-like 'coordinates' form.\t" + "Does not support multi-geometries", }, cli.StringFlag{ Name: "csv-delimiter", Value: ",", }, }, }
View Source
var CoverZoom = 18
CoverZoom sets the zoom level for flat coverings This is a global b/c it could go away if a dynamic cover is implemented
Functions ¶
func FeatureTiles ¶
FeatureTiles returns a list of tiles that cover the feature at CoverZoom level Dups are not checked for, so they can exist
func MvtAdapter ¶
MvtAdapter populates an mvt feature from a diglet geo feature
Types ¶
type CsvSource ¶
type CsvSource struct {
// contains filtered or unexported fields
}
func NewCsvSource ¶
type FeatureSource ¶
type GeoFields ¶
func (GeoFields) HasCoordinates ¶
type GeojsonSource ¶
type GeojsonSource struct {
// contains filtered or unexported fields
}
func NewGeojsonSource ¶
func NewGeojsonSource(path string, filter []string) *GeojsonSource
Directories ¶
Path | Synopsis |
---|---|
vector_tile
Package vector_tile provides the go code needed to read and write Mapbox vector tiles (https://github.com/mapbox/vector-tile-spec).
|
Package vector_tile provides the go code needed to read and write Mapbox vector tiles (https://github.com/mapbox/vector-tile-spec). |
Click to show internal directories.
Click to hide internal directories.