Compare commits

..

4 Commits

Author SHA1 Message Date
Javier Villar
83219270ae Copying requirements.txt to python 0.4.2 folder 2016-10-07 16:47:28 +02:00
Javier Villar
215e61396a Creating requirements.txt file for python 2016-10-07 13:45:09 +02:00
Javier Goizueta
ecb4bd9606 Merge pull request #140 from CartoDB/138-fix-travis-tests
Reorder package installation
2016-09-30 11:40:44 +02:00
Javier Goizueta
ecc9814a88 Reorder package installation
Fixes #138
It seems that package postgresql-9.5-postgis-2.2 is now
indirectly depending on postgresql-9.5-postgis-2.3-scripts which
is not compatible with the packages in cartodb launchpad repos
2016-09-30 11:31:57 +02:00
4 changed files with 11 additions and 34 deletions

View File

@@ -41,8 +41,8 @@ before_install:
- sudo apt-get -y install postgresql-9.5=9.5.2-2ubuntu1
- sudo apt-get -y install postgresql-server-dev-9.5=9.5.2-2ubuntu1
- sudo apt-get -y install postgresql-plpython-9.5=9.5.2-2ubuntu1
- sudo apt-get -y install postgresql-9.5-postgis-2.2=2.2.2.0-cdb2
- sudo apt-get -y install postgresql-9.5-postgis-scripts=2.2.2.0-cdb2
- sudo apt-get -y install postgresql-9.5-postgis-2.2=2.2.2.0-cdb2
# configure it to accept local connections from postgres
- echo -e "# TYPE DATABASE USER ADDRESS METHOD \nlocal all postgres trust\nlocal all all trust\nhost all all 127.0.0.1/32 trust" \

View File

@@ -0,0 +1,5 @@
joblib==0.8.3
numpy==1.6.1
scipy==0.14.0
pysal==1.11.2
scikit-learn==0.14.1

View File

@@ -1,33 +0,0 @@
CREATE OR REPLACE FUNCTION CDB_WeightedMedianCenter(geoms geometry[], vals numeric[])
RETURNS geometry(Point, 4326)
AS $$
DECLARE
i INT;
median_val numeric;
median_index INT;
BEGIN
-- find the median value
SELECT percentile_disc(0.5) WITHIN GROUP (ORDER BY v) INTO median_val
FROM unnest(vals) As x(v);
-- find the index of the median value
FOR i in 1..array_length(vals, 1)
LOOP
IF vals[i] < median_val
THEN
median_index := i;
EXIT;
END IF;
END LOOP;
-- return the geometry that has the median value of the dataset
IF ST_GeometryType(geoms[median_index]) <> 'ST_Point'
THEN
RETURN ST_Centroid(geoms[median_index]);
ELSE
RETURN geoms[median_index];
END IF;
END;
$$ LANGUAGE plpgsql;

View File

@@ -0,0 +1,5 @@
joblib==0.8.3
numpy==1.6.1
scipy==0.14.0
pysal==1.11.2
scikit-learn==0.14.1