(self, tile: VectorTile, layer_filter: List[str])
Transforms all features of the specified tile into GeoJSON
         * The resulting GeoJSON feature will be applied to the features of the corresponding GeoJSON FeatureCollection
        :param tile:
        :return:
Transforms all features of the specified tile into GeoJSON
         * The resulting GeoJSON feature will be applied to the features of the corresponding GeoJSON FeatureCollection
        :param tile:
        :return:
Transforms all features of the specified tile into GeoJSON * The resulting GeoJSON feature will be applied to the features of the corresponding GeoJSON FeatureCollection : param tile : : return :
def _add_features_to_feature_collection(self, tile: VectorTile, layer_filter: List[str]):
        """
        Transforms all features of the specified tile into GeoJSON
         * The resulting GeoJSON feature will be applied to the features of the corresponding GeoJSON FeatureCollection
        :param tile:
        :return:
        """
        for layer_name in tile.decoded_data:
            layer = tile.decoded_data[layer_name]
            is_geojson_already = False
            if "isGeojson" in layer:
                is_geojson_already = layer["isGeojson"]
            if layer_filter and len(layer_filter) > 0:
                if layer_name not in layer_filter:
                    continue

            tile_id = tile.id()
            if is_geojson_already:
                for geo_type_id in geo_types:
                    geo_type = geo_types[geo_type_id]
                    features = layer[geo_type]
                    if features:
                        feature_collection = self._get_feature_collection(
                            layer_name=layer_name, geo_type=geo_type, zoom_level=tile.zoom_level
                        )
                        feature_collection["features"].extend(features)
                        if tile_id not in feature_collection["tiles"]:
                            feature_collection["tiles"].append(tile_id)
            else:
                for feature in layer["features"]:
                    if "extent" in layer:
                        extent = layer["extent"]
                    else:
                        extent = self._DEFAULT_EXTENT
                    geojson_features, geo_type = self._create_geojson_feature(feature, tile, extent)
                    if geojson_features and len(geojson_features) > 0:
                        for f in geojson_features:
                            f["properties"]["_id"] = self._feature_count
                            f["properties"]["_col"] = tile.column
                            f["properties"]["_row"] = tile.row
                            f["properties"]["_zoom"] = tile.zoom_level
                            self._feature_count += 1

                        feature_collection = self._get_feature_collection(
                            layer_name=layer_name, geo_type=geo_type, zoom_level=tile.zoom_level
                        )
                        feature_collection["features"].extend(geojson_features)
                        if tile_id not in feature_collection["tiles"]:
                            feature_collection["tiles"].append(tile_id)
def _add_features_to_feature_collection ( self , tile : VectorTile , layer_filter : List [ str ] ) : for layer_name in tile . decoded_data : layer = tile . decoded_data [ layer_name ] is_geojson_already = False if "isGeojson" in layer : is_geojson_already = layer [ "isGeojson" ] if layer_filter and len ( layer_filter ) > 0 : if layer_name not in layer_filter : continue tile_id = tile . id ( ) if is_geojson_already : for geo_type_id in geo_types : geo_type = geo_types [ geo_type_id ] features = layer [ geo_type ] if features : feature_collection = self . _get_feature_collection ( layer_name = layer_name , geo_type = geo_type , zoom_level = tile . zoom_level ) feature_collection [ "features" ] . extend ( features ) if tile_id not in feature_collection [ "tiles" ] : feature_collection [ "tiles" ] . append ( tile_id ) else : for feature in layer [ "features" ] : if "extent" in layer : extent = layer [ "extent" ] else : extent = self . _DEFAULT_EXTENT geojson_features , geo_type = self . _create_geojson_feature ( feature , tile , extent ) if geojson_features and len ( geojson_features ) > 0 : for f in geojson_features : f [ "properties" ] [ "_id" ] = self . _feature_count f [ "properties" ] [ "_col" ] = tile . column f [ "properties" ] [ "_row" ] = tile . row f [ "properties" ] [ "_zoom" ] = tile . zoom_level self . _feature_count += 1 feature_collection = self . _get_feature_collection ( layer_name = layer_name , geo_type = geo_type , zoom_level = tile . zoom_level ) feature_collection [ "features" ] . extend ( geojson_features ) if tile_id not in feature_collection [ "tiles" ] : feature_collection [ "tiles" ] . append ( tile_id )