Output from views_geojson cannot be read by Tilemill. As per https://github.com/mapbox/tilemill/issues/848 we must create a file with a .geojson extension or it will not be recognized by mapnik.

Nevertheless, when I enter the URL for my geojson: http://dev.fga-directory.gotpantheon.com/v1/occupations/occupy-directory...
under "FIle" in my Tilemill layer, I still get:

"OGR Plugin: Failed to read GeoJSON data"

Comments

jeffschuler’s picture

Hmm. I just tried and had no issues adding a layer of views_geojson-exported data to Tilemill.

Where is your data coming from (what's the source you're using in the view's Format settings? GeoField?) Is it a float before it gets to Views GeoJSON? I'm seeing my lat/lon exported in the geojson file as floats.

andrew_mallis’s picture

Issue summary: View changes

correct, public URL of json

andrew_mallis’s picture

It seems as though Tilemill is very specific about escaped characters and encoded entities.

Removing a rendered link and using the absolute URL value instead cleared up this issue for me.

We should document in some manner what does and does not work, though.

jeffschuler’s picture

Tilemill, (or more specifically, OGR,) does not seem to like escaped Unicode characters in GeoJSON layers. I've opened an issue in Tilemill's queue for that.

Let's see where that goes, but as far as I can see, we're producing standard-compliant JSON and don't need to change anything. Folks importing GeoJSON into Tilemill will need to strip HTML from their fields until that gets fixed. I think this issue serves as sufficient documentation.

jeffschuler’s picture

As pointed out in the Github Tilemill issue, the problem is only with escaped Unicode chars with uppercase hex digits in them.

Here's a patch to temporarily hack D7 core to encode escaped Unicode chars using lowercase hex -- until this is fixed in GDAL and TileMill.

Again, this is a patch to Drupal 7.14 core, not to Views_GeoJSON.

jeffschuler’s picture

Status: Active » Postponed

Patch core, strip HTML, or wait for GDAL + TileMill fix.

jeffschuler’s picture

There's a new proposed approach for Tilemill GeoJSON parsing, since json-c in GDAL is going to take some time, and Mapnik has a new parser that Tilemill can leverage...

jeffschuler’s picture

Issue summary: View changes

issue isn't related to floats.

pol’s picture

Issue summary: View changes
Status: Postponed » Fixed

I guess I can close this now.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.