(self, feature, tile, current_layer_tile_extent)
return geojson_features, geo_type
Creates a GeoJSON feature for the specified feature
Creates a GeoJSON feature for the specified feature
Creates a GeoJSON feature for the specified feature
def _create_geojson_feature(self, feature, tile, current_layer_tile_extent):
        """
        Creates a GeoJSON feature for the specified feature
        """

        geo_type = geo_types[feature["type"]]
        coordinates = feature["geometry"]
        properties = feature["properties"]
        if "id" in properties and properties["id"] < 0:
            properties["id"] = 0

        if geo_type == GeoTypes.POINT:
            coordinates = coordinates[0]
            if self._clip_tiles_at_tile_bounds and not all(0 <= c <= current_layer_tile_extent for c in coordinates):
                return None, None
        all_out_of_bounds = []
        coordinates = map_coordinates_recursive(
            coordinates=coordinates,
            tile_extent=current_layer_tile_extent,
            mapper_func=lambda coords: self._get_absolute_coordinates(
                coordinates=coords, tile=tile, extent=current_layer_tile_extent
            ),
            all_out_of_bounds_func=lambda out_of_bounds: all_out_of_bounds.append(out_of_bounds),
        )

        if self._clip_tiles_at_tile_bounds and all(c is True for c in all_out_of_bounds):
            return None, None

        split_geometries = self._loading_options["merge_tiles"]
        geojson_features = VtReader._create_geojson_feature_from_coordinates(
            geo_type=geo_type, coordinates=coordinates, properties=properties, split_multi_geometries=split_geometries
        )

        return geojson_features, geo_type
def _create_geojson_feature ( self , feature , tile , current_layer_tile_extent ) : geo_type = geo_types [ feature [ "type" ] ] coordinates = feature [ "geometry" ] properties = feature [ "properties" ] if "id" in properties and properties [ "id" ] < 0 : properties [ "id" ] = 0 if geo_type == GeoTypes . POINT : coordinates = coordinates [ 0 ] if self . _clip_tiles_at_tile_bounds and not all ( 0 <= c <= current_layer_tile_extent for c in coordinates ) : return None , None all_out_of_bounds = [ ] coordinates = map_coordinates_recursive ( coordinates = coordinates , tile_extent = current_layer_tile_extent , mapper_func = lambda coords : self . _get_absolute_coordinates ( coordinates = coords , tile = tile , extent = current_layer_tile_extent ) , all_out_of_bounds_func = lambda out_of_bounds : all_out_of_bounds . append ( out_of_bounds ) , ) if self . _clip_tiles_at_tile_bounds and all ( c is True for c in all_out_of_bounds ) : return None , None split_geometries = self . _loading_options [ "merge_tiles" ] geojson_features = VtReader . _create_geojson_feature_from_coordinates ( geo_type = geo_type , coordinates = coordinates , properties = properties , split_multi_geometries = split_geometries ) return geojson_features , geo_type