CartoDB / camshaft

Analysis library to create data views from queries
BSD 3-Clause "New" or "Revised" License
17 stars 7 forks source link

Join analysis failing with country data #134

Open saleiva opened 8 years ago

saleiva commented 8 years ago

that's the error I get when trying to do a join between a table with country names and a few columns more and the world countries dataset from the Data library.

{"errors":["Postgis Plugin: ERROR: transform: couldn't project point (180 -90 0): tolerance condition error (-20)\n\nin executeQuery Full sql was: 'SELECT ST_AsTWKB(ST_Simplify(ST_RemoveRepeatedPoints(\"the_geom_webmercator\",1e-05),1e-05,true),5) AS geom FROM (SELECT ST_Transform(the_geom, 3857) the_geom_webmercator, titulo_seminario, sector, mercado, country, accesos, right_iso_a3\nFROM (SELECT _cdb_analysis_right_source.the_geom as the_geom, _cdb_analysis_left_source.titulo_seminario, _cdb_analysis_left_source.sector, _cdb_analysis_left_source.mercado, _cdb_analysis_left_source.country, _cdb_analysis_left_source.accesos, _cdb_analysis_right_source.iso_a3 as right_iso_a3\nFROM\n (SELECT * FROM table_sheet1) AS _cdb_analysis_left_source\n INNER JOIN\n (SELECT * FROM world_countries) AS _cdb_analysis_right_source\nON _cdb_analysis_left_source.country = _cdb_analysis_right_source.name) _cdb_analysis_query) as cdbq WHERE \"the_geom_webmercator\" && ST_MakeEnvelope(-20037508.3,20037508.25881302,-20037508.25881302,20037508.3,3857)'\n"],"errors_with_context":[{"type":"unknown","message":"Postgis Plugin: ERROR: transform: couldn't project point (180 -90 0): tolerance condition error (-20)\n\nin executeQuery Full sql was: 'SELECT ST_AsTWKB(ST_Simplify(ST_RemoveRepeatedPoints(\"the_geom_webmercator\",1e-05),1e-05,true),5) AS geom FROM (SELECT ST_Transform(the_geom, 3857) the_geom_webmercator, titulo_seminario, sector, mercado, country, accesos, right_iso_a3\nFROM (SELECT _cdb_analysis_right_source.the_geom as the_geom, _cdb_analysis_left_source.titulo_seminario, _cdb_analysis_left_source.sector, _cdb_analysis_left_source.mercado, _cdb_analysis_left_source.country, _cdb_analysis_left_source.accesos, _cdb_analysis_right_source.iso_a3 as right_iso_a3\nFROM\n (SELECT * FROM table_sheet1) AS _cdb_analysis_left_source\n INNER JOIN\n (SELECT * FROM world_countries) AS _cdb_analysis_right_source\nON _cdb_analysis_left_source.country = _cdb_analysis_right_source.name) _cdb_analysis_query) as cdbq WHERE \"the_geom_webmercator\" && ST_MakeEnvelope(-20037508.3,20037508.25881302,-20037508.25881302,20037508.3,3857)'\n"}]}

dgaubert commented 8 years ago

I've just talked with @rochoa and this is a known issue. One of those datasets (I bet for world_countries) has a geometry in Antarctica (180 -90 0) that rises an exception using 3857 SRID. That could be resolved applying cartodbfy function to the result of the analysis. By the way, there are questions that we have to put on the table because cartodbfycation has some implications.

rochoa commented 7 years ago

This requires #200 to be fixed.