def __init__(self, db, dir=None): if dir: db = os.path.join(dir, db) params = {'database': db, 'dbtype': 'h2'} Workspace.__init__(self, H2DataStoreFactory(), params)
def __init__(self, db, host='localhost', port=1025, user=None, passwd=None): user = user if user else db params = {'host': host, 'port': port, 'database': db, 'user':user, 'passwd': passwd, 'estimatedBounds': True, 'dbtype': 'teradata'} Workspace.__init__(self, TeradataDataStoreFactory(), params)
def __init__(self, db, host='localhost', port=5432, schema='public', user=os.environ['USER'], passwd=None): params = {'host': host, 'port': port, 'schema': schema, 'database': db, 'user':user, 'passwd': passwd, 'dbtype': 'postgis'} Workspace.__init__(self, PostgisNGDataStoreFactory(), params)
def __init__( self, db, host="localhost", port=1433, schema=None, user=sysprop("user.name"), passwd=None, expose_pk=False, native_serialization=False, ): if schema is None: schema = user params = { "host": host, "port": port, "schema": schema, "database": db, "user": user, "passwd": passwd, "Expose primary keys": expose_pk, "dbtype": "sqlserver", "NATIVE_SERIALIZATION": native_serialization, } Workspace.__init__(self, SQLServerDataStoreFactory(), params)
def __init__(self, db, host='localhost', port=5432, schema='public', user=sysprop('user.name'), passwd=None, estimated_extent=False): params = {'host': host, 'port': port, 'schema': schema, 'database': db, 'user':user, 'passwd': passwd, 'dbtype': 'postgis', 'Estimated extends': estimated_extent} Workspace.__init__(self, PostgisNGDataStoreFactory(), params)
def __init__(self, db, user=None, passwd=None): params = { 'database': db, 'user': user, 'passwd': passwd, 'dbtype': 'geopkg' } Workspace.__init__(self, GeoPkgDataStoreFactory(), params)
def __init__(self, db, host='localhost', port=1521, schema=None, user=sysprop('user.name'), passwd=None, estimated_extent=False): if schema is None: schema = user params = {'host': host, 'port': port, 'schema': schema, 'database': db, 'user':user, 'passwd': passwd, 'dbtype': 'oracle', 'Estimated extends': estimated_extent} Workspace.__init__(self, OracleNGDataStoreFactory(), params)
def __init__(self, db, host='localhost', port=1025, user=None, passwd=None): user = user if user else db params = { 'host': host, 'port': port, 'database': db, 'user': user, 'passwd': passwd, 'estimatedBounds': True, 'dbtype': 'teradata' } Workspace.__init__(self, TeradataDataStoreFactory(), params)
def __init__(self, db, host='localhost', port=5432, schema='public', user=os.environ['USER'], passwd=None): params = { 'host': host, 'port': port, 'schema': schema, 'database': db, 'user': user, 'passwd': passwd, 'dbtype': 'postgis' } Workspace.__init__(self, PostgisNGDataStoreFactory(), params)
def readJSON(json): """ Reads a :class:`Layer <geoscript.layer.layer.Layer>` from GML. *input* is the GML to read specified as a str, file, or some other input stream. *ver* specifies the gml version to encode. Supported versions include 2, 3, >>> json = '{"type":"FeatureCollection","features":[{"type":"Feature","geometry":{"type":"Point","coordinates":[1,2]},"properties":{},"id":"fid"}]}' >>> l = readJSON(json) >>> l.count() 1 """ fcol = doInput(lambda input: _fjson.readFeatureCollection(input), json) from geoscript.workspace import Workspace ws = Workspace() ws._store.addFeatures(fcol) return [ws[name] for name in ws.layers()][0]
def readGML(input, ver=2): """ Reads a :class:`Layer <geoscript.layer.layer.Layer>` from GML. *input* is the GML to read specified as a str, file, or some other input stream. *ver* specifies the gml version to encode. Supported versions include 2, 3, >>> xml = '<wfs:FeatureCollection xmlns:gml="http://www.opengis.net/gml" xmlns:wfs="http://www.opengis.net/wfs" xmlns:gsf="http://geoscript.org/feature"><gml:featureMember><gsf:layer_0 fid="fid"><gsf:geom><gml:Point><gml:coord><gml:X>1.0</gml:X><gml:Y>2.0</gml:Y></gml:coord></gml:Point></gsf:geom></gsf:layer_0></gml:featureMember></wfs:FeatureCollection>' >>> l = readGML(xml) >>> l.count() 1 """ fc = xml.wfs.parse(input, ver) from geoscript.workspace import Workspace ws = Workspace() for f in fc.feature: ws._store.addFeatures(f) layers = [ws[name] for name in ws.layers()] return layers if len(layers) > 1 else layers[0]
def __init__(self): Workspace.__init__(self, MemoryDataStoreFactory())
def __init__(self, db, host="localhost", port=3306, user=sysprop("user.name"), passwd=None): params = {"host": host, "port": port, "database": db, "user": user, "passwd": passwd, "dbtype": "mysql"} Workspace.__init__(self, MySQLDataStoreFactory(), params)
def __init__(self, dir=None): dir = dir or os.getcwd() params = {'directory': util.toFile(dir)} Workspace.__init__(self, PropertyDataStoreFactory(), params)
def __init__(self, db, host='localhost', port=3306, user=sysprop('user.name'), passwd=None): params = {'host': host, 'port': port, 'database': db, 'user':user, 'passwd': passwd, 'dbtype': 'mysql'} Workspace.__init__(self, MySQLDataStoreFactory(), params)
def __init__(self, dir=None): dir = dir or os.getcwd() params = {'url': util.toURL(dir)} Workspace.__init__(self, ShapefileDataStoreFactory(), params)
def __init__(self, db, host='localhost', port=3306, user=os.environ['USER'], passwd=None): params = {'host': host, 'port': port, 'database': db, 'user':user, 'passwd': passwd, 'dbtype': 'mysql'} Workspace.__init__(self, MySQLDataStoreFactory(), params)
def data(self): return Workspace(ds=self._info.getDataStore(None))
def __init__(self, db, user=None, passwd=None): params = {'database': db, 'user':user, 'passwd': passwd, 'dbtype': 'geopkg'} Workspace.__init__(self, GeoPkgDataStoreFactory(), params)