Exemplo n.º 1
0
  def test_convert(self):
    from spatialdata.geocoords.CSGeo import CSGeo
    csNAD27 = CSGeo()
    csNAD27.inventory.ellipsoid = "clrk66"
    csNAD27.inventory.datumHoriz = "NAD27"
    csNAD27.inventory.datumVert = "mean sea level"
    csNAD27._configure()
    csNAD27.initialize()

    from spatialdata.geocoords.CSGeoLocalCart import CSGeoLocalCart
    csLocal = CSGeoLocalCart()
    csLocal.inventory.originLon = -100.0
    csLocal.inventory.originLat = 39.0
    from pyre.units.length import m
    csLocal.inventory.originElev = 0.01*m
    csLocal.inventory.ellipsoid = "clrk66"
    csLocal.inventory.datumHoriz = "NAD27"
    csLocal.inventory.datumVert = "mean sea level"
    csLocal._configure()
    csLocal.initialize()

    from spatialdata.geocoords.Converter import convert
    coordsXYZ = numpy.array(lonlatNAD27ElevVals)
    convert(coordsXYZ, csLocal, csNAD27)
    xyzLocalValsT = numpy.array(coordsXYZ)

    self.assertEqual(len(xyzLocalVals.shape), len(xyzLocalValsT.shape))
    for (xyz, xyzT) in zip(numpy.reshape(xyzLocalVals,-1),
                           numpy.reshape(xyzLocalValsT, -1)):
      self.assertAlmostEqual(1.0, xyz/xyzT, 6)
        
    return
Exemplo n.º 2
0
  def test_convert(self):
    from spatialdata.geocoords.CSGeo import CSGeo
    csNAD27 = CSGeo()
    csNAD27.inventory.ellipsoid = "clrk66"
    csNAD27.inventory.datumHoriz = "NAD27"
    csNAD27.inventory.datumVert = "mean sea level"
    csNAD27._configure()
    csNAD27.initialize()

    from spatialdata.geocoords.CSGeoLocalCart import CSGeoLocalCart
    csLocal = CSGeoLocalCart()
    csLocal.inventory.originLon = -100.0
    csLocal.inventory.originLat = 39.0
    from pyre.units.length import m
    csLocal.inventory.originElev = 0.01*m
    csLocal.inventory.ellipsoid = "clrk66"
    csLocal.inventory.datumHoriz = "NAD27"
    csLocal.inventory.datumVert = "mean sea level"
    csLocal._configure()
    csLocal.initialize()

    from spatialdata.geocoords.Converter import convert
    coordsXYZ = numpy.array(lonlatNAD27ElevVals)
    convert(coordsXYZ, csLocal, csNAD27)
    xyzLocalValsT = numpy.array(coordsXYZ)

    self.assertEqual(len(xyzLocalVals.shape), len(xyzLocalValsT.shape))
    for (xyz, xyzT) in zip(numpy.reshape(xyzLocalVals,-1),
                           numpy.reshape(xyzLocalValsT, -1)):
      self.assertAlmostEqual(1.0, xyz/xyzT, 6)
        
    return
Exemplo n.º 3
0
def cs_geo():
    """Geographic lat/lon coordinates in WGS84 datum.
    """
    cs = CSGeo()
    cs.inventory.datumHoriz = "WGS84"
    cs.inventory.datumVert = "mean sea level"
    cs.inventory.spaceDim = 2
    cs._configure()
    cs.initialize()
    return cs
Exemplo n.º 4
0
def cs_geo():
    """Geographic lat/lon coordinates in WGS84 datum.
    """
    cs = CSGeo()
    cs.inventory.datumHoriz = "WGS84"
    cs.inventory.datumVert = "mean sea level"
    cs.inventory.spaceDim = 2
    cs._configure()
    cs.initialize()
    return cs
Exemplo n.º 5
0
    def setUp(self):
        from spatialdata.geocoords.CSGeo import CSGeo
        cs = CSGeo()
        cs._configure()
        cs.initialize()
        self.cs = cs

        from spatialdata.geocoords.Projector import Projector
        projector = Projector()
        projector.inventory.projection = projection
        projector.inventory.units = units
        projector.inventory.projOptions = projOptions
        projector._configure()
        self.projector = projector
        return
Exemplo n.º 6
0
 def setUp(self):
   from spatialdata.geocoords.CSGeo import CSGeo
   cs = CSGeo()
   cs._configure()
   cs.initialize()
   self.cs = cs
   
   from spatialdata.geocoords.Projector import Projector
   projector = Projector()
   projector.inventory.projection = projection
   projector.inventory.units = units
   projector.inventory.projOptions = projOptions
   projector._configure()
   self.projector = projector
   return
    def setUp(self):
        from spatialdata.spatialdb.contrib.UniformVelModel import UniformVelModel
        db = UniformVelModel()
        db.inventory.label = "Uniform properties"
        db._configure()
        self._db = db

        from spatialdata.geocoords.CSGeo import CSGeo
        csQ = CSGeo()
        csQ.inventory.datumHoriz = "NAD27"
        csQ.inventory.datumVert = "mean sea level"
        csQ.inventory.ellipsoid = "clrk66"
        csQ._configure()
        csQ.initialize()
        self._csQ = csQ
        return
  def setUp(self):
    from spatialdata.spatialdb.contrib.UniformVelModel import UniformVelModel
    db = UniformVelModel()
    db.inventory.label = "Uniform properties"
    db._configure()
    self._db = db

    from spatialdata.geocoords.CSGeo import CSGeo
    csQ = CSGeo()
    csQ.inventory.datumHoriz = "NAD27"
    csQ.inventory.datumVert = "mean sea level"
    csQ.inventory.ellipsoid = "clrk66"
    csQ._configure()
    csQ.initialize()
    self._csQ = csQ
    return
Exemplo n.º 9
0
  def test_initialize(self):
    from spatialdata.geocoords.CSGeo import CSGeo
    cs = CSGeo()
    cs.inventory.ellipsoid = "clrk66"
    cs.inventory.datumHoriz = "NAD27"
    cs.inventory.datumVert = "mean sea level"
    cs.inventory.units = "km"
    cs.inventory.spaceDim = 2
    cs._configure()
    cs.initialize()

    self.assertEqual("clrk66", cs.ellipsoid())
    self.assertEqual("NAD27", cs.datumHoriz())
    self.assertEqual("mean sea level", cs.datumVert())
    self.assertEqual(False, cs.isGeocentric())
    self.assertEqual(1.0e+3, cs.toMeters())
    self.assertEqual(2, cs.spaceDim())

    return
Exemplo n.º 10
0
    def test_initialize(self):
        from spatialdata.geocoords.CSGeo import CSGeo
        cs = CSGeo()
        cs.inventory.ellipsoid = "clrk66"
        cs.inventory.datumHoriz = "NAD27"
        cs.inventory.datumVert = "mean sea level"
        cs.inventory.units = "km"
        cs.inventory.spaceDim = 2
        cs._configure()
        cs.initialize()

        self.assertEqual("clrk66", cs.ellipsoid())
        self.assertEqual("NAD27", cs.datumHoriz())
        self.assertEqual("mean sea level", cs.datumVert())
        self.assertEqual(False, cs.isGeocentric())
        self.assertEqual(1.0e+3, cs.toMeters())
        self.assertEqual(2, cs.spaceDim())

        return