docs: def getStreamNetworkAsGeoJson(self, session, withNodes=True):
          """
          Retrieve the stream network geometry in GeoJSON format.
  
          Args:
              session (:mod:`sqlalchemy.orm.session.Session`): SQLAlchemy session object bound to PostGIS enabled database
              withNodes (bool, optional): Include nodes. Defaults to False.
  
          Returns:
              str: GeoJSON string.
          """
          features_list = []
  
          # Assemble link features
          for link in self.streamLinks:
              link_geoJson = link.getAsGeoJson(session)
  
              if link_geoJson:
                  link_geometry = json.loads(link.getAsGeoJson(session))
  
                  link_properties = {"link_number": link.linkNumber,
                                     "type": link.type,
                                     "num_elements": link.numElements,
                                     "dx": link.dx,
                                     "erode": link.erode,
                                     "subsurface": link.subsurface}
  
                  link_feature = {"type": "Feature",
                                  "geometry": link_geometry,
                                  "properties": link_properties,
                                  "id": link.id}
  
                  features_list.append(link_feature)
  
              # Assemble node features
              if withNodes:
                  for node in link.nodes:
                      node_geoJson = node.getAsGeoJson(session)
  
                      if node_geoJson:
                          node_geometry = json.loads(node_geoJson)
  
                      node_properties = {"link_number": link.linkNumber,
                                         "node_number": node.nodeNumber,
                                         "elevation": node.elevation}
  
                      node_feature = {"type": "Feature",
                                      "geometry": node_geometry,
                                      "properties": node_properties,
                                      "id": node.id}
  
                      features_list.append(node_feature)
  
          feature_collection = {"type": "FeatureCollection",
                                "features": features_list}
  
          return json.dumps(feature_collection)