RAVE
Lib.rave_projection Namespace Reference

Classes

class  interface
 Object for interfacing with PROJ.4. More...
 
class  usgs
 PROJ 4.7.0 and higher interface (requires Proj.py, _proj.so) More...
 

Functions

 init ()
 Initializer.
 
 register (id, pcs)
 Adds a projection to the registry.
 
 keys ()
 Returns a list of keys in the registry.
 
 items ()
 Returns a list of tuples containing key:item pairs in the registry where the key is the projection identifier and the item is its usgs object.
 
 pcs (Id)
 Object factory.
 
 define (id, description, definition)
 Register utility function for pre-defined projection definitions in PROJECTIONS.
 
 add (id, description, definition, filename=PROJECTION_REGISTRY)
 Adds a projection to the registry.
 
 remove (id, filename=PROJECTION_REGISTRY)
 Removes a projection from the registry.
 
 write (filename=PROJECTION_REGISTRY)
 Writes the contents of the registry to file.
 
 describe (id)
 Prints the identifier, description, and PROJ.4 definition to stdout.
 

Variables

bool got_projregistry = True
 
 PROJECTIONS = os.path.join(RAVECONFIG, '*projection_registry.xml')
 There's only one official projection registry, but this module allows greater flexibility as long as files use the same naming convention.
 
int initialized = 0
 
dict _registry = {}
 Empty registry to be filled.
 

Detailed Description

Copyright (C) 1998 - Swedish Meteorological and Hydrological Institute (SMHI)

This file is part of RAVE.

RAVE is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

RAVE is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License
along with RAVE.  If not, see <http://www.gnu.org/licenses/>.

Function Documentation

◆ add()

Lib.rave_projection.add ( id,
description,
definition,
filename = PROJECTION_REGISTRY )

Adds a projection to the registry.

This is a bit overworked, but it bridges the gap between old and new interfaces. If a previous instance of a projection with the same identifier exists, it is overwritten.

Parameters
idString containing the identifier of the new projection
descriptionString containing a description of the new projection
definitionPROJ.4 string containing the new projection's definition
filenameFull path to the XML file containing the projection registry

◆ define()

Lib.rave_projection.define ( id,
description,
definition )

Register utility function for pre-defined projection definitions in PROJECTIONS.

Parameters
idstring containing this projection's identifier
descriptionstring containing a free-text description of this projection
definitionPROJ.4 string containing the projection definition

◆ describe()

Lib.rave_projection.describe ( id)

Prints the identifier, description, and PROJ.4 definition to stdout.

Parameters
idThe projection's string identifier

◆ init()

Lib.rave_projection.init ( )

Initializer.

◆ items()

Lib.rave_projection.items ( )

Returns a list of tuples containing key:item pairs in the registry where the key is the projection identifier and the item is its usgs object.

◆ keys()

Lib.rave_projection.keys ( )

Returns a list of keys in the registry.

◆ pcs()

Lib.rave_projection.pcs ( Id)

Object factory.

PCS = Projection Coordinate System

Parameters
IdProjection identifier (string)
Returns
Projection object corresponding with the input identifier

◆ register()

Lib.rave_projection.register ( id,
pcs )

Adds a projection to the registry.

Parameters
idProjection identifier (string)
pcsProjection object as returned by the usgs class

◆ remove()

Lib.rave_projection.remove ( id,
filename = PROJECTION_REGISTRY )

Removes a projection from the registry.

Parameters
idString containing the identifier of the projection to remove
filenameFull path to the XML file containing the projection registry

◆ write()

Lib.rave_projection.write ( filename = PROJECTION_REGISTRY)

Writes the contents of the registry to file.

This is a bit overworked, but it bridges the gap between old and new interfaces.

Parameters
filenameComplete path of the XML file to which to write the contents of the registry.

Variable Documentation

◆ _registry

dict Lib.rave_projection._registry = {}
protected

Empty registry to be filled.

◆ PROJECTIONS

Lib.rave_projection.PROJECTIONS = os.path.join(RAVECONFIG, '*projection_registry.xml')

There's only one official projection registry, but this module allows greater flexibility as long as files use the same naming convention.