Skip to content

developmentseed/tile-index

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

js-standard-style

Index set of GeoJSON features by the z/x/y tiles that contain them.

CLI Usage

cat my-geojson.geojson | tile-index -Z MINZOOM -z MAXZOOM -i ID_PROPERTY -f FORMAT > tile-index.json

FORMAT can be 'indexed' (default), 'coordinates', 'geojson', 'quadkey'.

Example output:

{
    "02":[0,1,2,3],
    "15":[3,4],
    "72":[],
    "01":[5,6,7,8],
    "05":[5],
    "04":[9,10],
    "06":[],
    "08":[11,12,10,13],
    "09":[14],
    "tiles":{"0":[5,13,16],"1":[5,12,17],"2":[5,13,17],"3":[5,14,17],"4":[5,15,17],"5":[5,16,16],"6":[5,17,16],"7":[5,16,17],"8":[5,17,17],"9":[5,13,16],"10":[5,14,16],"11":[5,14,15],"12":[5,15,15],"13":[5,15,16],"14":[5,18,15]}
}

("02", "15", etc. are the feature 'id property' values, specified using the -i option)

API

tileIndex

Returns the tile coordinates for tiles that contain the given feature.

Parameters

  • feature Feature A geojson feature
  • options object
    • options.minzoom number
    • options.maxzoom number
    • options.buffer number
    • options.format string 'coordinates', 'quadkey', or 'geojson'

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published