1

I noticed that the URL of CartoDB visualizations include the parameter sql= with the SQL statement for that visualization:

http://lifewatch-inbo.cartodb.com/viz/b43fa5a6-7dd0-11e3-ba2a-5f9e077d1162/embed_map?title=true&description=true&search=false&shareable=true&cartodb_logo=true&layer_selector=false&legends=true&scrollwheel=true&sublayer_options=1&sql=SELECT%20%0AST_MakeLine(the_geom_webmercator%20ORDER%20BY%20date_time%20ASC)%20AS%20the_geom_webmercator,%20%0ACASE%0AWHEN%20date_time%20%3E%3D%20'2013-05-28'%20AND%20date_time%20%3C%20'2013-06-25'%20THEN%20'1.%20Egg%20incubation'%0AWHEN%20date_time%20%3E%3D%20'2013-06-25'%20AND%20date_time%20%3C%20'2013-07-24'%20THEN%20'2.%20Chick%20rearing'%0AELSE%20'3.%20Postfledging'%0AEND%20as%20behaviour%0AFROM%20three_gulls%0AWHERE%20bird_name%20%3D%20'Eric'%0AAND%20outlier%20IS%20NULL%0AGROUP%20BY%20behaviour%0AORDER%20BY%20behaviour&sw_lat=50.790527850939384&sw_lon=2.2449874877929688&ne_lat=51.76975203254081&ne_lon=5.587577819824219

However, these parameter seems optional, as the visualization works fine without the parameter:

http://lifewatch-inbo.cartodb.com/viz/b43fa5a6-7dd0-11e3-ba2a-5f9e077d1162/embed_map?title=true&description=true&search=false&shareable=true&cartodb_logo=true&layer_selector=false&legends=true&scrollwheel=true&sublayer_options=1&sw_lat=50.790527850939384&sw_lon=2.2449874877929688&ne_lat=51.76975203254081&ne_lon=5.587577819824219

Changing the SQL on CartoDB will update the existing visualization and render the value of SQL= outdated, so I was wondering why it is included at all?

2 Answers 2

1

It's outdated, it was used in the previous version of cartodb. The SQL is not included in the viz.json which is fetch when the embed_map is loaded

2
  • Are there plans to remove the parameter from the "Publish" functionality in CartoDB? Commented Jan 22, 2014 at 15:31
  • I will add it as a ticket right now Commented Jan 24, 2014 at 7:59
0

Imagine you want to display 3 different states of the same visualization. Then you can embed the same code and use the same visualization but you just change that parameter. Does that make sense?

1
  • But it seems the SQL parameter is ignored, so it would just show the same visualizations 3 times, or not? Commented Jan 22, 2014 at 15:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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