CartoDB / cartodb

Location Intelligence & Data Visualization tool
http://carto.com
BSD 3-Clause "New" or "Revised" License
2.75k stars 650 forks source link

Areas of Influence across date line #8344

Closed rohshar closed 6 years ago

rohshar commented 8 years ago

I am getting a weird visualization when I try to use the area of influence analysis on a specific earthquakes data set that can be found here: https://rodolfo8.cartodb.com/tables/earthquakes_cdbjs_lesson3/public/map

I am pretty sure it has something to do with errors across the international date line. Here is a screenshot:

screen shot 2016-06-29 at 5 26 24 pm

saleiva commented 8 years ago

Exactly, this is a known issue. I'm afraid this has not an easy way to fix but mentioning here @CartoDB/research just in case

andy-esch commented 8 years ago

Maybe we should add a verification step that

  1. checks whether any elements go below -180 or above +180
  2. if 1 is true, chops the geoms and re-pastes them together

I could see this being a general feature that a lot of analyses could use.

stuartlynn commented 8 years ago

There is a good example of this in the great circle function

https://github.com/CartoDB/cartodb-postgresql/blob/master/scripts-available/CDB_GreatCircle.sql#L17

 IF ST_XMax(line) - ST_XMin(line) > 180 THEN
    line = ST_Difference(
      ST_Shift_Longitude(line),
            ST_Buffer(ST_GeomFromText('LINESTRING(180 90, 180 -90)', 4326), 0.00001)
        );
  END IF;
stale[bot] commented 6 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

makella commented 6 years ago

we should keep open