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

Entities extent #236

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from
Open

Entities extent #236

wants to merge 3 commits into from

Conversation

Naminoshin
Copy link
Contributor

No description provided.

@@ -77,7 +79,8 @@ def __init__(self, datastore: Optional[str], entity_type: str, idu: Optional[str
if self.action(o_entity): # si ça retourne True
# On affiche l'entité
Config().om.info(f"Affichage de l'entité {o_entity}", green_colored=True)
Config().om.info(o_entity.to_json(indent=3))
Entities.print_entity(o_entity, None)
Config().om.info("Emprise masquée, utilisez la commande --extent pour l'afficher")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

à déplacer dans la fonction : on ne veut pas l'afficher s'il n'y a pas d'emprise

@@ -403,6 +423,7 @@ def complete_parser_entities(o_sub_parsers: argparse._SubParsersAction[argparse.
# Filtres
o_sub_parser.add_argument("--infos", "-i", type=str, default=None, help=f"Filtrer les {o_entity.entity_titles()} selon les infos")
o_sub_parser.add_argument("--page", "-p", type=int, default=None, help="Page à récupérer. Toutes si non indiqué.")
o_sub_parser.add_argument("--extent", type=str, default=None, help="Affichage de toute la donnée selon le type", choices=["wkt", "Geojson"])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
o_sub_parser.add_argument("--extent", type=str, default=None, help="Affichage de toute la donnée selon le type", choices=["wkt", "Geojson"])
o_sub_parser.add_argument("--extent", type=str, default=None, help="Affichage de l'emprise selon le format demandé", choices=["wkt", "geojson"])

@staticmethod
def print_entity(o_entity: StoreEntity, extent: str = None):
if o_entity.get("extent") is not None:
if extent != "Geojson":
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if extent != "Geojson":
if extent != "geojson":

Comment on lines +102 to +103
if extent != "Geojson":
del o_entity._store_api_dict["extent"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ça risque pas de détruire l'extent si on veut du wkt ?
il faudrait pas faire if extent is None ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants