How to do it...

  1. To prepare the data for Mapbox's GeoJSON format, export the table tracks from Chapter 3Working with Vector Data – The Basics using ogr2ogr with the following code:
      ogr2ogr -f GeoJSON tracks.json \      "PG:host=localhost dbname=postgis_cookbook user=me" \      -sql "select * from chp03.tracks
  1. Remove the crs definition line on the new .json with your favorite editor:
  1. Go to your Mapbox account and upload in the Datasets menu the tracks.json file. After a successful upload, you will see the following message:
  1. Create the dataset ...

Get PostGIS Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.