This file contains hidden or 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 duckdb | |
| import flask | |
| # Initialize Flask app | |
| app = flask.Flask(__name__) | |
| # Setup a global DuckDB connection with spatial extension loaded | |
| # Connect to a persistent database file with the geometry data | |
| config = {"allow_unsigned_extensions": "true"} | |
| con = duckdb.connect("tiles.db", True, config) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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 ipyleaflet | |
| import json | |
| import leafmap | |
| import requests | |
| stac_api = "https://earth-search.aws.element84.com/v0" | |
| search_endpoint = f"{stac_api}/search" | |
| collection = "sentinel-s2-l2a-cogs" | |
| payload = { |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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 numpy as np | |
| import pandas as pd | |
| def sklearn_tree_to_ee_string(estimator, feature_names): | |
| # extract out the information need to build the tree string | |
| n_nodes = estimator.tree_.node_count | |
| children_left = estimator.tree_.children_left | |
| children_right = estimator.tree_.children_right | |
| feature_idx = estimator.tree_.feature |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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
| """ | |
| Copyright 2020 Justin Braaten | |
| Licensed under the Apache License, Version 2.0 (the "License"); | |
| you may not use this file except in compliance with the License. | |
| You may obtain a copy of the License at | |
| https://www.apache.org/licenses/LICENSE-2.0 | |
| Unless required by applicable law or agreed to in writing, software |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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 pandas as pd | |
| def confusion_matrix(df: pd.DataFrame, col1: str, col2: str): | |
| """ | |
| Given a dataframe with at least | |
| two categorical columns, create a | |
| confusion matrix of the count of the columns | |
| cross-counts | |
| use like: |
NewerOlder