- Timestamp:
- 06/16/10 21:56:45 (2 years ago)
- Location:
- sample/trunk
- Files:
-
- 5 removed
- 25 modified
- 64 copied
-
. (modified) (2 props)
-
MapFishSample.egg-info (deleted)
-
apache (copied) (copied from sandbox/tsauerwein/sample/apache)
-
apache/README.txt.in (copied) (copied from sandbox/tsauerwein/sample/apache/README.txt.in)
-
apache/mapserver.conf.in (copied) (copied from sandbox/tsauerwein/sample/apache/mapserver.conf.in)
-
apache/static_files.conf.in (copied) (copied from sandbox/tsauerwein/sample/apache/static_files.conf.in)
-
apache/tilecache.conf.in (copied) (copied from sandbox/tsauerwein/sample/apache/tilecache.conf.in)
-
apache/wsgi.conf.in (copied) (copied from sandbox/tsauerwein/sample/apache/wsgi.conf.in)
-
bootstrap.py (copied) (copied from sandbox/tsauerwein/sample/bootstrap.py)
-
buildout (copied) (copied from sandbox/tsauerwein/sample/buildout)
-
buildout.cfg (copied) (copied from sandbox/tsauerwein/sample/buildout.cfg)
-
buildout_demo-mapfish-org.cfg (copied) (copied from sandbox/tsauerwein/sample/buildout_demo-mapfish-org.cfg)
-
buildout_elemoine.cfg (copied) (copied from sandbox/tsauerwein/sample/buildout_elemoine.cfg)
-
buildout_sample.cfg (copied) (copied from sandbox/tsauerwein/sample/buildout_sample.cfg)
-
development.ini (deleted)
-
jsbuild (copied) (copied from sandbox/tsauerwein/sample/jsbuild)
-
jsbuild/app.cfg (copied) (copied from sandbox/tsauerwein/sample/jsbuild/app.cfg)
-
mapfishsample.ini.in (deleted)
-
mapfishsample.wsgi.in (deleted)
-
mapfishsample/config/routing.py (modified) (1 diff)
-
mapfishsample/controllers/admin.py (copied) (copied from sandbox/tsauerwein/sample/mapfishsample/controllers/admin.py)
-
mapfishsample/controllers/epfl.py (modified) (3 diffs)
-
mapfishsample/forms (copied) (copied from sandbox/tsauerwein/sample/mapfishsample/forms)
-
mapfishsample/forms/__init__.py (copied) (copied from sandbox/tsauerwein/sample/mapfishsample/forms/__init__.py)
-
mapfishsample/model/__init__.py (modified) (1 diff)
-
mapfishsample/model/cities.py (modified) (1 diff)
-
mapfishsample/model/countries.py (modified) (1 diff)
-
mapfishsample/model/epfl.py (copied) (copied from sandbox/tsauerwein/sample/mapfishsample/model/epfl.py)
-
mapfishsample/model/lines.py (modified) (1 diff)
-
mapfishsample/model/meta.py (modified) (2 diffs)
-
mapfishsample/model/points.py (modified) (1 diff)
-
mapfishsample/model/polygons.py (modified) (1 diff)
-
mapfishsample/model/summits.py (modified) (1 diff)
-
mapfishsample/public/adminapp (copied) (copied from sandbox/tsauerwein/sample/mapfishsample/public/adminapp)
-
mapfishsample/public/adminapp/images (copied) (copied from sandbox/tsauerwein/sample/mapfishsample/public/adminapp/images)
-
mapfishsample/public/adminapp/images/remove_feature_off.png (copied) (copied from sandbox/tsauerwein/sample/mapfishsample/public/adminapp/images/remove_feature_off.png)
-
mapfishsample/public/adminapp/images/remove_feature_on.png (copied) (copied from sandbox/tsauerwein/sample/mapfishsample/public/adminapp/images/remove_feature_on.png)
-
mapfishsample/public/adminapp/images/select_feature_off.png (copied) (copied from sandbox/tsauerwein/sample/mapfishsample/public/adminapp/images/select_feature_off.png)
-
mapfishsample/public/adminapp/images/select_feature_on.png (copied) (copied from sandbox/tsauerwein/sample/mapfishsample/public/adminapp/images/select_feature_on.png)
-
mapfishsample/public/build (copied) (copied from sandbox/tsauerwein/sample/mapfishsample/public/build)
-
mapfishsample/public/demos/c2corg/search.html (modified) (6 diffs)
-
mapfishsample/public/demos/editing (copied) (copied from sandbox/tsauerwein/sample/mapfishsample/public/demos/editing)
-
mapfishsample/public/demos/editing/editing-panel.html (copied) (copied from sandbox/tsauerwein/sample/mapfishsample/public/demos/editing/editing-panel.html)
-
mapfishsample/public/demos/editing/examples.js (copied) (copied from sandbox/tsauerwein/sample/mapfishsample/public/demos/editing/examples.js)
-
mapfishsample/public/demos/editing/geometryOff.png (copied) (copied from sandbox/tsauerwein/sample/mapfishsample/public/demos/editing/geometryOff.png)
-
mapfishsample/public/demos/editing/geometryOn.png (copied) (copied from sandbox/tsauerwein/sample/mapfishsample/public/demos/editing/geometryOn.png)
-
mapfishsample/public/demos/editing/index.html (copied) (copied from sandbox/tsauerwein/sample/mapfishsample/public/demos/editing/index.html)
-
mapfishsample/public/demos/editing/list.html (copied) (copied from sandbox/tsauerwein/sample/mapfishsample/public/demos/editing/list.html)
-
mapfishsample/public/demos/geostat/geostat.html (modified) (5 diffs)
-
mapfishsample/public/demos/routing/epfl.html (modified) (2 diffs)
-
mapfishsample/public/index.html (modified) (1 diff)
-
mapfishsample/public/lib/ext-community-extensions (copied) (copied from sandbox/tsauerwein/sample/mapfishsample/public/lib/ext-community-extensions)
-
mapfishsample/public/lib/ext-community-extensions/color-field.css (copied) (copied from sandbox/tsauerwein/sample/mapfishsample/public/lib/ext-community-extensions/color-field.css)
-
mapfishsample/public/lib/ext-community-extensions/color-field.js (copied) (copied from sandbox/tsauerwein/sample/mapfishsample/public/lib/ext-community-extensions/color-field.js)
-
mapfishsample/public/lib/ext-community-extensions/color-trigger.gif (copied) (copied from sandbox/tsauerwein/sample/mapfishsample/public/lib/ext-community-extensions/color-trigger.gif)
-
mapfishsample/public/lib/ext-community-extensions/color-trigger.png (copied) (copied from sandbox/tsauerwein/sample/mapfishsample/public/lib/ext-community-extensions/color-trigger.png)
-
mapfishsample/public/lib/externals (copied) (copied from sandbox/tsauerwein/sample/mapfishsample/public/lib/externals)
-
mapfishsample/public/lib/proj4js (copied) (copied from sandbox/tsauerwein/sample/mapfishsample/public/lib/proj4js)
-
mapfishsample/public/lib/proj4js/proj4js.js (copied) (copied from sandbox/tsauerwein/sample/mapfishsample/public/lib/proj4js/proj4js.js)
-
mapfishsample/templates/forms (copied) (copied from sandbox/tsauerwein/sample/mapfishsample/templates/forms)
-
mapfishsample/templates/forms/fieldset.mako (copied) (copied from sandbox/tsauerwein/sample/mapfishsample/templates/forms/fieldset.mako)
-
mapfishsample/templates/forms/fieldset_readonly.mako (copied) (copied from sandbox/tsauerwein/sample/mapfishsample/templates/forms/fieldset_readonly.mako)
-
mapfishsample/templates/forms/grid.mako (copied) (copied from sandbox/tsauerwein/sample/mapfishsample/templates/forms/grid.mako)
-
mapfishsample/templates/forms/grid_readonly.mako (copied) (copied from sandbox/tsauerwein/sample/mapfishsample/templates/forms/grid_readonly.mako)
-
mapfishsample/templates/forms/map.mako (copied) (copied from sandbox/tsauerwein/sample/mapfishsample/templates/forms/map.mako)
-
mapfishsample/templates/forms/map_js.mako (copied) (copied from sandbox/tsauerwein/sample/mapfishsample/templates/forms/map_js.mako)
-
mapfishsample/templates/forms/restfieldset.mako (copied) (copied from sandbox/tsauerwein/sample/mapfishsample/templates/forms/restfieldset.mako)
-
mapfishsample/tests/__init__.py (modified) (1 diff)
-
mapfishsample/tests/functional/test_cities.py (modified) (1 diff)
-
mapfishsample/tests/functional/test_countries.py (modified) (1 diff)
-
mapfishsample/tests/functional/test_lines.py (modified) (5 diffs)
-
mapfishsample/tests/functional/test_points.py (modified) (6 diffs)
-
mapfishsample/tests/functional/test_polygons.py (modified) (6 diffs)
-
mapfishsample/tests/functional/test_summits.py (modified) (7 diffs)
-
mapfishsample/websetup.py (modified) (1 diff)
-
mapfishsample_dev.ini.in (copied) (copied from sandbox/tsauerwein/sample/mapfishsample_dev.ini.in)
-
mapfishsample_prod.ini.in (copied) (copied from sandbox/tsauerwein/sample/mapfishsample_prod.ini.in)
-
mapserver (copied) (copied from sandbox/tsauerwein/sample/mapserver)
-
mapserver/fonts.txt (copied) (copied from sandbox/tsauerwein/sample/mapserver/fonts.txt)
-
mapserver/mapfishsample.map.in (copied) (copied from sandbox/tsauerwein/sample/mapserver/mapfishsample.map.in)
-
mapserver/symbols.txt (copied) (copied from sandbox/tsauerwein/sample/mapserver/symbols.txt)
-
mapserver/vera (copied) (copied from sandbox/tsauerwein/sample/mapserver/vera)
-
mapserver/vera/COPYRIGHT.TXT (copied) (copied from sandbox/tsauerwein/sample/mapserver/vera/COPYRIGHT.TXT)
-
mapserver/vera/README.TXT (copied) (copied from sandbox/tsauerwein/sample/mapserver/vera/README.TXT)
-
mapserver/vera/RELEASENOTES.TXT (copied) (copied from sandbox/tsauerwein/sample/mapserver/vera/RELEASENOTES.TXT)
-
mapserver/vera/Vera.ttf (copied) (copied from sandbox/tsauerwein/sample/mapserver/vera/Vera.ttf)
-
mapserver/vera/VeraBd.ttf (copied) (copied from sandbox/tsauerwein/sample/mapserver/vera/VeraBd.ttf)
-
print (copied) (copied from sandbox/tsauerwein/sample/print)
-
print/config.yaml (copied) (copied from sandbox/tsauerwein/sample/print/config.yaml)
-
setup.py (modified) (3 diffs)
-
test.ini (deleted)
-
test.ini.in (modified) (1 diff)
-
tilecache (copied) (copied from sandbox/tsauerwein/sample/tilecache)
-
tilecache/tilecache.cfg.in (copied) (copied from sandbox/tsauerwein/sample/tilecache/tilecache.cfg.in)
Legend:
- Unmodified
- Added
- Removed
-
sample/trunk
- Property svn:ignore
-
old new 1 mapfishsample.wsgi 1 *.pyc 2 *.ini 3 .installed.cfg 4 *.egg-info 5 data 2 6 MANIFEST 3 mapfishsample.ini 4 *.pyc 7 MapFish 8 GeoFormAlchemy
-
- Property svn:mergeinfo set to /sandbox/tsauerwein/sample:3436-3569
- Property svn:ignore
-
sample/trunk/mapfishsample/config/routing.py
r1593 r3570 24 24 printer.addRoutes(map, '/print/', 'printer') 25 25 26 # Map the /admin url to FA's AdminController 27 # Map static files 28 map.connect('fa_static', '/admin/_static/{path_info:.*}', controller='admin', action='static') 29 # Index page 30 map.connect('admin', '/admin', controller='admin', action='models') 31 map.connect('formatted_admin', '/admin.json', controller='admin', action='models', format='json') 32 # Models 33 map.resource('model', 'models', path_prefix='/admin/{model_name}', controller='admin') 34 35 26 36 map.resource('summit', 'summits') 27 37 map.resource('country', 'countries') -
sample/trunk/mapfishsample/controllers/epfl.py
r1590 r3570 30 30 from mapfishsample.lib.base import BaseController 31 31 from mapfishsample.model.meta import Session, engine 32 from mapfishsample.model import nodes_table,Node, Line32 from mapfishsample.model.epfl import Node, Line 33 33 34 34 log = logging.getLogger(__name__) … … 40 40 if 'query' in request.params: 41 41 rooms = Session.query(Node).filter(Node.room.like(request.params['query'] + '%')) 42 return {'results': [{'id': r.room, 'title': r.room} for r in rooms.order_by( nodes_table.c.room)]}42 return {'results': [{'id': r.room, 'title': r.room} for r in rooms.order_by(Node.__table__.c.room)]} 43 43 44 44 def routing(self): 45 source_id = Session.query(Node).filter( nodes_table.c.room == request.params['from'])[0].node_id46 target_id = Session.query(Node).filter( nodes_table.c.room == request.params['to'])[0].node_id45 source_id = Session.query(Node).filter(Node.__table__.c.room == request.params['from'])[0].node_id 46 target_id = Session.query(Node).filter(Node.__table__.c.room == request.params['to'])[0].node_id 47 47 48 48 if 'disabled' in request.params and request.params['disabled'] == '1': 49 cost = "CASE WHEN type = '9.2' THEN -1.0::float8 ELSE length::float8 END" 49 """If a node is not suitable for disabled (type = '9.2'), it should not be taken into account for routing. 50 Because pgrouting does not allow negative values as cost, we set the length to 'Infinity'. 51 see also: http://pgrouting.postlbs.org/ticket/88 52 """ 53 cost = "CASE WHEN type = '9.2' THEN 'Infinity'::float8 ELSE length::float8 END" 50 54 else: 51 55 cost = "length::float8" … … 54 58 "SELECT gid AS id, node1_id::int4 AS source, node2_id::int4 AS target, %(cost)s AS cost FROM lines2"%{'cost': cost}, 55 59 int(source_id), int(target_id)).fetchall() 56 57 source_f = Session.query(Node).get(route[0]['vertex_id']).toFeature() 58 target_f = Session.query(Node).get(route[-1]['vertex_id']).toFeature() 60 61 if route is None or len(route) <= 0: 62 abort(400) 63 64 source_f = Session.query(Node).filter(Node.node_id == route[0]['vertex_id']).first().toFeature() 65 target_f = Session.query(Node).filter(Node.node_id == route[-1]['vertex_id']).first().toFeature() 59 66 60 67 source_f.properties['_isSourceNode'] = True -
sample/trunk/mapfishsample/model/__init__.py
r1590 r3570 21 21 import sqlalchemy as sa 22 22 from sqlalchemy import orm 23 from sqlalchemy.dialects.sqlite.base import SQLiteDialect 24 from sqlalchemy.interfaces import PoolListener 23 25 24 26 from geojson import Feature 25 27 26 28 from mapfishsample.model import meta 27 from mapfish.sqlalchemygeom import Geometry 29 30 from mapfishsample.model.lines import Line 31 from mapfishsample.model.points import Point 32 from mapfishsample.model.polygons import Polygon 28 33 29 34 def init_model(engine): 30 35 """Call me before using any of the tables or classes in the model""" 31 36 ## Reflected tables must be defined and mapped here 32 #global reflected_table33 #reflected_table = sa.Table("Reflected", meta.metadata, autoload=True,34 # autoload_with=engine)35 #orm.mapper(Reflected, reflected_table)36 37 37 sm = orm.sessionmaker(autoflush=True, autocommit=False, bind=engine) 38 38 39 39 meta.engine = engine 40 40 meta.Session = orm.scoped_session(sm) 41 42 43 nodes_table = sa.Table('nodes2', meta.metadata, 44 sa.Column('node_id', sa.types.Integer, primary_key=True), 45 sa.Column('room', sa.types.String, unique=True), 46 sa.Column('level', sa.types.Integer), 47 sa.Column('geom', Geometry)) 48 49 class Node(object): 50 __table__ = nodes_table 51 def toFeature(self): 52 return Feature(id=int(self.node_id), geometry=self.geom, 53 properties={'room': str(self.room), 'floor': str(self.level)}) 54 55 orm.mapper(Node, nodes_table) 56 57 lines_table = sa.Table('lines2', meta.metadata, 58 sa.Column('gid', sa.types.Integer, primary_key=True), 59 sa.Column('length', sa.types.Float), 60 sa.Column('geom', Geometry)) 61 62 class Line(object): 63 def toFeature(self): 64 return Feature(id=int(self.gid), geometry=self.geom, 65 properties={'distance': float(self.length)}) 66 67 orm.mapper(Line, lines_table) 68 69 ## Classes for reflected tables may be defined here, but the table and 70 ## mapping itself must be done in the init_model function 71 #reflected_table = None 72 # 73 #class Reflected(object): 74 # pass 41 42 if isinstance(engine.dialect, SQLiteDialect): 43 """If Spatialite is used as database, we have to make sure that 44 every database connection created in the SQLAlchemy connection pool 45 loads the Spatialite extension, before the connection is used. 46 """ 47 class SpatialiteConnectionListener(PoolListener): 48 def connect(self, dbapi_con, con_record): 49 dbapi_con.enable_load_extension(True) 50 dbapi_con.execute("select load_extension('/usr/local/lib/libspatialite.so')") 51 dbapi_con.enable_load_extension(False) 52 53 engine.pool.add_listener(SpatialiteConnectionListener()) 54 -
sample/trunk/mapfishsample/model/cities.py
r1590 r3570 18 18 # 19 19 20 from sqlalchemy import Column, Table, types 21 from sqlalchemy.orm import mapper 20 from geoalchemy import GeometryColumn, Geometry 22 21 23 from mapfish.sqlalchemygeom import Geometry24 22 from mapfish.sqlalchemygeom import GeometryTableMixIn 23 from mapfishsample.model.meta import engine, Base 25 24 26 from mapfishsample.model.meta import metadata, engine27 25 28 cities_table = Table( 29 'world_cities', metadata, 30 Column('the_geom', Geometry(4326)), 31 autoload=True, autoload_with=engine) 32 33 class City(GeometryTableMixIn): 34 # for GeometryTableMixIn to do its job the __table__ property 35 # must be set here 36 __table__ = cities_table 37 38 mapper(City, cities_table) 26 class City(Base, GeometryTableMixIn): 27 __tablename__ = 'world_cities' 28 __table_args__ = { 29 'autoload' : True, 30 'autoload_with' : engine 31 } 32 33 the_geom = GeometryColumn(Geometry(dimension=2, srid=4326)) -
sample/trunk/mapfishsample/model/countries.py
r1590 r3570 18 18 # 19 19 20 from sqlalchemy import Column, Table, types 21 from sqlalchemy.orm import mapper 20 from sqlalchemy import types, Column 22 21 23 from mapfish.sqlalchemygeom import Geometry 22 from geoalchemy import GeometryColumn, Geometry 23 24 24 from mapfish.sqlalchemygeom import GeometryTableMixIn 25 from mapfishsample.model.meta import engine, Base 25 26 26 from mapfishsample.model.meta import metadata, engine27 27 28 countries_table = Table( 29 'world_factbk_simplified', metadata, 30 Column('simplify', Geometry(4326)), 31 autoload=True, autoload_with=engine) 28 class Country(Base, GeometryTableMixIn): 29 __tablename__ = 'world_factbk_simplified' 30 __table_args__ = { 31 'autoload' : True, 32 'autoload_with' : engine 33 } 34 35 # force SQLAlchemy not to use Decimals, see https://trac.mapfish.org/trac/mapfish/ticket/185 36 birth_rt = Column(types.Numeric(asdecimal=False)) 37 death_rt = Column(types.Numeric(asdecimal=False)) 38 fertility = Column(types.Numeric(asdecimal=False)) 39 40 simplify = GeometryColumn(Geometry(dimension=2, srid=4326)) 32 41 33 class Country(GeometryTableMixIn):34 # for GeometryTableMixIn to do its job the __table__ property35 # must be set here36 __table__ = countries_table37 38 mapper(Country, countries_table) -
sample/trunk/mapfishsample/model/lines.py
r1590 r3570 18 18 # 19 19 20 from sqlalchemy import Column, Table,types21 from sqlalchemy. orm import mapper20 from sqlalchemy import Column, types 21 from sqlalchemy.schema import Sequence 22 22 23 from mapfish.sqlalchemygeom import Geometry 23 from geoalchemy import GeometryColumn, LineString, GeometryDDL 24 24 25 from mapfish.sqlalchemygeom import GeometryTableMixIn 26 from mapfishsample.model.meta import Base 25 27 26 from mapfishsample.model.meta import metadata, engine 28 # dimension information array for Oracle 29 diminfo = "MDSYS.SDO_DIM_ARRAY("\ 30 "MDSYS.SDO_DIM_ELEMENT('LONGITUDE', -180, 180, 0.000000005),"\ 31 "MDSYS.SDO_DIM_ELEMENT('LATITUDE', -90, 90, 0.000000005)"\ 32 ")" 27 33 28 lines_table = Table( 29 'lines', metadata, 30 Column('the_geom', Geometry(4326)), 31 autoload=True, autoload_with=engine) 34 class Line(Base, GeometryTableMixIn): 35 __tablename__ = 'lines_tab' 36 37 id = Column(types.Integer, Sequence('lines_tab_id_seq'), primary_key=True) 38 name = Column(types.String(30), default = 'foo') 39 the_geom = GeometryColumn(LineString(dimension=2, srid=4326, diminfo=diminfo)) 32 40 33 class Line(GeometryTableMixIn): 34 # for GeometryTableMixIn to do its job the __table__ property 35 # must be set here 36 __table__ = lines_table 37 38 mapper(Line, lines_table) 41 GeometryDDL(Line.__table__) -
sample/trunk/mapfishsample/model/meta.py
r1590 r3570 2 2 from sqlalchemy import MetaData 3 3 from sqlalchemy.orm import scoped_session, sessionmaker 4 from sqlalchemy.ext.declarative import declarative_base 4 5 5 __all__ = ['Session', 'metadata' ]6 __all__ = ['Session', 'metadata', 'Base'] 6 7 7 8 # SQLAlchemy database engine. Updated by model.init_model() … … 14 15 # names, you'll need a metadata for each database 15 16 metadata = MetaData() 17 18 Base = declarative_base(metadata=metadata) -
sample/trunk/mapfishsample/model/points.py
r1590 r3570 18 18 # 19 19 20 from sqlalchemy import Column, Table,types21 from sqlalchemy. orm import mapper20 from sqlalchemy import Column, types 21 from sqlalchemy.schema import Sequence 22 22 23 from mapfish.sqlalchemygeom import Geometry 23 from geoalchemy import GeometryColumn, Point, GeometryDDL 24 24 25 from mapfish.sqlalchemygeom import GeometryTableMixIn 26 from mapfishsample.model.meta import Base 25 27 26 from mapfishsample.model.meta import metadata, engine 28 # dimension information array for Oracle 29 diminfo = "MDSYS.SDO_DIM_ARRAY("\ 30 "MDSYS.SDO_DIM_ELEMENT('LONGITUDE', -180, 180, 0.000000005),"\ 31 "MDSYS.SDO_DIM_ELEMENT('LATITUDE', -90, 90, 0.000000005)"\ 32 ")" 27 33 28 points_table = Table( 29 'points', metadata, 30 Column('the_geom', Geometry(4326)), 31 autoload=True, autoload_with=engine) 34 class Point(Base, GeometryTableMixIn): 35 __tablename__ = 'points' 36 37 id = Column(types.Integer, Sequence('points_id_seq'), primary_key=True) 38 name = Column(types.String(30), default = 'foo') 39 the_geom = GeometryColumn(Point(dimension=2, srid=4326, diminfo=diminfo)) 32 40 33 class Point(GeometryTableMixIn): 34 # for GeometryTableMixIn to do its job the __table__ property 35 # must be set here 36 __table__ = points_table 41 GeometryDDL(Point.__table__) 37 42 38 mapper(Point, points_table) -
sample/trunk/mapfishsample/model/polygons.py
r1590 r3570 18 18 # 19 19 20 from sqlalchemy import Column, Table,types21 from sqlalchemy. orm import mapper20 from sqlalchemy import Column, types 21 from sqlalchemy.schema import Sequence 22 22 23 from mapfish.sqlalchemygeom import Geometry 23 from geoalchemy import GeometryColumn, Polygon, GeometryDDL 24 24 25 from mapfish.sqlalchemygeom import GeometryTableMixIn 26 from mapfishsample.model.meta import Base 25 27 26 from mapfishsample.model.meta import metadata, engine 28 # dimension information array for Oracle 29 diminfo = "MDSYS.SDO_DIM_ARRAY("\ 30 "MDSYS.SDO_DIM_ELEMENT('LONGITUDE', -180, 180, 0.000000005),"\ 31 "MDSYS.SDO_DIM_ELEMENT('LATITUDE', -90, 90, 0.000000005)"\ 32 ")" 27 33 28 polygons_table = Table( 29 'polygons', metadata, 30 Column('the_geom', Geometry(4326)), 31 autoload=True, autoload_with=engine) 34 class Polygon(Base, GeometryTableMixIn): 35 __tablename__ = 'polygons' 36 37 id = Column(types.Integer, Sequence('polygons_id_seq'), primary_key=True) 38 name = Column(types.String(30), default = 'foo') 39 the_geom = GeometryColumn(Polygon(dimension=2, srid=4326, diminfo=diminfo)) 32 40 33 class Polygon(GeometryTableMixIn): 34 # for GeometryTableMixIn to do its job the __table__ property 35 # must be set here 36 __table__ = polygons_table 37 38 mapper(Polygon, polygons_table) 41 GeometryDDL(Polygon.__table__) -
sample/trunk/mapfishsample/model/summits.py
r2993 r3570 18 18 # 19 19 20 from sqlalchemy import Column, Table, types 21 from sqlalchemy.orm import mapper 20 from geoalchemy import GeometryColumn, Point 22 21 23 from mapfish.sqlalchemygeom import Geometry24 22 from mapfish.sqlalchemygeom import GeometryTableMixIn 23 from mapfishsample.model.meta import engine, Base 25 24 26 from mapfishsample.model.meta import metadata, engine27 25 28 summits_table = Table( 29 'sommets_out', metadata, 30 Column('geom', Geometry(4326)), 31 autoload=True, autoload_with=engine) 32 33 class Summit(GeometryTableMixIn): 34 # for GeometryTableMixIn to do its job the __table__ property 35 # must be set here 36 __table__ = summits_table 37 38 mapper(Summit, summits_table) 26 class Summit(Base, GeometryTableMixIn): 27 __tablename__ = 'sommets_out' 28 __table_args__ = { 29 'autoload' : True, 30 'autoload_with' : engine 31 } 32 33 geom = GeometryColumn(Point(dimension=2, srid=4326)) -
sample/trunk/mapfishsample/public/demos/c2corg/search.html
r3412 r3570 4 4 <title>Search demo</title> 5 5 <meta http-equiv="CONTENT-TYPE" content="text/html; charset=utf-8"> 6 <link rel="stylesheet" type="text/css" href="../../mfbase/ext/resources/css/ext-all.css"/> 6 <link rel="stylesheet" type="text/css" href="../../lib/externals/ext/resources/css/ext-all.css"/> 7 <link rel="stylesheet" type="text/css" href="../../lib/externals/openlayers/theme/default/style.css"/> 7 8 8 9 <style type="text/css"> … … 58 59 } 59 60 .pan { 60 background-image: url(../../ mfbase/mapfish/img/icon_pan.png) !important;61 background-image: url(../../lib/externals/mapfish/img/icon_pan.png) !important; 61 62 height: 20px !important; 62 63 width: 20px !important; … … 70 71 71 72 <!-- EXT colorField Extent --> 72 <link rel="stylesheet" type="text/css" href="../../ mfbase/ext-community-extensions/color-field.css" />73 <link rel="stylesheet" type="text/css" href="../../lib/ext-community-extensions/color-field.css" /> 73 74 </head> 74 75 … … 78 79 <div class="loading-container"> 79 80 <div class="loading-indicator"> 80 <img src="../../ mfbase/ext/resources/images/default/shared/large-loading.gif"81 <img src="../../lib/externals/ext/resources/images/default/shared/large-loading.gif" 81 82 width="32" height="32" style="margin-right:8px;float:left;vertical-align:top;"/>MapFish - Search 82 83 <br /> … … 92 93 </body> 93 94 94 <script type="text/javascript" src="../../ mfbase/ext/adapter/ext/ext-base.js"></script>95 <script type="text/javascript" src="../../lib/externals/ext/adapter/ext/ext-base.js"></script> 95 96 <!-- debug mode --> 96 97 <!-- 97 <script type="text/javascript" src="../../ mfbase/ext/ext-core-debug.js"></script>98 <script type="text/javascript" src="../../ mfbase/ext/ext-all-debug.js"></script>98 <script type="text/javascript" src="../../lib/externals/ext/ext-core-debug.js"></script> 99 <script type="text/javascript" src="../../lib/externals/ext/ext-all-debug.js"></script> 99 100 --> 100 101 <!-- prod mode --> 101 <script type="text/javascript" src="../../ mfbase/ext/ext-all.js"></script>102 <script type="text/javascript" src="../../lib/externals/ext/ext-all.js"></script> 102 103 103 104 <!-- debug mode --> 104 105 <!-- 105 <script type="text/javascript" src="../../ mfbase/openlayers/lib/OpenLayers.js"></script>106 <script type="text/javascript" src="../../ mfbase/geoext/lib/GeoExt.js"></script>107 <script type="text/javascript" src="../../ mfbase/mapfish/MapFish.js"></script>106 <script type="text/javascript" src="../../lib/externals/openlayers/lib/OpenLayers.js"></script> 107 <script type="text/javascript" src="../../lib/externals/geoext/lib/GeoExt.js"></script> 108 <script type="text/javascript" src="../../lib/externals/mapfish/MapFish.js"></script> 108 109 --> 109 110 <!-- prod mode --> 110 <script type="text/javascript" src="../../ mfbase/release/mapfish/MapFish.js"></script>111 <script type="text/javascript" src="../../build/MapFish.js"></script> 111 112 112 113 <!-- EXT colorField Extent --> 113 <script type="text/javascript" src="../../ mfbase/ext-community-extensions/color-field.js" ></script>114 <script type="text/javascript" src="../../lib/ext-community-extensions/color-field.js" ></script> 114 115 115 116 <script type="text/javascript"> 116 117 117 // reference local blank image118 Ext.BLANK_IMAGE_URL = '../../ mfbase/ext/resources/images/default/s.gif';118 OpenLayers.ImgPath = '../../lib/externals/openlayers/img/'; 119 Ext.BLANK_IMAGE_URL = '../../lib/externals/ext/resources/images/default/s.gif'; 119 120 120 121 function createMap() { … … 130 131 controls: [new OpenLayers.Control.PanZoomBar()], 131 132 maxExtent: new OpenLayers.Bounds(-180, -90, 180, 90), 132 scales: scales 133 scales: scales, 134 theme: null 133 135 }; 134 136 -
sample/trunk/mapfishsample/public/demos/geostat/geostat.html
r429 r3570 3 3 <head> 4 4 <title>Geostat demo</title> 5 <link rel="stylesheet" type="text/css" href="../../mfbase/ext/resources/css/ext-all.css"/> 5 <link rel="stylesheet" type="text/css" href="../../lib/externals/ext/resources/css/ext-all.css"/> 6 <link rel="stylesheet" type="text/css" href="../../lib/externals/openlayers/theme/default/style.css"/> 6 7 7 8 <style type="text/css"> … … 65 66 66 67 <!-- EXT colorField Extent --> 67 <link rel="stylesheet" type="text/css" href="../../ mfbase/ext-community-extensions/color-field.css" />68 <link rel="stylesheet" type="text/css" href="../../lib/ext-community-extensions/color-field.css" /> 68 69 69 70 </head> … … 72 73 <div class="loading-mask"></div> 73 74 <div class="loading-container"> 74 <div class="loading-indicator"><img src="../../ mfbase/ext/resources/images/default/shared/large-loading.gif" width="32" height="32" style="margin-right:8px;float:left;vertical-align:top;"/>MapFish - Geostat<br /><span id="loading-msg">Loading ...</span></div>75 <div class="loading-indicator"><img src="../../lib/externals/ext/resources/images/default/shared/large-loading.gif" width="32" height="32" style="margin-right:8px;float:left;vertical-align:top;"/>MapFish - Geostat<br /><span id="loading-msg">Loading ...</span></div> 75 76 </div> 76 77 </div> … … 86 87 </body> 87 88 88 <script type="text/javascript" src="../../ mfbase/ext/adapter/ext/ext-base.js"></script>89 <script type="text/javascript" src="../../ mfbase/ext/ext-all.js"></script>89 <script type="text/javascript" src="../../lib/externals/ext/adapter/ext/ext-base.js"></script> 90 <script type="text/javascript" src="../../lib/externals/ext/ext-all.js"></script> 90 91 91 92 <!-- debug mode --> 92 93 <!-- 93 <script type="text/javascript" src="../../ mfbase/openlayers/lib/OpenLayers.js"></script>94 <script type="text/javascript" src="../../ mfbase/mapfish/MapFish.js"></script>94 <script type="text/javascript" src="../../lib/externals/openlayers/lib/OpenLayers.js"></script> 95 <script type="text/javascript" src="../../lib/externals/mapfish/MapFish.js"></script> 95 96 --> 96 97 <!-- production mode --> 97 <script type="text/javascript" src="../../ mfbase/release/mapfish/MapFish.js"></script>98 <script type="text/javascript" src="../../build/MapFish.js"></script> 98 99 99 100 <!-- EXT colorField Extent --> 100 <script type="text/javascript" src="../../ mfbase/ext-community-extensions/color-field.js" ></script>101 <script type="text/javascript" src="../../lib/ext-community-extensions/color-field.js" ></script> 101 102 102 103 <script type="text/javascript"> 103 104 104 // reference local blank image105 Ext.BLANK_IMAGE_URL = '../../ mfbase/ext/resources/images/default/s.gif';105 OpenLayers.ImgPath = '../../lib/externals/openlayers/img/'; 106 Ext.BLANK_IMAGE_URL = '../../lib/externals/ext/resources/images/default/s.gif'; 106 107 107 108 Ext.onReady(function() { 108 109 Ext.state.Manager.setProvider(new Ext.state.CookieProvider()); 109 110 110 var map = new OpenLayers.Map( $('olmap'));111 var map = new OpenLayers.Map('olmap', {theme: null}); 111 112 112 113 var jpl_wms = new OpenLayers.Layer.WMS("Satellite", … … 323 324 separator: '<br/>y: '})); 324 325 325 map.addControl(new OpenLayers.Control.OverviewMap({div: $('overviewmap')})); 326 map.addControl( 327 new OpenLayers.Control.OverviewMap({ 328 div: $('overviewmap'), 329 mapOptions: { 330 theme: null 331 } 332 }) 333 ); 326 334 327 335 Ext.get('loading').fadeOut({remove: true}); -
sample/trunk/mapfishsample/public/demos/routing/epfl.html
r1408 r3570 7 7 <meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> 8 8 9 <link rel="stylesheet" type="text/css" href="../../mfbase/ext/resources/css/ext-all.css" /> 10 11 <script type="text/javascript" src="../../mfbase/ext/adapter/ext/ext-base.js"></script> 12 <script type="text/javascript" src="../../mfbase/ext/ext-all.js"></script> 13 14 <script type="text/javascript" src="../../mfbase/release/mapfish/MapFish.js"></script> 15 9 <link rel="stylesheet" type="text/css" href="../../lib/externals/ext/resources/css/ext-all.css" /> 10 <link rel="stylesheet" type="text/css" href="../../lib/externals/openlayers/theme/default/style.css"/> 11 12 <script type="text/javascript" src="../../lib/externals/ext/adapter/ext/ext-base.js"></script> 13 <script type="text/javascript" src="../../lib/externals/ext/ext-all.js"></script> 14 15 <!-- debug mode --> 16 <!-- 17 <script type="text/javascript" src="../../lib/externals/openlayers/lib/OpenLayers.js"></script> 18 <script type="text/javascript" src="../../lib/externals/mapfish/MapFish.js"></script> 19 --> 20 <!-- prod mode --> 21 <script type="text/javascript" src="../../build/MapFish.js"></script> 22 23 16 24 <script type="text/javascript"> 25 26 OpenLayers.ImgPath = '../../lib/externals/openlayers/img/'; 27 Ext.BLANK_IMAGE_URL = '../../lib/externals/ext/resources/images/default/s.gif'; 17 28 18 29 function epflCreateMap(mapDiv) { … … 22 33 units: "m", 23 34 maxExtent: new OpenLayers.Bounds(526000, 147000, 543000, 161000), 24 scales: [1/100, 1/500, 1/1500, 1/3000, 1/5000] 35 scales: [1/100, 1/500, 1/1500, 1/3000, 1/5000], 36 theme: null 25 37 }; 26 38 -
sample/trunk/mapfishsample/public/index.html
r3137 r3570 13 13 <h2>Demos</h2> 14 14 <a href="demos/">Demos page</a> 15 16 <h2>Examples</h2>17 <ul>18 <li><a href="examples/map/">Map</a></li>19 <li><a href="examples/tree/">Tree</a></li>20 <li><a href="examples/geostat/">GeoStat</a></li>21 <li><a href="examples/shortcuts/">Shortcuts</a></li>22 <li><a href="examples/editing/">Editing</a></li>23 <li><a href="examples/search/">Search</a></li>24 <li><a href="examples/print/">Print</a></li>25 <li><a href="examples/recenter/">Recenter</a></li>26 </ul>27 28 <h2>Tests</h2>29 <ul>30 <li><a href="mfbase/mapfish/tests/tests-wrapper.html">MapFish tests</a></li>31 </ul>32 15 </div> 33 16 </body> -
sample/trunk/mapfishsample/tests/__init__.py
r1592 r3570 15 15 from routes.util import URLGenerator 16 16 from webtest import TestApp 17 from routes import url_for18 17 19 18 import pylons.test 20 19 21 __all__ = ['environ', 'url _for', 'TestController']20 __all__ = ['environ', 'url', 'TestController'] 22 21 23 22 # Invoke websetup with the current config file -
sample/trunk/mapfishsample/tests/functional/test_cities.py
r1590 r3570 3 3 class TestCitiesController(TestController): 4 4 def test_index(self): 5 response = self.app.get(url _for(controller='cities'))5 response = self.app.get(url(controller='cities', action='index')) 6 6 # Test response... -
sample/trunk/mapfishsample/tests/functional/test_countries.py
r1590 r3570 3 3 class TestCountriesController(TestController): 4 4 def test_index(self): 5 response = self.app.get(url_for(controller='countries')) 6 # Test response... 5 response = self.app.get(url(controller='countries', action='index')) -
sample/trunk/mapfishsample/tests/functional/test_lines.py
r1700 r3570 3 3 from mapfishsample.model.meta import Session 4 4 from mapfishsample.model.lines import Line 5 6 from geoalchemy import WKBSpatialElement 7 5 8 from shapely.geometry import asLineString 6 9 … … 12 15 feature = Line() 13 16 feature.name = "foo" 14 feature.geometry = asLineString(((0, 0),(0.1, 0.1),(0.2, 0.2))) 17 shape = asLineString(((0, 0),(0.1, 0.1),(0.2, 0.2))) 18 srid = Line.geometry_column().type.srid 19 feature.geometry = WKBSpatialElement(buffer(shape.wkb), srid=srid) 20 feature.geometry.shape = shape 15 21 Session.add(feature) 16 22 Session.commit() … … 26 32 27 33 def test_index(self): 28 response = self.app.get(url _for(controller='lines'))34 response = self.app.get(url(controller='lines', action='index')) 29 35 assert response.response.content_type == 'application/json' 30 36 assert "FeatureCollection" in response 31 37 32 38 def test_index_bad_format(self): 33 response = self.app.get(url _for(controller='lines', format='html'),39 response = self.app.get(url(controller='lines', action='index', format='html'), 34 40 status=404) 35 41 36 42 def test_show(self): 37 response = self.app.get(url _for(controller='lines', action='show', id=self.fid))43 response = self.app.get(url(controller='lines', action='show', id=self.fid)) 38 44 assert response.response.content_type == 'application/json' 39 45 assert "Feature" in response 40 46 41 47 def test_show_bad_format(self): 42 response = self.app.get(url _for(controller='lines', action='show', id=self.fid, format='html'),48 response = self.app.get(url(controller='lines', action='show', id=self.fid, format='html'), 43 49 status=404) 44 50 45 51 def test_show_bad_id(self): 46 response = self.app.get(url _for(controller='lines', action='show', id=-1),52 response = self.app.get(url(controller='lines', action='show', id=-1), 47 53 status=404) 48 54 49 55 def test_create(self): 50 56 params = '{"type": "FeatureCollection", "features": [{"geometry": {"type": "LineString", "coordinates": [[0.0, 0.0], [0.0, 1.0], [1.0, 1.0], [1.0, 0.0]]}, "type": "Feature", "properties": {"name": "bar"}, "id": null}]}' 51 response = self.app.post(url _for(controller='lines', action='create'),57 response = self.app.post(url(controller='lines', action='create'), 52 58 params=params, 53 59 headers={'Content-type': 'text/plain'}, … … 62 68 def test_update(self): 63 69 params = '{"geometry": {"type": "LineString", "coordinates": [[0.0, 0.0], [0.0, 1.0], [1.0, 1.0], [1.0, 0.0]]}, "type": "Feature", "properties": {"name": "dude"}, "id": %d}' % self.fid 64 response = self.app.put(url _for(controller='lines', action='update', id=self.fid),70 response = self.app.put(url(controller='lines', action='update', id=self.fid), 65 71 params=params, 66 72 headers={'Content-type': 'text/plain'}, … … 72 78 def test_delete(self): 73 79 # code below triggers exception, nose bug it seems 74 #self.app.delete(url _for(controller='points', action='delete', id=self.fid),75 # status=204)80 #self.app.delete(url(controller='points', action='delete', id=self.fid), 81 # status=204) 76 82 pass 77 83 78 79 80 84 def test_delete_bad_id(self): 81 response = self.app.delete(url _for(controller='lines', action='delete', id=-1),85 response = self.app.delete(url(controller='lines', action='delete', id=-1), 82 86 status=404) -
sample/trunk/mapfishsample/tests/functional/test_points.py
r1700 r3570 3 3 from mapfishsample.model.meta import Session 4 4 from mapfishsample.model.points import Point 5 6 from geoalchemy import WKBSpatialElement 7 5 8 from shapely.geometry import asPoint 6 9 … … 12 15 feature = Point() 13 16 feature.name = "foo" 14 feature.geometry = asPoint((0.5, 0.5)) 17 shape = asPoint((0.5, 0.5)) 18 srid = Point.geometry_column().type.srid 19 feature.geometry = WKBSpatialElement(buffer(shape.wkb), srid=srid) 20 feature.geometry.shape = shape 15 21 Session.add(feature) 16 22 Session.commit() … … 26 32 27 33 def test_index(self): 28 response = self.app.get(url _for(controller='points'))34 response = self.app.get(url(controller='points', action='index')) 29 35 assert response.response.content_type == 'application/json' 30 36 assert "FeatureCollection" in response 31 37 32 38 def test_index_bad_format(self): 33 response = self.app.get(url _for(controller='points', format='html'),39 response = self.app.get(url(controller='points', action='index', format='html'), 34 40 status=404) 35 41 36 42 def test_show(self): 37 response = self.app.get(url _for(controller='points', action='show', id=self.fid))43 response = self.app.get(url(controller='points', action='show', id=self.fid)) 38 44 assert response.response.content_type == 'application/json' 39 45 assert "Feature" in response 40 46 41 47 def test_show_bad_format(self): 42 response = self.app.get(url _for(controller='points', action='show', id=self.fid, format='html'),48 response = self.app.get(url(controller='points', action='show', id=self.fid, format='html'), 43 49 status=404) 44 50 45 51 def test_show_bad_id(self): 46 response = self.app.get(url _for(controller='points', action='show', id=-1),52 response = self.app.get(url(controller='points', action='show', id=-1), 47 53 status=404) 48 54 49 55 def test_create(self): 50 56 params = '{"type": "FeatureCollection", "features": [{"geometry": {"type": "Point", "coordinates": [0.0, 0.0]}, "type": "Feature", "properties": {"name": "bar"}, "id": null}]}' 51 response = self.app.post(url _for(controller='points', action='create'),57 response = self.app.post(url(controller='points', action='create'), 52 58 params=params, 53 59 headers={'Content-type': 'text/plain'}, … … 62 68 def test_update(self): 63 69 params = '{"geometry": {"type": "Point", "coordinates": [0.1, 0.1]}, "type": "Feature", "properties": {"name": "dude"}, "id": %d}' % self.fid 64 response = self.app.put(url _for(controller='points', action='update', id=self.fid),70 response = self.app.put(url(controller='points', action='update', id=self.fid), 65 71 params=params, 66 72 headers={'Content-type': 'text/plain'}, … … 72 78 def test_delete(self): 73 79 # code below triggers exception, nose bug it seems 74 #self.app.delete(url _for(controller='points', action='delete', id=self.fid),75 # status=204)80 #self.app.delete(url(controller='points', action='delete', id=self.fid), 81 # status=204) 76 82 pass 77 83 … … 79 85 80 86 def test_delete_bad_id(self): 81 response = self.app.delete(url _for(controller='points', action='delete', id=-1),87 response = self.app.delete(url(controller='points', action='delete', id=-1), 82 88 status=404) -
sample/trunk/mapfishsample/tests/functional/test_polygons.py
r1700 r3570 3 3 from mapfishsample.model.meta import Session 4 4 from mapfishsample.model.polygons import Polygon 5 6 from geoalchemy import WKBSpatialElement 7 5 8 from shapely.geometry import asPolygon 6 9 … … 12 15 feature = Polygon() 13 16 feature.name = "foo" 14 feature.geometry = asPolygon(((0.0, 0.0), (0.0, 1.0), (1.0, 1.0), (1.0, 0.0), (0.0, 0.0)), 15 [((0.5, 0.5), (0.5, 0.7), (0.7, 0.7), (0.7, 0.5), (0.5, 0.5))]) 17 shape = asPolygon(((0.0, 0.0), (0.0, 1.0), (1.0, 1.0), (1.0, 0.0), (0.0, 0.0)), 18 [((0.5, 0.5), (0.5, 0.7), (0.7, 0.7), (0.7, 0.5), (0.5, 0.5))]) 19 srid = Polygon.geometry_column().type.srid 20 feature.geometry = WKBSpatialElement(buffer(shape.wkb), srid=srid) 21 feature.geometry.shape = shape 16 22 Session.add(feature) 17 23 Session.commit() … … 27 33 28 34 def test_index(self): 29 response = self.app.get(url _for(controller='polygons'))35 response = self.app.get(url(controller='polygons', action='index')) 30 36 assert response.response.content_type == 'application/json' 31 37 assert "FeatureCollection" in response 32 38 33 39 def test_index_bad_format(self): 34 response = self.app.get(url _for(controller='polygons', format='html'),40 response = self.app.get(url(controller='polygons', action='index', format='html'), 35 41 status=404) 36 42 37 43 def test_show(self): 38 response = self.app.get(url _for(controller='polygons', action='show', id=self.fid))44 response = self.app.get(url(controller='polygons', action='show', id=self.fid)) 39 45 assert response.response.content_type == 'application/json' 40 46 assert "Feature" in response 41 47 42 48 def test_show_bad_format(self): 43 response = self.app.get(url _for(controller='polygons', action='show', id=self.fid, format='html'),49 response = self.app.get(url(controller='polygons', action='show', id=self.fid, format='html'), 44 50 status=404) 45 51 46 52 def test_show_bad_id(self): 47 response = self.app.get(url _for(controller='polygons', action='show', id=-1),53 response = self.app.get(url(controller='polygons', action='show', id=-1), 48 54 status=404) 49 55 50 56 def test_create(self): 51 57 params = '{"type": "FeatureCollection", "features": [{"geometry": {"type": "Polygon", "coordinates": [[[0.0, 0.0], [0.0, 1.0], [1.0, 1.0], [1.0, 0.0], [0.0, 0.0]], [[0.5, 0.5], [0.5, 0.7], [0.7, 0.7], [0.7, 0.5], [0.5, 0.5]]]}, "type": "Feature", "properties": {"name": "foo"}, "id": null}]}' 52 response = self.app.post(url _for(controller='polygons', action='create'),58 response = self.app.post(url(controller='polygons', action='create'), 53 59 params=params, 54 60 headers={'Content-type': 'text/plain'}, … … 63 69 def test_update(self): 64 70 params = '{"geometry": {"type": "Polygon", "coordinates": [[[0.0, 0.0], [0.0, 1.0], [1.0, 1.0], [1.0, 0.0], [0.0, 0.0]], [[0.5, 0.5], [0.5, 0.7], [0.7, 0.7], [0.7, 0.5], [0.5, 0.5]]]}, "type": "Feature", "properties": {"name": "foo"}, "id": %d}' % self.fid 65 response = self.app.put(url _for(controller='polygons', action='update', id=self.fid),71 response = self.app.put(url(controller='polygons', action='update', id=self.fid), 66 72 params=params, 67 73 headers={'Content-type': 'text/plain'}, … … 73 79 def test_update_bad_id(self): 74 80 params = '{"geometry": {"type": "Polygon", "coordinates": [[[0.0, 0.0], [0.0, 1.0], [1.0, 1.0], [1.0, 0.0], [0.0, 0.0]], [[0.5, 0.5], [0.5, 0.7], [0.7, 0.7], [0.7, 0.5], [0.5, 0.5]]]}, "type": "Feature", "properties": {"name": "foo"}, "id": %d}' % self.fid 75 response = self.app.put(url _for(controller='polygons', action='update', id=-1),81 response = self.app.put(url(controller='polygons', action='update', id=-1), 76 82 params=params, 77 83 headers={'Content-type': 'text/plain'}, … … 80 86 def test_delete(self): 81 87 # code below triggers exception, nose bug it seems 82 #response = self.app.delete(url _for(controller='polygons', action='delete', id=self.fid),88 #response = self.app.delete(url(controller='polygons', action='delete', id=self.fid), 83 89 # status=204) 84 90 pass 85 91 86 92 def test_delete_bad_id(self): 87 response = self.app.delete(url _for(controller='polygons', action='delete', id=-1),93 response = self.app.delete(url(controller='polygons', action='delete', id=-1), 88 94 status=404) 89 95 -
sample/trunk/mapfishsample/tests/functional/test_summits.py
r1700 r3570 4 4 class TestSummitsController(TestController): 5 5 def test_index(self): 6 response = self.app.get(url _for(controller='summits'))6 response = self.app.get(url(controller='summits', action='index')) 7 7 assert response.response.content_type == 'application/json' 8 8 assert "FeatureCollection" in response … … 11 11 # limit 12 12 params = {"limit": 10} 13 response = self.app.get(url _for(controller='summits'),13 response = self.app.get(url(controller='summits', action='index'), 14 14 params=params) 15 15 geojson = loads(response.response._body) … … 21 21 # limit & offset 22 22 params = {"limit": 10, "offset": 1} 23 response = self.app.get(url _for(controller='summits'),23 response = self.app.get(url(controller='summits', action='index'), 24 24 params=params) 25 25 geojson = loads(response.response._body) … … 30 30 def test_index_lonlat(self): 31 31 params = {"lon": 5, "lat": 45, "tolerance": 0.5} 32 response = self.app.get(url _for(controller='summits'),32 response = self.app.get(url(controller='summits', action='index'), 33 33 params=params) 34 34 geojson = loads(response.response._body) … … 41 41 def test_index_box(self): 42 42 params = {"box": "5,45,5.5,45.5"} 43 response = self.app.get(url _for(controller='summits'),43 response = self.app.get(url(controller='summits', action='index'), 44 44 params=params) 45 45 geojson = loads(response.response._body) … … 53 53 54 54 def test_index_min(self): 55 params = {"limit": 5, " min": 2000}56 response = self.app.get(url _for(controller='summits'),55 params = {"limit": 5, "queryable": "elevation", "elevation__gte": 2000} 56 response = self.app.get(url(controller='summits', action='index'), 57 57 params=params) 58 58 geojson = loads(response.response._body) … … 63 63 64 64 def test_index_max(self): 65 params = {"limit": 5, " max": 2000}66 response = self.app.get(url _for(controller='summits'),65 params = {"limit": 5, "queryable": "elevation", "elevation__lte": 2000} 66 response = self.app.get(url(controller='summits', action='index'), 67 67 params=params) 68 68 geojson = loads(response.response._body) -
sample/trunk/mapfishsample/websetup.py
r1592 r3570 3 3 4 4 from mapfishsample.config.environment import load_environment 5 from mapfishsample.model import meta 5 6 6 7 log = logging.getLogger(__name__) 7 8 8 9 def setup_app(command, conf, vars): 9 """Place any commands to setup mapfishsample here""" 10 """Place any commands to setup mapfishsample here 11 This method can be executed by calling: 12 13 paster setup-app development.ini [--name=main_pylons] 14 """ 10 15 load_environment(conf.global_conf, conf.local_conf) 11 16 12 # Load the models 13 from mapfishsample.model import meta 14 meta.metadata.bind = meta.engine 15 16 # 17 # No tables to create in our case 18 # 19 20 # Create the tables if they aren't there already 21 #meta.metadata.create_all(checkfirst=True) 17 # Create the tables for the editing example (if they aren't there already) 18 meta.metadata.create_all(bind=meta.engine) -
sample/trunk/setup.py
r3123 r3570 8 8 setup( 9 9 name='MapFishSample', 10 version=' 1.3dev',10 version='2.0dev', 11 11 description='', 12 12 author='', … … 14 14 #url='', 15 15 install_requires=[ 16 "mapfish>=1.3dev,<=1.3.99", 16 "mapfish>=2.0dev,<=2.0.99", 17 "GeoFormAlchemy>=0.1dev,<=0.1.99", 17 18 ], 18 setup_requires=["PasteScript==dev,>=1.6.3dev-r7326"],19 19 packages=find_packages(exclude=['ez_setup']), 20 20 include_package_data=True, … … 26 26 # ('public/**', 'ignore', None)]}, 27 27 zip_safe=False, 28 paster_plugins=['MapFish', 'PasteScript', 'Pylons'],29 28 entry_points=""" 30 29 [paste.app_factory] -
sample/trunk/test.ini.in
r1592 r3570 33 33 34 34 # SQLAlchemy database URL 35 sqlalchemy.url = %DB_URL%35 sqlalchemy.url = postgresql://${dbuser}:${dbpassword}@${dbhost}:${dbport}/${db} 36 36 37 37 # WARNING: *THE LINE BELOW MUST BE UNCOMMENTED ON A PRODUCTION ENVIRONMENT*
