Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using Mapnik 2.0.1rc0 on a Windows 7 with python 2.7 32bits inside a GeoDjango App. I often got this error: fatal flex scanner internal error--end of buffer missed that makes python to crash (sometimes python crash without error message) when zooming in and out of mapnik tiles rendered in OpenLayers map. The tiled data are stored in spatialite 4.0.

I know such setup could provide a lot of source for this crash. Anybody has encountered this error before or may know where to look to make it works without crashing?


GeoDjango is used as a Tile Map Server. I start by creating the xml in python then I use mapnik python bindings to generate the tiles. The data is already stored in spatialite. So each time I zoom in and out in the map, mapnik query spatialite like this:

    query = '(select ' + geometryField + ', "id" from "shapefile_feature" where' + ' shapefile_id=' + str( + ') as geom'
    datasource = mapnik.SQLite(file='C:\mygeosite\sqlite3\sql3.db',
share|improve this question
That message is coming from libspatialite (one of the parsers - WKT, JSON, GML, KML, etc). It isn't clear to me how this could happen without understanding what you're doing in GeoDjango. – BradHards Apr 12 '13 at 11:06
The question was edited... I hope its clear enought – Below the Radar Apr 12 '13 at 14:20
Its difficult to know, but I'm guessing you've got a bad build - perhaps the versions of spatialite / sqlite don't match with what django is providing. Do you have more than one sqlite3.dll on your system? – BradHards Apr 12 '13 at 23:33

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.