syntax fixes / function name fix

pull/193/head
Andy Eschbacher 7 years ago
parent e28f00d98b
commit 92becac280

@ -37,7 +37,9 @@ SELECT
aoi.quads,
aoi.significance,
c.num_cyclists_per_total_population
FROM cdb_crankshaft.CDB_AreasOfInterestLocal('SELECT * FROM commute_data'
FROM
cdb_crankshaft.CDB_AreasOfInterestLocal(
'SELECT * FROM commute_data'
'num_cyclists_per_total_population') As aoi
JOIN commute_data As c
ON c.cartodb_id = aoi.rowid;
@ -71,8 +73,12 @@ A table with the following columns.
#### Examples
```sql
SELECT *
FROM cdb_crankshaft.CDB_AreasOfInterestGlobal('SELECT * FROM commute_data', 'num_cyclists_per_total_population')
SELECT
*
FROM
cdb_crankshaft.CDB_AreasOfInterestGlobal(
'SELECT * FROM commute_data',
'num_cyclists_per_total_population')
```
### CDB_AreasOfInterestLocalRate(subquery text, numerator_column text, denominator_column text)
@ -113,7 +119,9 @@ SELECT
aoi.quads,
aoi.significance,
c.cyclists_per_total_population
FROM cdb_crankshaft.CDB_AreasOfInterestLocalRate('SELECT * FROM commute_data'
FROM
cdb_crankshaft.CDB_AreasOfInterestLocalRate(
'SELECT * FROM commute_data'
'num_cyclists',
'total_population') As aoi
JOIN commute_data As c
@ -149,8 +157,11 @@ A table with the following columns.
#### Examples
```sql
SELECT *
FROM cdb_crankshaft.CDB_AreasOfInterestGlobalRate('SELECT * FROM commute_data',
SELECT
*
FROM
cdb_crankshaft.CDB_AreasOfInterestGlobalRate(
'SELECT * FROM commute_data',
'num_cyclists',
'total_population')
```

@ -40,8 +40,12 @@ SELECT
m.trend_up,
m.trend_down,
m.volatility
FROM cdb_crankshaft.CDB_SpatialMarkovTrend('SELECT * FROM nyc_real_estate'
Array['m03y2009','m03y2010','m03y2011','m03y2012','m03y2013','m03y2014','m03y2015','m03y2016']) As m
FROM
cdb_crankshaft.CDB_SpatialMarkovTrend(
'SELECT * FROM nyc_real_estate'
Array['m03y2009', 'm03y2010', 'm03y2011',
'm03y2012', 'm03y2013', 'm03y2014',
'm03y2015','m03y2016']) As m
JOIN nyc_real_estate As c
ON c.cartodb_id = m.rowid;
```

@ -1,6 +1,6 @@
## K-Means Functions
### CDB_KMeans(subquery text, no_clusters INTEGER)
### CDB_KMeans(subquery text, no_clusters integer)
This function attempts to find n clusters within the input data. It will return a table to CartoDB ids and
the number of the cluster each point in the input was assigend to.
@ -29,8 +29,10 @@ A table with the following columns.
SELECT
customers.*,
km.cluster_no
FROM cdb_crankshaft.CDB_Kmeans('SELECT * from customers' , 6) km, customers_3
WHERE customers.cartodb_id = km.cartodb_id
FROM
cdb_crankshaft.CDB_Kmeans('SELECT * from customers' , 6) km, customers_3
WHERE
customers.cartodb_id = km.cartodb_id
```
### CDB_WeightedMean(subquery text, weight_column text, category_column text)
@ -57,6 +59,12 @@ A table with the following columns.
### Example Usage
```sql
SELECT ST_TRANSFORM(the_geom, 3857) as the_geom_webmercator, class
FROM cdb_crankshaft.cdb_weighted_mean('SELECT *, customer_value FROM customers','customer_value','cluster_no')
SELECT
ST_Transform(m.the_geom, 3857) AS the_geom_webmercator,
m.class
FROM
cdb_crankshaft.cdb_WeightedMean(
'SELECT * FROM customers',
'customer_value',
'cluster_no') AS m
```

Loading…
Cancel
Save