Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interpolate DA from CD in Canada #528

Merged
merged 3 commits into from
Jul 12, 2018
Merged

Interpolate DA from CD in Canada #528

merged 3 commits into from
Jul 12, 2018

Conversation

ethervoid
Copy link
Contributor

@ethervoid ethervoid commented Jul 11, 2018

Taking into account the unsolved bug in #527 this works for the 99% 100% of the tables

if colname != 'geo_code':
in_colnames.append('({colname} * (ST_Area(da.the_geom)/ST_Area(cd.the_geom))) {colname}'.format(colname=colname))

insert_query = '''

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

multiple spaces after operator

in_colnames = ['da.geom_id']
for colname in out_colnames:
if colname != 'geo_code':
in_colnames.append('({colname} * (ST_Area(da.the_geom)/ST_Area(cd.the_geom))) {colname}'.format(colname=colname))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line too long (129 > 120 characters)

@@ -1,5 +1,6 @@
import os
import urllib.request
import time

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'time' imported but unused

if colname != 'geo_code':
# We reduce the number of decimals to reduce the size of the row to avoid hit
# the limit which is 8Kb. More info https://github.com/CartoDB/bigmetadata/issues/527
in_colnames.append('round(cast(float8 ({colname} * (ST_Area(da.the_geom)/ST_Area(cd.the_geom))) as numeric), 2) {colname}'.format(colname=colname))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line too long (163 > 120 characters)

if colname != 'geo_code':
# We reduce the number of decimals to reduce the size of the row to avoid hit
# the limit which is 8Kb. More info https://github.com/CartoDB/bigmetadata/issues/527
in_colnames.append('round(cast(float8 ({colname} * (ST_Area(da.the_geom)/ST_Area(cd.the_geom))) as numeric), 2) {colname}'.format(colname=colname))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line too long (163 > 120 characters)

@antoniocarlon antoniocarlon self-assigned this Jul 12, 2018
Copy link
Contributor

@antoniocarlon antoniocarlon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ethervoid ethervoid merged commit 7ad904f into master Jul 12, 2018
@ethervoid ethervoid deleted the interpolate_ca branch July 12, 2018 08:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants