mapbox / mapbox-studio-classic

https://www.mapbox.com/mapbox-studio/
BSD 3-Clause "New" or "Revised" License
1.14k stars 229 forks source link

Mapbox Studio Classic, postgis-vt-util #1458

Closed wheredoesyourmindgo closed 9 years ago

wheredoesyourmindgo commented 9 years ago

After updating mapbox studio to 2.8, select layers can't seem to utilize the mapnik scale_denominator and bbox tokens, used in conjunction with postgis-vt-util. Something broke.

Postgis Plugin: ERROR:  column "scale_denominator" does not exist
LINE 1: ...T *  FROM mapbox.treated_lateral_evw_ms  WHERE Z(!scale_deno...
                                                         ^
in executeQuery Full sql was: 'SELECT ST_SRID("geom") AS srid FROM (    SELECT *    FROM     mapbox.treated_lateral_evw_ms  WHERE Z(!scale_denominator!) >= 14          AND Z(!scale_denominator!) <= 19        AND geom && !bbox! ) AS treated_lateral WHERE "geom" IS NOT NULL LIMIT 1;'
wilhelmberg commented 9 years ago

It worked for me with this SQL:

(SELECT 
    *
FROM
    world_merc
WHERE 
    Z(!scale_denominator!) >= 5
    AND Z(!scale_denominator!) <= 19
    AND geom && !bbox!
) AS data

Could you try updating postgis-vt-util and see if this helps?

wheredoesyourmindgo commented 9 years ago

I'm using the latest version of postgis-vt-util.sql. I'm only having this issue with certain layers. There are other layers in this datasource that use the same WHERE clause in conjunction with Z() and oddly they are working fine.

wilhelmberg commented 9 years ago

@springmeyer @flippmoke any ideas?

wheredoesyourmindgo commented 9 years ago

I'm going to close this ticket. After using Mapbox Studio Beta, I've concluded that the way forward for me would be to simply upload GeoJSON files to Mapbox, in lieu of using Mapbox Studio Classic and postgis-vt-util to accomplish this. So basically I will: psql ... -c '"select * from "some view that outputs a geojson featurecollection"' -o /tmp/layer1 psql ... -c '"select * from "another view that outputs a geojson featurecollection"' -o /tmp/layer2 tippecanoe -o /tmp/ouput.mbtiles /tmp/layer1 /tmp/layer2 mapbox-upload username.12345678 /tmp/output.mbtiles

The above seems to accomplish everything i was doing before, without compromise. The tippecanoe step optional for those wondering. Data sources uploaded using this approach seem compatible with Mapbox Studio Classic. Additionally, I can schedule all this using pgAgent or Cron.

wilhelmberg commented 9 years ago

Thanks for letting us know. Great choice: new Mapbox Studio will be the future of creating maps.

KoGor commented 8 years ago

Same problem. Postgis Plugin: ERROR: column "bbox" does not exist. Same source working fine in Mapbox Studio Classic v.0.2.7 (linux-x64), later versions up to 0.3.2 throw error. Upgrade to latest version of postgis-vt-util.sql did not help.