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
{ | |
"forest": [ | |
"landuse=forest" | |
], | |
"stadium_arena": [ | |
"leisure=stadium" | |
], | |
"farm": [ | |
"landuse=farm" | |
], |
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
{ | |
"forest": [ | |
"landuse=forest" | |
], | |
"stadium_arena": [ | |
"leisure=stadium" | |
], | |
"farm": [ | |
"landuse=farm" | |
], |
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
import json | |
import pandas as pd | |
tags_dict = None | |
with open('./overture2osm.json') as file: | |
tags_dict = json.load(file) | |
def jsonize_tags(tags): | |
# Split the string at the '=' character | |
tags = {tag.split('=')[0]: tag.split('=')[1] for tag in tags} |
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
{ | |
"forest": [ | |
"landuse=forest" | |
], | |
"stadium_arena": [ | |
"leisure=stadium" | |
], | |
"farm": [ | |
"landuse=farm" | |
], |
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
{ | |
"forest": [ | |
"landuse=forest" | |
], | |
"stadium_arena": [ | |
"leisure=stadium" | |
], | |
"farm": [ | |
"landuse=farm" | |
], |
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
import mercantile, mapbox_vector_tile, requests, json, os | |
from vt2geojson.tools import vt_bytes_to_geojson | |
# define an empty geojson as output | |
output= { "type": "FeatureCollection", "features": [] } | |
# vector tile endpoints -- change this in the API request to reference the correct endpoint | |
tile_coverage = 'mly1_public' | |
# tile layer depends which vector tile endpoints: |
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
import mercantile, mapbox_vector_tile, requests, json | |
from vt2geojson.tools import vt_bytes_to_geojson | |
# define an empty geojson as output | |
output= { "type": "FeatureCollection", "features": [] } | |
# vector tile endpoints -- change this in the API request to reference the correct endpoint | |
tile_coverage = 'mly1_public' | |
# tile layer depends which vector tile endpoints: |
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
import mercantile, mapbox_vector_tile, requests, json | |
from vt2geojson.tools import vt_bytes_to_geojson | |
# define an empty geojson as output | |
output= { "type": "FeatureCollection", "features": [] } | |
# vector tile endpoints -- change this in the API request to reference the correct endpoint | |
tile_coverage = 'mly1_public' | |
# tile layer depends which vector tile endpoints: |
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
import mercantile, mapbox_vector_tile, requests, json | |
from vt2geojson.tools import vt_bytes_to_geojson | |
# define an empty geojson as output | |
output = { "type": "FeatureCollection", "features": [] } | |
# empty list of image keys | |
images = [] | |
# vector tile endpoints -- change this in the API request to reference the correct endpoint |
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
interface TileCoords { | |
x: number; | |
y: number; | |
z: number; | |
} | |
const getParentTileCoords = (childTile: TileCoords, parentLevel: number): TileCoords => { | |
const deltaZ = childTile.z - parentLevel; | |
const scale = Math.pow(2, deltaZ); | |
return { | |
'x': Math.floor(childTile.x / scale), |
NewerOlder