On Sat, Dec 26, 2009 at 1:02 PM, Todd Blanchard <tblan...@mac.com> wrote:
> Trying to get through the MapFish tutorial. Lots of details are left out.
> First - how does one create the database and load the data? I can create an
> empty postgis db - but not one containing a table called world_fb that has
> country boundaries. I cannot find how to do that despite extensive
> searching.
I guess you are right. We should have a section showing how to load sample data.
> I was able to find what I think is the basis for this example in loading
> data from
> wget http://aprsworld.net/gisdata/world/world.zip unzip world.zip shp2pgsql
> world.shp world gisdb > world.sql psql -d gisdb < world.sql
> so tweaking the layers.ini file for table name seems OK - but starting the
> server and trying to see the JSON, I get errors about no type "geometry".
> So I ez_install geoalchemy and now it chugs for a bit, fails to deliver a
> page, and logs nothing useful.
> 23:16:28,942 INFO [sqlalchemy.engine.base.Engine.0x...3910] BEGIN
> 23:16:28,943 INFO [sqlalchemy.engine.base.Engine.0x...3910] SELECT
> world.gid AS world_gid, world.name AS world_name, world.capital AS
> world_capital, world.approx AS world_approx, world.area AS world_area,
> world.sourcethm AS world_sourcethm, world.the_geom AS world_the_geom
> FROM world
> 23:16:28,943 INFO [sqlalchemy.engine.base.Engine.0x...3910] {}
> 23:16:42,653 INFO [tg.i18n] Language ['en-us']: not supported
> 23:16:42,653 INFO [tg.i18n] Language ['en-us']: not supported by FormEncode
I downloaded the same data and followed up to "displaying as json".
It worked for me on tg2.0.3. You could also have a look at the video
here http://vimeo.com/4135185 . Although, it is windows specific, but
may still be of some help.
> Then in the section Displaying the Vector Data as a Layer in an OpenLayers
> Map
> It is not at all clear what files one should edit to add the code. As a TG2
> noob, I can't figure this out at all.
> Any help moving past these issues would be appreciated.
This example uses toscawidgets for creating the map (tw.openlayers).
You could first start with a simple plain javascript example. Start with
the example at http://openlayers.org/dev/examples/gml-layer.html and
change this line
map.addLayer(new OpenLayers.Layer.GML("GML", "gml/polygon.xml"));
to
map.addLayer(new OpenLayers.Layer.GML("GML", "/countries", {format:
OpenLayers.Format.GeoJSON}));
For using tw.openlayers example as given in the tutorial define the
widgets in controlers/root.py
and then stick it to the tmpl_context in a method inside RootController class.
I could send you the source code for the working app if you want.
regards
Sanjiv
> -Todd Blanchard
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "TurboGears" group.
> To post to this group, send email to turbo...@googlegroups.com.
> To unsubscribe from this group, send email to
> turbogears+...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/turbogears?hl=en.
>
I downloaded the same data and followed up to "displaying as json".
It worked for me on tg2.0.3. You could also have a look at the video
here http://vimeo.com/4135185 . Although, it is windows specific, but
may still be of some help.
It's not an error, it's an info-level logging statement. Nothing to
worry about.
Do you really have the postgis-extensions installed? The error with "no
type geometry" looks somewhat suspicious.
Diez
setuptools-0.6c9-py2.6.egg
tg.devtools-2.0.2-py2.6.egg
repoze.who-1.0.15-py2.6.egg
repoze.what_quickstart-1.0-py2.6.egg
sqlalchemy_migrate-0.5.2-py2.6.egg
TurboGears2-2.0.3-py2.6.egg
zope.interface-3.4.1-py2.6-linux-i686.egg
Paste-1.7.2-py2.6.egg
repoze.who_friendlyform-1.0b3-py2.6.egg
repoze.what.plugins.sql-1.0rc1-py2.6.egg
repoze.who.plugins.sa-1.0rc1-py2.6.egg
repoze.what-1.0.8-py2.6.egg
TurboJson-1.2.1-py2.6.egg
repoze.tm2-1.0a4-py2.6.egg
repoze.what_pylons-1.0rc3-py2.6.egg
WebError-0.10.1-py2.6.egg
WebFlash-0.1a9-py2.6.egg
Genshi-0.5.1-py2.6-linux-i686.egg
Pylons-0.9.7-py2.6.egg
repoze.who_testutil-1.0rc1-py2.6.egg
prioritized_methods-0.2.1-py2.6.egg
simplejson-2.0.8-py2.6-linux-i686.egg
PEAK_Rules-0.5a1.dev_r2582-py2.6.egg
transaction-1.0a1-py2.6.egg
decorator-3.0.0-py2.6.egg
Pygments-1.0-py2.6.egg
Tempita-0.2-py2.6.egg
WebOb-0.9.6.1-py2.6.egg
WebTest-1.1-py2.6.egg
Mako-0.2.4-py2.6.egg
nose-0.10.4-py2.6.egg
FormEncode-1.2.1-py2.6.egg
PasteScript-1.7.3-py2.6.egg
PasteDeploy-1.3.3-py2.6.egg
Beaker-1.3-py2.6.egg
WebHelpers-0.6.4-py2.6.egg
Routes-1.10.3-py2.6.egg
Extremes-1.1-py2.6.egg
AddOns-0.6-py2.6.egg
DecoratorTools-1.7-py2.6.egg
BytecodeAssembler-0.3-py2.6.egg
SymbolType-1.0-py2.6.egg
zope.sqlalchemy-0.4-py2.6.egg
ToscaWidgets-0.9.7.2-py2.6.egg
Babel-0.9.4-py2.6.egg
Catwalk-2.0.2-py2.6.egg
tgext.admin-0.2.6-py2.6.egg
sprox-0.6.4-py2.6.egg
tgext.crud-0.2.4-py2.6.egg
tw.forms-0.9.7.2-py2.6.egg
MapFish-1.1
geojson-1.0.1-py2.6.egg
Shapely-1.0.12-py2.6.egg
TileCache
featureserver
tgext.geo
Sphinx-0.6.2-py2.6.egg
docutils-0.5-py2.6.egg
Jinja2-2.1.1-py2.6-linux-i686.egg
egenix_mx_base-3.1.1-py2.6-linux-i686.egg
static-0.4-py2.6.egg
pydot-1.0.2-py2.6.egg
pyparsing-1.5.2-py2.6.egg
flexirest-0.8-py2.6.egg
GDAL-1.6.1-py2.6-linux-i686.egg
xmpppy-0.5.0rc1-py2.6.egg
SQLAlchemy-0.5.6-py2.6.egg
TGScheduler-1.5-py2.6.egg
BeautifulSoup-3.1.0.1-py2.6.egg
pyephem-3.7.3.4-py2.6-linux-i686.egg
GeoAlchemy-0.1-py2.6.egg
Packages with version no are in trunk version
HTH
Sanjiv
BTW, GeoAlchemy is not required by MapFish. It is required only if you
want to use FeatureServer with tgext.geo
Sanjiv
>
> On Dec 26, 2009, at 7:07 AM, Diez B. Roggisch wrote:
>
>> Do you really have the postgis-extensions installed? The error with "no
>> type geometry" looks somewhat suspicious.
>
Any tips on how I might debug a page that simply never gets served?
No errors reported....kind of worrying if there is no way to diagnose this.
The Error Middleware is there for this purpose but I wonder why that is silent.
You could try using a debugger or just put lots of print statements everywhere,
including inside the mapfish controller code, to see whats going on.
Also, try putting a ?maxfeatures=1 params at the end of the url and see
if the LIMIT clause shows up in the SQL. I found my browser kind of
saturated without that param
regards
Sanjiv