Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I am having some weird output by the UTF grid provider in Tilestache on specific shapefiles; Specifically shapefiles reprojected from Census TIGER files. I know my server is configured correctly because one of my grid layers is working perfectly, which is using a shapefile which did not come from TIGER data.

The weird grid looks like this.

{"keys": ["6", "5"], "data": {"5": {"DIVISION": "9", "INTPTLAT": "+37.1551773", "STATENS": "01779778", "NAME": "California", "STUSPS": "CA", "LSAD": "00", "INTPTLON": "-119.5434183", "FUNCSTAT": "A", "AWATER": -2147483648, "REGION": "4", "MTFCC": "G4000", "GEOID": "06", "STATEFP": "06", "ALAND": -2147483648}, "6": {"DIVISION": "8", "INTPTLAT": "+34.2039240", "STATENS": "01779777", "NAME": "Arizona", "STUSPS": "AZ", "LSAD": "00", "INTPTLON": "-111.6064072", "FUNCSTAT": "A", "AWATER": 1026196456, "REGION": "4", "MTFCC": "G4000", "GEOID": "04", "STATEFP": "04", "ALAND": -2147483648}}, "grid": ["                                               \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\udb6a\udf1f\ud929\udc96\uda63\udf00\u7f8d\udad2\udeb8\u7f8d", "                                               9/138/212.json.\u0000\u0000", "                                               9/138/212.json.\u0000\u0000", "                                               9/138/212.json.\u0000\u0000", "                                               9/138/212.json.\u0000\u0000", "                                               9/138/212.json.\u0000\u0000", "                                               9/138/212.json.\u0000\u0000", "                                               9/138/212.json.\u0000\u0000", "                                               9/138/212.json.\u0000\u0000", "                                               9/138/212.json.\u0000\u0000", "                                               9/138/212.json.\u0000\u0000", "                                               9/138/212.json.\u0000\u0000", "                                               9/138/212.json.\u0000\u0000", "                                               9/138/212.json.\u0000\u0000", "                                               9/138/212.json.\u0000\u0000", "                                               9/138/212.json.\u0000\u0000", "                                               9/138/212.json.\u0000\u0000", "                                               9/138/212.json.\u0000\u0000", "                                               9/138/212.json.\u0000\u0000", "                                               9/138/212.json.\u0000\u0000", "                                               9/138/212.json.\u0000\u0000", "                                               9/138/212.json.\u0000\u0000", "                                               9/138/212.json.\u0000\u0000", "                                               9/138/212.json.\u0000\u0000", "                                               9/138/212.json.\u0000\u0000", "                                               9/138/212.json.\u0000\u0000", "                                               9/138/212.json.\u0000\u0000", "                                               9/138/212.json.\u0000\u0000", "                                               9/138/212.json.\u0000\u0000", "                                               9/138/212.json.\u0000\u0000", "                                               9/138/212.json.\u0000\u0000", "                                               9/138/212.json.\u0000\u0000", "                                               9/138/212.json.\u0000\u0000", "                                               9/138/212.json.\u0000\u0000", "                                               9/138/212.json.\u0000\u0000", "                                               9/138/212.json.\u0000\u0000", "                                               9/138/212.json.\u0000\u0000", "                                               9/138/212.json.\u0000\u0000", "                                               9/138/212.json.\u0000\u0000", "                                               9/138/212.json.\u0000\u0000", "                                               9/138/212.json.\u0000\u0000", "                                               9/138/212.json.\u0000\u0000", "                                               9/138/212.json.\u0000\u0000", "                                               9/138/212.json.\u0000\u0000", "                                               9/138/212.json.\u0000\u0000", "                                               9/138/212.json.\u0000\u0000", "                                               9/138/212.json.\u0000\u0000", "                                               9/138/212.json.\u0000\u0000", "                                               9/138/212.json.\u0000\u0000", "                                               9/138/212.json.\u0000\u0000", "                                               9/138/212.json.\u0000\u0000", "                                               9/138/212.json.\u0000\u0000", "                                               9/138/212.json.\u0000\u0000", "                                               9/138/212.json.\u0000\u0000", "                                               9/138/212.json.\u0000\u0000", "                                               9/138/212.json.\u0000\u0000", "                                               9/138/212.json.\u0000\u0000", "                                               9/138/212.json.\u0000\u0000", "                                               9/138/212.json.\u0000\u0000", "                                    !!!!!!!!!!!!!!!!!212.json.\u0000\u0000", "                                   !!!!!!!!!!!!!!!!!!212.json.\u0000\u0000", "                                 !!!!!!!!!!!!!!!!!!!!212.json.\u0000\u0000", "                                !!!!!!!!!!!!!!!!!!!!!212.json.\u0000\u0000", "                               !!!!!!!!!!!!!!!!!!!!!!212.json.\u0000\u0000"]}

Notice the "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000" and "!212.json.\u0000\u0000". Totally weird.

I think this must have something to do with the shapefiles. However, when I compare a shapefile that works fine with a shapefile that does not the projection is the same. Does anyone have any ideas what else could cause the grid to be incorrect?

To convert the TIGER files I used: ogr2ogr -f "ESRI Shapefile" -nlt POLYGON -t_srs EPSG:900913 us-states.shp tl_2011_us_state.shp

+proj=merc +lon_0=0 +lat_ts=0 +x_0=0 +y_0=0 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs

Is the projection for both files.

Update: Every time I clear the cache and refresh the page on a single tile the UTF Grid changes.

Here is a screenshot of one of the tiles. Notice that there are no keys or data but utf information. enter image description here

Thanks!

share|improve this question

1 Answer 1

I had the same problem. Almost drove me crazy - documentation is a bit scarce and I started to look in the sources.

Turned out to be a bug in the mapnik library (installed from some Ubuntu PPA). After cloning the git repository and building everything from source, it is working fine now.

Note that the UTFGrid spec has provisions to avoid the character "\u0000", so if you are seeing it in the resulting json, it smells like a buggy mapnik install.

share|improve this answer

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.