示例#1
0
 def get() -> Union[int, Response, tuple[Any, int]]:
     parser = gis.parse_args()
     output: dict[str, Any] = {
         'type': 'FeatureCollection',
         'features': GetGeometricEntities.get_geometries(parser)}
     if parser['count']:
         return jsonify(len(output['features']))
     if parser['download']:
         return download(output, geometries_template(), 'geometries')
     return marshal(output, geometries_template()), 200
示例#2
0
 def get() -> Union[tuple[Resource, int], Response]:
     parser = language.parse_args()
     lang = parser['lang']
     content = {
         'intro': get_translation('intro_for_frontend', lang),
         'contact': get_translation('contact_for_frontend', lang),
         'siteName': get_translation('site_name_for_frontend', lang),
         'imageSizes': app.config['IMAGE_SIZE'],
         'legalNotice': get_translation('legal_notice_for_frontend', lang)}
     if parser['download']:
         return download(content, content_template(), 'content')
     return marshal(content, content_template()), 200
示例#3
0
 def get() -> Union[tuple[Resource, int], Response]:
     type_tree = {'typeTree': GetTypeTree.get_type_tree()}
     if entity_.parse_args()['download']:
         return download(type_tree, type_tree_template(), 'type_tree')
     return marshal(type_tree, type_tree_template()), 200
示例#4
0
 def get() -> Union[tuple[Resource, int], Response]:
     types = GetTypeOverview.get_node_overview()
     if default.parse_args()['download']:
         return download(types, type_overview_template(), 'types')
     return marshal(types, type_overview_template()), 200