public class gvsig extends Object
Modifier and Type | Field and Description |
---|---|
static int |
LOGGER_ERROR |
static int |
LOGGER_INFO |
static int |
LOGGER_WARN |
Constructor and Description |
---|
gvsig() |
Modifier and Type | Method and Description |
---|---|
static FLayer |
createDBF(FeatureType schema,
Object... parameters) |
static FeatureType |
createFeatureType()
Returns a new and empty attributes definition.
|
static FeatureType |
createFeatureType(FeatureType featureType)
Returns a new and empty attributes definition based in an existing
FeatureType.
|
static FLayer |
createLayer(FeatureType schema,
String layerType,
Object... parameters)
Create a new layer with the specified parameters.
|
static FLayer |
createLayer(FeatureType schema,
String serverType,
String layerType,
Object... parameters)
Create a new layer with the specified parameters.
|
static FLayer |
createShape(FeatureType schema,
Object... parameters)
Create a new shape with the specified parameters.
|
static FLayer |
createTable(FeatureType schema,
String servertype,
String layerType,
Object... parameters)
Create a new table with the specified parameters.
|
IProjection |
getCRS(String name)
Create a new projectionobject associated with the passed name of
the projection.
|
String |
getDataFolder()
Return the default data folder of gvSIG.
|
String |
getProjectsFolder()
Return the default projects folder of gvSIG.
|
String |
getResource(String... parameters)
Create the path to a resource.
|
static FLayer |
loadDBF(String dbffile)
Load an existing table file.
|
static FLayer |
loadLayer(String layerType,
Object... parameters)
Load an existing layer and return it.
|
static FLayer |
loadRasterFile(String path)
Load an existing raster file in the current view.
|
static FLayer |
loadRasterFile(String path,
String projection)
Load an existing raster file in the current view.
|
static FLayer |
loadShapeFile(String path)
Load an existing shape file in the current view.
|
static FLayer |
loadShapeFile(String path,
String projection)
Load an existing shape file in the current view.
|
static FLayer |
loadTable(String format,
Object... parameters)
Load an existing table file.
|
static void |
logger(String msg,
int mode,
Throwable exception)
Send a message to the log system.
|
DataStore |
openStore(String storeType,
Object... parameters)
Open an existen data store an return it.
|
public static int LOGGER_INFO
public static int LOGGER_WARN
public static int LOGGER_ERROR
public static FeatureType createFeatureType()
public static FeatureType createFeatureType(FeatureType featureType)
featureType
- from the new attributes are copiedpublic static FLayer createLayer(FeatureType schema, String serverType, String layerType, Object... parameters)
layer = createLayer(schema=schema,
servertype="FilesystemExplorer",
layertype="Shape",
shpFile="/home/osc/temp/test1.shp",
CRS="EPSG:25830",
geometryType=POINT
)
schema
- the schema to use to create la layer.serverType
- The server type (filesystem, BBDD, ...)layerType
- The layer type to create (Shape, ...)parameters
- the specific parameters to create the new layerpublic static FLayer createLayer(FeatureType schema, String layerType, Object... parameters)
schema
- layerType
- parameters
- public static FLayer createShape(FeatureType schema, Object... parameters)
schema
- filename,
- string, optionalgeometryType,
- optional, integer, established in the schemaCRS,
- optional, string epsg codeprefixname,
- optional, string layer name with a prefix if filename is not establishedpublic static FLayer createTable(FeatureType schema, String servertype, String layerType, Object... parameters)
schema
- servertype
- layerType
- parameters
- public static FLayer createDBF(FeatureType schema, Object... parameters)
public static FLayer loadDBF(String dbffile)
dbffile,
- string, path to the table file to loadpublic static FLayer loadTable(String format, Object... parameters)
format,
- stringpath,
- string, path to the table file to loadpublic static FLayer loadShapeFile(String path, String projection)
path
- path to the shape file to loadprojection
- to use to load the shape filepublic static FLayer loadShapeFile(String path)
path
- path to the shape file to loadpublic static FLayer loadRasterFile(String path, String projection)
path
- path to the raster file to loadprojection
- to use to load the raster filepublic static FLayer loadRasterFile(String path)
path
- path to the raster file to loadpublic static FLayer loadLayer(String layerType, Object... parameters)
layerType
- parameters
- public static void logger(String msg, int mode, Throwable exception)
msg
- to send to logmode
- message type, is optional with default of LOGGER_INFO.exception
- an exception to log, is optional.public String getResource(String... parameters)
pathname = getResource(__file__,"data","icon.png")
parameters
- parts of path to the resource.public DataStore openStore(String storeType, Object... parameters)
from gvsig.utils import openStore
os = openStore('PostgreSQL',_entity_='Persistence%3APostgreSQLStoreParameters',
port='5432',
JDBCDriverClass='org.postgresql.Driver',
UseSSL='false',
Schema='public',
Catalog='',
URL='jdbc%3Apostgresql%3A%2F%2Flocalhost%3A5432%2Fej1',
BaseOrder='',
Workingarea=None,
CRS='EPSG:23030',
PKFields='gid',
BaseFilter='',
DefaultGeometryField='geom',
Fields='gid%2Cnombre%2Cpoblacion%2Cgeom',
Table='ciudades',
SQL='',
password='postgres',
dbname='ej1',
host='localhost',
dbuser='postgres',
ProviderName='PostgreSQL')
storeType
- the type of store to open.parameters
- to open the store.public IProjection getCRS(String name)
CRSFactory.getCRS(name)
instead.name
- abbreviation of the projectionpublic String getDataFolder()
public String getProjectsFolder()