accessmod/grasshelper.py
def check_location(gisdb_path, location_name, crs):
    """Create a GRASS location if necessary."""
    if os.path.exists(os.path.join(gisdb_path, location_name)):
        logger.info(f'Location "{location_name}" already exists.')
    else:
        if crs.is_epsg_code:
            gscript.core.create_location(
                gisdb_path,
                location_name,
                epsg=crs.to_epsg(),
                overwrite=False,
            )
        else:
            gscript.core.create_location(
                gisdb_path,
                location_name,
                proj4=crs.to_proj4(),
                overwrite=False,
            )
        logger.info(f'Location "{location_name}" created.')
Create a GRASS location if necessary.
Create a GRASS location if necessary.
Create a GRASS location if necessary .
def check_location(gisdb_path, location_name, crs):
    if os.path.exists(os.path.join(gisdb_path, location_name)):
        logger.info(f'Location "{location_name}" already exists.')
    else:
        if crs.is_epsg_code:
            gscript.core.create_location(
                gisdb_path,
                location_name,
                epsg=crs.to_epsg(),
                overwrite=False,
            )
        else:
            gscript.core.create_location(
                gisdb_path,
                location_name,
                proj4=crs.to_proj4(),
                overwrite=False,
            )
        logger.info(f'Location "{location_name}" created.')
def check_location ( gisdb_path , location_name , crs ) : if os . path . exists ( os . path . join ( gisdb_path , location_name ) ) : logger . info ( f'Location "{location_name}" already exists.' ) else : if crs . is_epsg_code : gscript . core . create_location ( gisdb_path , location_name , epsg = crs . to_epsg ( ) , overwrite = False , ) else : gscript . core . create_location ( gisdb_path , location_name , proj4 = crs . to_proj4 ( ) , overwrite = False , ) logger . info ( f'Location "{location_name}" created.' )
Create a GRASS location if necessary.
Create a GRASS location if necessary .
"""Create a GRASS location if necessary."""
gisdb_path
location_name
crs