Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: ignore Bounding Box of tabular data when added to a map #190

Open
mwallschlaeger opened this issue Oct 7, 2024 · 2 comments
Open
Labels

Comments

@mwallschlaeger
Copy link

mwallschlaeger commented Oct 7, 2024

Feature Description

ignoring tabular datasets from boundingbox calculation in maps. only respect them if only tabular data is in a map. than use bbox of tabular data

@mwallschlaeger
Copy link
Author

mwallschlaeger commented Oct 9, 2024

@mwallschlaeger
Copy link
Author

    def get_bbox_from_datasets(self, layers):
        """
        Calculate the bbox from a given list of Dataset objects

        bbox format: [xmin, xmax, ymin, ymax]
        """
        bbox = None
        for layer in layers:
            dataset_bbox = layer.bbox
 
            if layers.subtype != "tabular":
                continue
            elif bbox is None:
                bbox = list(dataset_bbox[0:4])
            else:
                bbox[0] = min(bbox[0], dataset_bbox[0])
                bbox[1] = max(bbox[1], dataset_bbox[1])
                bbox[2] = min(bbox[2], dataset_bbox[2])
                bbox[3] = max(bbox[3], dataset_bbox[3])
        
        if bbox is None and len(layers > 0):
            bbox = list(layers[0].bbox[0:4])
        return bbox

@mwallschlaeger mwallschlaeger changed the title Feature: set Bounding Box information to tabular to be able to search via geolocation in the repo Feature: ignore Bounding Box of tabular data when added to a map Oct 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant