Are /qs_tiles, and mapnik and djmapnik, necessary?

47 views
Skip to first unread message

Bob Troester

unread,
Mar 25, 2013, 12:58:25 AM3/25/13
to opentree...@googlegroups.com
In the 1.2 file OpenTreeMap/qs_tiles/views.py there are references to mapnik and djmapnik and MAPNIK_STYLESHEET but there is no reference to qs_tiles in the 1.2 code except in settings.py in the list of INSTALLED_APPS and in urls.py, and an inclusion in Josh Livni's variant OpenTreeMap code of a single obscure use of it in his static/js/SanDiego/map.js or in templates/SanFrancisco/base.html or in templates/Philadelphia/base.html. In 1.3 that line of code is moved to the "official" OpenTreeMap/templates/base.html.

Why is mapnik (or djmapnik) not in INSTALLED_APPS and why no definition of MAPNIK_STYLESHEET in a settings file? Is this dead code? If not, is it built into TileCache or into OpenStreetMap, as https://github.com/openstreetmap/mapnik-stylesheets seems to suggest? At the OpenTreeMap level, is any configuration required for it to do whatever it does?

For a geo-newby this is really obscure!

Adam Hinz

unread,
Mar 25, 2013, 1:00:01 AM3/25/13
to opentree...@googlegroups.com
As far as I know that's all dead code and can be ignored. A long lost version of OTM used Mapnik whereas the current one uses TileCache + GeoServer.

-Adam

--
You received this message because you are subscribed to the Google Groups "opentreemap-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to opentreemap-us...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Robert Cheetham

unread,
Mar 25, 2013, 9:25:54 AM3/25/13
to opentree...@googlegroups.com
Adam's right.  The original application that Azavea inherited included both GeoServer and Mapnik.  We removed the Mapnik dependency in order to simplify the system.  It is possible, however, that a future version may reintroduce Mapnik.

Robert


------------------
Robert Cheetham

Azavea  |  340 N 12th St, Ste 402, Philadelphia, PA
chee...@azavea.com  | T 215.701.7713  | F 215.925.2663
Web azavea.com  |  Blog azavea.com/blogs  |  Twitter @rcheetham  and @azavea
Azavea is a certified B Corporation - we apply geospatial technology to create better communities while advancing the state-of-the-art through research. Join us in creating a better world.

Bob Troester

unread,
Mar 25, 2013, 10:57:34 AM3/25/13
to opentree...@googlegroups.com
Adam and Robert,
Thank you very much for explaining that puzzle. The obvious next question is: are there any *other* chunks of dead code in the released 1.2 project that lie in wait to trip up the unwary newby - me?
Bob

Andrew Thompson

unread,
Mar 25, 2013, 12:15:25 PM3/25/13
to opentree...@googlegroups.com
Bob,

I'd highly recommend working with 1.3 instead of 1.2. We just put a bunch of fixes into 1.3 particularly around the default template that should make things easier.

-Andrew
Andrew Thompson, Community Evangelist

Azavea |  340 N 12th St, Ste 402, Philadelphia, PA
atho...@azavea.com  | T 215.701.7689  | F 215.925.2663
Web azavea.com  |  Blog azavea.com/blogs  | Twitter @azavea

Join our community! Google Groups:

Bob Troester

unread,
Mar 27, 2013, 3:16:29 PM3/27/13
to opentree...@googlegroups.com
Andrew,
Thank you very much. I decided to take your advice and move to 1.3 now, since it seems to be maybe on the verge of becoming the default release. I started with a clone from March 24 and found the process reasonably painless so far. I'll detail my steps here in case it may help someone else (and so you can double-guess me!).

I checked the new README.md and requirements.txt and found three seemingly new libraries not in 1.2, PIL, wsgiref, and yuicompressor, and a new Tilecache issue to fix. Even though I'm hoping to continue using dear old Apache, I also got your newly recommended gunicorn, just to see how it worked. There were some  changes in the required version, which probably didn't make any difference: django from 1.31. to 1.3.4, libgdal1 going from 1.7 *back* to 1.6.0 and a couple of others. (By the way, on my Ubuntu 12.04 system, yuicompressor installs in /usr/local/bin/yuicompressor, which is different from the path given in local_settings.example.py.)

Running 'xargs easy_install --verbose <requirements.txt' chugged through most of the library changes very quickly. I used 'yolk -l' after running through the Readme and found the version listed in the requirements to be 'active' - the old version of the library, if there was one, was also listed, as 'non-active'. The specified django-pipeline showed the specified version 1.1.27 as non-active, and a new, not-specified version, 1.3.3, as the active one. I'm ignorant still about inner workings of things pythonic, but I assume I can remove the 'non-active' version at some point(?)

I updated my local_settings.py file per the local_settings.example.py, moved my wsgi-scripts file and the templates/Montpelier template-set (modified somewhat from Josh Livni's templates/SanDiego) back in place, and, without touching anything else, tried firing it up.

There was an immediate complaint about a missing CHOICES entry for a 'pests' category, which I added to my choices.py file. Then postgresql_psycopg2/base.py complained of a database error that column treemap_tree_audit.url was missing. Which indeed it was, but a quick 'python manage.py syncdb' & 'python manage.py migrate fixed that. A look with pgadmin3 showed both the url and pests fields now in that table.

As was discussed somewhere earlier, the very useful jlivni templates/Cityname/treemap/x.html all try to load 'maths', which can be found in Josh's repository treemap/templatetags directory. Evidently the use of a math tag is supposed to be avoided, but in the meantime it's necessary to get running.

After that, even before putting Josh's css and js and images back in static/, OTM began serving up pages. Running 'python manage.py -v 2 collectstatic' (lots of output - I save all that with 'script' in case there's a problem) got the admin interface looking good again.

I had cloned 1.3 , as I said, 3/24, but you made a commit 3/26, so that gave me the opportunity as a git-newby to try out git fetch and git merge for the first time. As a crutch, I installed gitk for its pretty gui.

So I still haven't displayed a map yet, but I'm getting close, maybe.
Bob

Bob Troester

unread,
Mar 27, 2013, 4:48:57 PM3/27/13
to opentree...@googlegroups.com
One more thing...
I just realized that the patch 'Fix Tilecache TMS Issue' in 1.3 README.md is confusing, at least I am confused. On my Ubuntu 12.04 box,if I look at /usr/local/lib/python2.7/dist-packages/TileCache-2.11-py2.7.egg/TileCache/Services/TMS.py, how is the line
'parts = parts[-5:]' supposed to be indented? (I assume the '+ ' before that text is an artifact of a diff program.) The logic is obscure enough (to me) that I can't be sure. It seems to be resetting a list to a slice of that list for some obscure reason, but the indentation is wrong - it should be the same as the 'layer = self.....' code directly below it. Am I right?
TIA,
Bob
Reply all
Reply to author
Forward
0 new messages