class_docstr: The OpenStreetMap Nodes Table implementation
class_docstr_tok: ["The","OpenStreetMap","Nodes","Table","implementation"]
docstr: Pulls data from the OpenStreetMap API endpoint.
  
  Parameters
  ----------
  query : ast.Select
     Given SQL SELECT query
  
  Returns
  -------
  pd.DataFrame
      OpenStreetMap data matching the query
  
  Raises
  ------
  ValueError
      If the query contains an unsupported condition
docstr_tok: ["Pulls","data","from","the","OpenStreetMap","API","endpoint",".","Parameters","--","--","--","--","--","query",":","ast.Select","Given","SQL","SELECT","query","Returns","--","--","--","-","pd.DataFrame","OpenStreetMap","data","matching","the","query","Raises","--","--","--","ValueError","If","the","query","contains","an","unsupported","condition"]
code: def select(self, query: ast.Select) -> pd.DataFrame:
      """Pulls data from the OpenStreetMap API endpoint.
  
      Parameters
      ----------
      query : ast.Select
         Given SQL SELECT query
  
      Returns
      -------
      pd.DataFrame
          OpenStreetMap data matching the query
  
      Raises
      ------
      ValueError
          If the query contains an unsupported condition
      """
  
      where_conditions = extract_comparison_conditions(query.where)
  
      if query.limit:
          result_limit = query.limit.value
      else:
          result_limit = 20
  
      nodes_df = pd.json_normalize(
          self.get_nodes(
              where_conditions=where_conditions, limit=result_limit
          )
      )
  
      selected_columns = []
      for target in query.targets:
          if isinstance(target, ast.Star):
              selected_columns = nodes_df.columns
              break
          elif isinstance(target, ast.Identifier):
              selected_columns.append(target.parts[-1])
          else:
              raise ValueError(f"Unknown query target {type(target)}")
  
      order_by_conditions = {}
      if query.order_by and len(query.order_by) > 0:
          order_by_conditions["columns"] = []
          order_by_conditions["ascending"] = []
  
          for an_order in query.order_by:
              if an_order.field.parts[0] == "nodes":
                  if an_order.field.parts[1] in nodes_df.columns:
                      order_by_conditions["columns"].append(
                          an_order.field.parts[1]
                      )
  
                      if an_order.direction == "ASC":
                          order_by_conditions["ascending"].append(True)
                      else:
                          order_by_conditions["ascending"].append(False)
                  else:
                      raise ValueError(
                          f"Order by unknown column {an_order.field.parts[1]}"
                      )
  
      select_statement_executor = SELECTQueryExecutor(
          nodes_df, selected_columns, [], order_by_conditions
      )
      nodes_df = select_statement_executor.execute_query()
  
      return nodes_df
  
imports: import pandas
  from typing import Text, List, Dict
  from mindsdb_sql.parser import ast
  from mindsdb.integrations.libs.api_handler import APITable
  from mindsdb.integrations.utilities.sql_utils import extract_comparison_conditions
  from mindsdb.integrations.handlers.utilities.query_utilities import SELECTQueryParser, SELECTQueryExecutor
label_desc: Use image node_id 1 for calling the OpenStreetMapNodeTable obj's underlying member method code with example usage: obj.select(query) and returns: nodes_df