def setUp(self): # create and insert test data to database self.testData = [ Map( id = 10000023, apsobjectid=90015724, apsdateiname = "df_dk_0010001_4630_1928", boundingbox = "POLYGON((16.9999980926514 51.7999992370605,16.9999980926514 51.9000015258789,17.1666679382324 51.9000015258789,17.1666679382324 51.7999992370605,16.9999980926514 51.7999992370605))", maptype="M", originalimage = os.path.join(self.testDataDir, "df_dk_0010001_4630_1928.tif"), georefimage = os.path.join(self.testDataDir, "df_dk_0010001_4630_1928.tif"), isttransformiert = True, recommendedsrid = 4314 ), Metadata( mapid = 10000023, imagezoomify = 'http://fotothek.slub-dresden.de/zooms/df/dk/0010000/df_dk_0010001_3352_1918/ImageProperties.xml', title = '', titleshort = '', scale = '1:25000', timepublish = datetime.now(), imagejpg = 'http://fotothek.slub-dresden.de/fotos/df/dk/0010000/df_dk_0010001_2655.jpg', thumbssmall = 'http://fotothek.slub-dresden.de/thumbs/df/dk/0010000/df_dk_0010001_6817.jpg', description = 'Ars an der Mosel. - Aufn. 1880, hrsg. 1882, Aufldr. 1916. - 1:25000. - [Berlin]: Kgl. Preuss. Landesaufnahme, 1916. - 1 Kt.', technic = 'Lithografie & Umdruck', type = 'Druckgraphik' ) ] self.georefProcess = Georeferenzierungsprozess( mapid = 10000023, messtischblattid = 90015724, nutzerid = self.user, clipparameter = {'source': 'pixel', 'target': 'EPSG:4314', 'gcps': [\ {'source': [467, 923], 'target': [10.6666660308838, 51.4000015258789]}, \ {'source': [7281, 999], 'target': [10.8333339691162, 51.4000015258789]}, \ {'source': [7224, 7432], 'target': [10.8333339691162, 51.2999992370605]},\ {'source': [258, 7471], 'target': [10.6666660308838, 51.2999992370605]}]}, georefparams = {'source': 'pixel', 'target': 'EPSG:4314', 'gcps': [\ {'source': [467, 923], 'target': [10.6666660308838, 51.4000015258789]}, \ {'source': [7281, 999], 'target': [10.8333339691162, 51.4000015258789]}, \ {'source': [7224, 7432], 'target': [10.8333339691162, 51.2999992370605]},\ {'source': [258, 7471], 'target': [10.6666660308838, 51.2999992370605]}]}, clippolygon = {'source': 'pixel', 'polygon': [[7813, 7517], [1652, 7523], [1677, 1666], [7830, 1661], [7813, 7517]]}, timestamp = "2014-08-09 12:20:26", type = 'update', isactive = False, processed = False, overwrites = 0, adminvalidation = '' ) try: for obj in self.testData: self.dbsession.add(obj) self.dbsession.flush() except Exception: raise
def setUp(self): self.config = testing.setUp() self.config.registry.dbmaker = self.Session # create and insert test data to database self.testData = [ Map(id=10000023, apsobjectid=90015724, apsdateiname="df_dk_0010001_3352_1890", recommendedsrid=4314, boundingbox= "POLYGON((16.9999980926514 51.7999992370605,16.9999980926514 51.9000015258789,17.1666679382324 51.9000015258789,17.1666679382324 51.7999992370605,16.9999980926514 51.7999992370605))", maptype="M"), Map(id=10000024, apsobjectid=90015725, apsdateiname="df_dk_0010001_3352_18901", maptype="GL"), Metadata( mapid=10000023, imagezoomify= 'http://fotothek.slub-dresden.de/zooms/df/dk/0010000/df_dk_0010001_3352_1918/ImageProperties.xml', title='', titleshort=''), Metadata( mapid=10000024, imagezoomify= 'http://fotothek.slub-dresden.de/zooms/df/dk/0010000/df_dk_0010001_3352_1918/ImageProperties.xml', title='', titleshort='') ] try: for obj in self.testData: self.dbsession.add(obj) self.dbsession.flush() except Exception: raise
def setUp(self): # create and insert test data to database self.testData = [ Map(id=10000023, apsobjectid=90015724, apsdateiname="df_dk_0010001_4630_1928", boundingbox= "POLYGON((16.9999980926514 51.7999992370605,16.9999980926514 51.9000015258789,17.1666679382324 51.9000015258789,17.1666679382324 51.7999992370605,16.9999980926514 51.7999992370605))", maptype="M", originalimage=os.path.join(self.testDataDir, "df_dk_0010001_4630_1928.tif"), georefimage=os.path.join(self.testDataDir, "df_dk_0010001_4630_1928.tif"), isttransformiert=True), Metadata( mapid=10000023, imagezoomify= 'http://fotothek.slub-dresden.de/zooms/df/dk/0010000/df_dk_0010001_3352_1918/ImageProperties.xml', title='', titleshort='', scale='1:25000', timepublish=datetime.now(), imagejpg= 'http://fotothek.slub-dresden.de/fotos/df/dk/0010000/df_dk_0010001_2655.jpg', thumbssmall= 'http://fotothek.slub-dresden.de/thumbs/df/dk/0010000/df_dk_0010001_6817.jpg', description= 'Ars an der Mosel. - Aufn. 1880, hrsg. 1882, Aufldr. 1916. - 1:25000. - [Berlin]: Kgl. Preuss. Landesaufnahme, 1916. - 1 Kt.', technic='Lithografie & Umdruck', type='Druckgraphik') ] try: for obj in self.testData: self.dbsession.add(obj) self.dbsession.flush() except Exception: raise
def setUp(self): self.config = testing.setUp() self.config.registry.dbmaker = self.Session # create dummy georefprocess self.notReferencedObjId = 10000023 self.dummyProcess = Georeferenzierungsprozess( mapid=10000023, messtischblattid=90015724, nutzerid=self.user, clipparameter="{'Test':'Test'}", georefparams="{'Test':'Test'}", timestamp="2014-08-09 12:20:26", type='new', isactive=True, processed=False, overwrites=0, adminvalidation='') self.dummyProcessUpdate = Georeferenzierungsprozess( mapid=10000023, messtischblattid=90015724, nutzerid=self.user, clipparameter= "{'new': {'source': 'pixel', 'target': 'EPSG:4314', 'gcps': [\ {'source': [467, 923], 'target': [10.6666660308838, 51.4000015258789]}, \ {'source': [7281, 999], 'target': [10.8333339691162, 51.4000015258789]}, \ {'source': [7224, 7432], 'target': [10.8333339691162, 51.2999992370605]},\ {'source': [258, 7471], 'target': [10.6666660308838, 51.2999992370605]}]},\ 'remove':{'source': 'pixel', 'target': 'EPSG:4314', 'gcps':[]}}", georefparams= "{'new': {'source': 'pixel', 'target': 'EPSG:4314', 'gcps': [\ {'source': [467, 923], 'target': [10.6666660308838, 51.4000015258789]}, \ {'source': [7281, 999], 'target': [10.8333339691162, 51.4000015258789]}, \ {'source': [7224, 7432], 'target': [10.8333339691162, 51.2999992370605]},\ {'source': [258, 7471], 'target': [10.6666660308838, 51.2999992370605]}]},\ 'remove':{'source': 'pixel', 'target': 'EPSG:4314', 'gcps':[]}}", timestamp="2014-08-09 12:20:26", type='update', isactive=False, processed=False, overwrites=0, adminvalidation='') # create and insert test data to database self.testData = [ Map(id=10000023, apsobjectid=90015724, apsdateiname="df_dk_0010001_3352_1890", boundingbox= "POLYGON((16.9999980926514 51.7999992370605,16.9999980926514 51.9000015258789,17.1666679382324 51.9000015258789,17.1666679382324 51.7999992370605,16.9999980926514 51.7999992370605))", maptype="M"), Map(id=10000024, apsobjectid=90015725, apsdateiname="df_dk_0010001_3352_18901", maptype="GL"), Metadata( mapid=10000023, imagezoomify= 'http://fotothek.slub-dresden.de/zooms/df/dk/0010000/df_dk_0010001_3352_1918/ImageProperties.xml', title='', titleshort=''), Metadata( mapid=10000024, imagezoomify= 'http://fotothek.slub-dresden.de/zooms/df/dk/0010000/df_dk_0010001_3352_1918/ImageProperties.xml', title='', titleshort='') ] try: for obj in self.testData: self.dbsession.add(obj) self.dbsession.flush() except Exception: raise
def setUp(self): self.process = Georeferenzierungsprozess( mapid=10002567, nutzerid=TEST_LOGIN, clippolygon={ 'source': 'pixel', 'polygon': [[467, 923], [7281, 999], [7224, 7432], [258, 7471], [467, 923]] }, georefparams={ 'source': 'pixel', 'target': 'EPSG:4314', 'gcps': [{ 'source': [467, 923], 'target': [10.6666660308838, 51.4000015258789] }, { 'source': [7281, 999], 'target': [10.8333339691162, 51.4000015258789] }, { 'source': [7224, 7432], 'target': [10.8333339691162, 51.2999992370605] }, { 'source': [258, 7471], 'target': [10.6666660308838, 51.2999992370605] }], "algorithm": "affine", }, timestamp="2014-08-09 12:20:26", type='new', algorithm='affine', isactive=True, processed=False, overwrites=0, adminvalidation='') self.map = Map( id=10002567, apsobjectid=90015724, apsdateiname="df_dk_0010001_4630_1928", boundingbox= "POLYGON((10.6666660308838 51.2999992370605,10.6666660308838 51.4000015258789,10.8333339691162 51.4000015258789,10.8333339691162 51.2999992370605,10.6666660308838 51.2999992370605))", originalimage=os.path.join(TEST_DATA_DIR, "df_dk_0010001_4630_1928.tif")) self.metadata = Metadata( mapid=10002567, imagezoomify= 'http://fotothek.slub-dresden.de/zooms/df/dk/0010000/df_dk_0010001_3352_1918/ImageProperties.xml', title='', titleshort='', scale='1:25000', timepublish=datetime.now(), imagejpg= 'http://fotothek.slub-dresden.de/fotos/df/dk/0010000/df_dk_0010001_2655.jpg', thumbssmall= 'http://fotothek.slub-dresden.de/thumbs/df/dk/0010000/df_dk_0010001_6817.jpg', description= 'Ars an der Mosel. - Aufn. 1880, hrsg. 1882, Aufldr. 1916. - 1:25000. - [Berlin]: Kgl. Preuss. Landesaufnahme, 1916. - 1 Kt.', technic='Lithografie & Umdruck', type='Druckgraphik') try: self.dbsession.add(self.metadata) self.dbsession.add(self.map) self.dbsession.flush() except Exception: raise