Closed sidkshatriya closed 12 years ago
Hi Sidhart,
You can use simple API KEY authentication(much simpler) or oAuth http://developers.cartodb.com/documentation/cartodb-apis.html#authentication
Although if you don't wanna expose your api key to the public, I really recommend you to develop a really small proxy.
Cheers, S.
On Jun 5, 2012, at 8:13 PM, Sidharth Kshatriya wrote:
How do I call private tables using this library?
Reply to this email directly or view it on GitHub: https://github.com/Vizzuality/cartodb-gmapsv3/issues/28
Well, there is a bit of dicussion on this topic. We dont easily allow the access of tiles on private tables. The reason for it is that you might well consider that if a table is private then it should not be possible to visualize it on Google Maps, which requires to have the maps openly available.
Like Sergio said the only way to do this is by setting up a proxy that query to cartodb using the API key secretely (using https!) and then return the tiles.
That means that you cant really make use of this library, as it is not prepared for that.
So, in general, this library only works with public tables. What is you exact use case?
@jattorre @saleiva Thanks for your responses.
We have some geographic territories stored in a particular table (lets call it table 1). In another table also stored on cartodb (table 2) we store which person(s) are assigned to a particular geographic territory. We will be creating JOINs between table 1 and table 2 and visualizing the result.
To make this concrete:
Table 1 columns: the_geom, territory_code
table_1 is probably going to be ~40,000 rows
Table 2 columns: territory_code, person_assigned
More 1 person can be assigned to a territory. People could have hundreds of territories assigned to them.
So visualizing the territories assigned to person 33 would be some thing like:
SELECT the_geom_webmercator FROM table_1 JOIN on table_1.territory_code = table_2.territory_code WHERE table_2.person_assigned = 33;
The data in table 2 is sensitive and should be private. Hence the request for allowing tiles from a JOIN that takes place between a private table and a public table.
One alternative is to store table 1 as a public cartodb table and table 2 on our own db server. But the problem is that there are literally thousands of territories and we would have to do some thing like this:
(On our server) SELECT territory_code FROM table_2 WHERE person_assigned = 33;
We may get a huge list of territory codes (maybe even 1000). Then we create a string of all territories separated by commas e.g.
territory_list_string = "345, 234, 234, 221, 1009, 7761, .... "
Now we issue a mapping request on cartodb
SELECT the_geom_webmercator FROM table_1 WHERE territory_code IN(" + territory_list_string + ");
This is not too efficient is it? Its probably better to store table_2 also on cartodb, right?
I'm guessing this is reasonably common customer use case. Yes, creating a proxy will work but its more complicated. Any suggestions? Is a simpler way to achieve all this?
(BTW I'm currently on a John Snow account. Tell me if this question should be also pasted on Support).
BTW cartodb rocks! I had been running into all kinds of limitations on Google Fusion Tables. So far its been awesome with Cartodb!
Also please note that while table_1 will not change, table_2 will keep changing. New people will be be assigned territories while other people may have their territories changed. We want to make a dynamic application which involves visualizing a map based on a JOIN between table_1 and table_2.
The updates to table_2 will be server side PHP (So we can use your PHP library). But visualizing the results of the JOIN (in order to get the tiles) will happen client side on browser.
Hii,
Please can you send this request to the mailing list, I will be happy to answer there and help other users. But you can always contact support@cartodb.com
The mailing list is in here
https://groups.google.com/forum/#!forum/cartodb
If you post it there i will answer immediately. This is a better place than github.
Thanks.
On Jun 6, 2012, at 6:19 AM, Sidharth Kshatriya wrote:
Also please note that while table_1 will not change, table_2 will keep changing. New people will be be assigned territories while other people may have their territories changed. We want to make a dynamic application which involves visualizing a map based on a JOIN between table_1 and table_2.
The updates to table_2 will be server side PHP (So we can use your PHP library). But visualizing the results of the JOIN (in order to get the tiles) will happen client side on browser.
Reply to this email directly or view it on GitHub: https://github.com/Vizzuality/cartodb-gmapsv3/issues/28#issuecomment-6147175
How do I call private tables using this library?