def _automaticallyDeriveSpatialReferenceId(self, directory):
        """
        This method is used to automatically lookup the spatial reference ID of the GSSHA project. This method is a
        wrapper for the ProjectionFile class method lookupSpatialReferenceID(). It requires an internet connection
        (the lookup uses a web service) and the projection file to be present and the appropriate card in the project
        file pointing to the projection file (#PROJECTION_FILE). If the process fails, it defaults to SRID 4326 which is
        the id for WGS 84.
        """
        # Only do automatic look up if spatial reference is not specified by the user
        DEFAULT_SPATIAL_REFERENCE_ID = 4236
        # Lookup the projection card in the project file
        projectionCard = self.getCard('#PROJECTION_FILE')

        if projectionCard is not None:
            # Use lookup service
            srid = ProjectionFile.lookupSpatialReferenceID(directory=directory,
                                                           filename=projectionCard.value.strip('"'))

            try:
                # Verify the resulting srid is a number
                int(srid)
                self.srid = srid
                spatialReferenceID = srid
                log.info("Automatic spatial reference ID lookup succeded. Using id: {0}".format(spatialReferenceID))
            except:
                # Otherwise, use the default id
                spatialReferenceID = DEFAULT_SPATIAL_REFERENCE_ID
                log.warning("Automatic spatial reference ID lookup failed. Using default id: {0}".format(DEFAULT_SPATIAL_REFERENCE_ID))
        else:
            # If there is no projection card in the project file, use default
            spatialReferenceID = DEFAULT_SPATIAL_REFERENCE_ID
            log.warning("Automatic spatial reference ID lookup failed. Using default id: {0}".format(DEFAULT_SPATIAL_REFERENCE_ID))

        return spatialReferenceID
def _automaticallyDeriveSpatialReferenceId ( self , directory ) : DEFAULT_SPATIAL_REFERENCE_ID = 4236 projectionCard = self . getCard ( '#PROJECTION_FILE' ) if projectionCard is not None : srid = ProjectionFile . lookupSpatialReferenceID ( directory = directory , filename = projectionCard . value . strip ( '"' ) ) try : int ( srid ) self . srid = srid spatialReferenceID = srid log . info ( "Automatic spatial reference ID lookup succeded. Using id: {0}" . format ( spatialReferenceID ) ) except : spatialReferenceID = DEFAULT_SPATIAL_REFERENCE_ID log . warning ( "Automatic spatial reference ID lookup failed. Using default id: {0}" . format ( DEFAULT_SPATIAL_REFERENCE_ID ) ) else : spatialReferenceID = DEFAULT_SPATIAL_REFERENCE_ID log . warning ( "Automatic spatial reference ID lookup failed. Using default id: {0}" . format ( DEFAULT_SPATIAL_REFERENCE_ID ) ) return spatialReferenceID
This method is used to automatically lookup the spatial reference ID of the GSSHA project. This method is a
        wrapper for the ProjectionFile class method lookupSpatialReferenceID(). It requires an internet connection
        (the lookup uses a web service) and the projection file to be present and the appropriate card in the project
        file pointing to the projection file (#PROJECTION_FILE). If the process fails, it defaults to SRID 4326 which is
        the id for WGS 84.