Exemplo n.º 1
0
 def as_shape(self,
              db_cols,
              geojson_col=None,
              data=[],
              dir_path=None,
              file_name=None):
     """
     Create shapefile for generic table
     Parameters:
         db_cols (list): columns from a SQLA model (model.__mapper__.c)
         geojson_col (str): the geojson (from st_asgeojson()) column of the mapped table if exist
                         if None, take the geom_col (WKB) to generate geometry with shapely
         data (list<Model>): list of data of the shapefiles
         dir_path (str): directory path
         file_name (str): name of the file
     Returns
         Void (create a shapefile)
     """
     create_shapes_generic(
         view=self,
         db_cols=db_cols,
         srid=self.srid,
         data=data,
         geom_col=self.geometry_field,
         geojson_col=geojson_col,
         dir_path=dir_path,
         file_name=file_name,
     )
Exemplo n.º 2
0
 def as_shape(
     self, db_cols, geojson_col=None, data=[], dir_path=None, file_name=None
 ):
     """
     Create shapefile for generic table
     Parameters:
         db_cols (list): columns from a SQLA model (model.__mapper__.c)
         geojson_col (str): the geojson (from st_asgeojson()) column of the mapped table if exist
                         if None, take the geom_col (WKB) to generate geometry with shapely
         data (list<Model>): list of data of the shapefiles
         dir_path (str): directory path
         file_name (str): name of the file
     Returns
         Void (create a shapefile)
     """
     create_shapes_generic(
         view=self,
         db_cols=db_cols,
         srid=self.srid,
         data=data,
         geom_col=self.geometry_field,
         geojson_col=geojson_col,
         dir_path=dir_path,
         file_name=file_name,
     )
Exemplo n.º 3
0
 def as_shape(self, db_cols, data=None, dir_path=None, file_name=None):
     if not data:
         data = []
     create_shapes_generic(view=self,
                           db_cols=db_cols,
                           srid=self.srid,
                           data=data,
                           geom_col=self.geometry_field,
                           dir_path=dir_path,
                           file_name=file_name)