RandomNumberGenerator

Resumen

Determines the type and seed that will be used to create random numbers.

Debate

Heredado:

arcgis.rand() ya no se admite desde ArcGIS Pro 2.0. La función arcgis.rand() se usaba principalmente para permitir la creación de valores aleatorios con las herramientas Calcular valor y Calcular campo, la configuración del entorno Generador de números aleatorios y la función CreateRandomValueGenerator. En su lugar, se deben usar otras funciones similares del módulo random de Python.

Descripción general del método

MétodoExplicación
exportToString ()

Exports the object to its string representation.

loadFromString (string)

Restore or update the spatial reference object using a WKT string. The exportToString method can be used to export a WKT string representation of the spatial reference.

  • Using a WKT string with a horizontal coordinate system.
    # The following string is the WKT for the 
    # Geographic Coordinate system "WGS 1984" (factory code=4326)
    wkt = 'GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],\
                  PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]];\
                  -400 -400 1000000000;-100000 10000;-100000 10000;8.98315284119522E-09;\
                  0.001;0.001;IsHighPrecision'
    
    sr = arcpy.SpatialReference()
    sr.loadFromString(wkt)
  • Using a WKT string with a horizontal and vertical coordinate system. Note that the vertical coordinate system is defined in the VERTCS section of the WKT.
    # The following string is the WKT for the 
    # Geographic Coordinate system "WGS 1984" (factory code=4326), 
    # with a vertical coordinate system "WGS 1984" (factory code=115700)
    
    wkt = 'GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],\
                  PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],\
                  VERTCS["WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],\
                  PARAMETER["Vertical_Shift",0.0],PARAMETER["Direction",1.0],UNIT["Meter",1.0]];\
                  -400 -400 1000000000;-100000 10000;-100000 10000;8.98315284119522E-09;\
                  0.001;0.001;IsHighPrecision'
    
    sr = arcpy.SpatialReference()
    sr.loadFromString(wkt)

Métodos

exportToString ()
Valor de retorno
Tipo de datosExplicación
String

The WKT string representation of the object.

loadFromString (string)
ParámetroExplicaciónTipo de datos
string

The WKT string representation of the object.

String

Temas relacionados