Git Product home page Git Product logo

Comments (2)

antoniocarlon avatar antoniocarlon commented on August 18, 2024

(Followup)

Querying the first measurement:

http://<mymap>/api/v2/sql?q=SELECT%20OBS_GetMeta((SELECT%20ST_SetSRID(ST_Extent(the_geom)%2C%204326)%20FROM%20(SELECT%20*%20FROM%20untitled_table_4)%20q)%2C%20%27%5B%7B%22numer_id%22%3A%22es.ine.t1_1%22%2C%22numer_timespan%22%3A%222015%22%2C%22normalization%22%3A%22prenormalized%22%7D%5D%27)&api_key=<my_api_key>

returns

{"rows":[{"obs_getmeta":[{"id":1,"numer_id":"es.ine.t1_1","timespan_rank":1,"score_rank":1,"timespan_rownum":1,"score_rownum":1,"score":18.055877553474502,"suggested_name":"total_pop_2015","numer_aggregate":"sum","numer_colname":"total_pop","numer_geomref_colname":"cusec_id","numer_tablename":"obs_24b656e9e23d1dac2c8ab5786a388f9bf0f4e5ae","numer_type":"Numeric","numer_description":"","numer_t_description":null,"denom_aggregate":null,"denom_colname":null,"denom_geomref_colname":null,"denom_tablename":null,"denom_type":null,"denom_reltype":null,"denom_description":null,"denom_t_description":null,"geom_colname":"the_geom","geom_geomref_colname":"cusec_id","geom_tablename":"obs_01b060d28ba00522076d6f7d7e8939adc6069c28","geom_type":"Geometry","geom_timespan":"2011","geom_description":"The smallest division of the Spanish Census.","geom_t_description":null,"numer_timespan":"2015","numer_name":"Total population","denom_name":null,"geom_name":"Sección Censal","normalization":"prenormalized","max_timespan_rank":null,"max_score_rank":null,"target_geoms":null,"target_area":null,"num_geoms":0.0912014279825554,"denom_id":null,"geom_id":"es.ine.the_geom"}]}],"time":0.169,"fields":{"obs_getmeta":{"type":"JSON"}},"total_rows":1}

And executing the query:

SELECT * FROM cdb_observatory.OBS_GetData(ARRAY[(ST_Transform(ST_Buffer(ST_Transform(ST_SetSRID(ST_MakePoint(-4, 41), 4326), 3857), 250), 4326), 1)::geomval], '[{"id":1,"numer_id":"es.ine.t1_1","timespan_rank":1,"score_rank":1,"timespan_rownum":1,"score_rownum":1,"score":18.055877553474502,"suggested_name":"total_pop_2015","numer_aggregate":"sum","numer_colname":"total_pop","numer_geomref_colname":"cusec_id","numer_tablename":"obs_24b656e9e23d1dac2c8ab5786a388f9bf0f4e5ae","numer_type":"Numeric","numer_description":"","numer_t_description":null,"denom_aggregate":null,"denom_colname":null,"denom_geomref_colname":null,"denom_tablename":null,"denom_type":null,"denom_reltype":null,"denom_description":null,"denom_t_description":null,"geom_colname":"the_geom","geom_geomref_colname":"cusec_id","geom_tablename":"obs_01b060d28ba00522076d6f7d7e8939adc6069c28","geom_type":"Geometry","geom_timespan":"2011","geom_description":"The smallest division of the Spanish Census.","geom_t_description":null,"numer_timespan":"2015","numer_name":"Total population","denom_name":null,"geom_name":"Sección Censal","normalization":"prenormalized","max_timespan_rank":null,"max_score_rank":null,"target_geoms":null,"target_area":null,"num_geoms":0.0912014279825554,"denom_id":null,"geom_id":"es.ine.the_geom"}]');

returns the expected value:

'[{"value":3.38578494040731}]'

Querying the second measurement:

http://<mymap>/api/v2/sql?q=SELECT%20OBS_GetMeta((SELECT%20ST_SetSRID(ST_Extent(the_geom)%2C%204326)%20FROM%20(SELECT%20*%20FROM%20untitled_table_4)%20q)%2C%20%27%5B%7B%22numer_id%22%3A%22es.ine.t1_1%22%2C%22numer_timespan%22%3A%222015%22%2C%22normalization%22%3A%22area%22%7D%5D%27)&api_key=<my_api_key>

returns

{"rows":[{"obs_getmeta":[{"id":1,"numer_id":"es.ine.t1_1","timespan_rank":1,"score_rank":1,"timespan_rownum":1,"score_rownum":1,"score":18.055877553474502,"suggested_name":"total_pop_per_sq_km_2015","numer_aggregate":"sum","numer_colname":"total_pop","numer_geomref_colname":"cusec_id","numer_tablename":"obs_24b656e9e23d1dac2c8ab5786a388f9bf0f4e5ae","numer_type":"Numeric","numer_description":"","numer_t_description":null,"denom_aggregate":null,"denom_colname":null,"denom_geomref_colname":null,"denom_tablename":null,"denom_type":null,"denom_reltype":null,"denom_description":null,"denom_t_description":null,"geom_colname":"the_geom","geom_geomref_colname":"cusec_id","geom_tablename":"obs_01b060d28ba00522076d6f7d7e8939adc6069c28","geom_type":"Geometry","geom_timespan":"2011","geom_description":"The smallest division of the Spanish Census.","geom_t_description":null,"numer_timespan":"2015","numer_name":"Total population","denom_name":null,"geom_name":"Sección Censal","normalization":"area","max_timespan_rank":null,"max_score_rank":null,"target_geoms":null,"target_area":null,"num_geoms":0.0912014279825554,"denom_id":null,"geom_id":"es.ine.the_geom"}]}],"time":0.167,"fields":{"obs_getmeta":{"type":"JSON"}},"total_rows":1}

And executing the query:

SELECT * FROM cdb_observatory.OBS_GetData(ARRAY[(ST_Transform(ST_Buffer(ST_Transform(ST_SetSRID(ST_MakePoint(-4, 41), 4326), 3857), 250), 4326), 1)::geomval], '[{"id":1,"numer_id":"es.ine.t1_1","timespan_rank":1,"score_rank":1,"timespan_rownum":1,"score_rownum":1,"score":18.055877553474502,"suggested_name":"total_pop_per_sq_km_2015","numer_aggregate":"sum","numer_colname":"total_pop","numer_geomref_colname":"cusec_id","numer_tablename":"obs_24b656e9e23d1dac2c8ab5786a388f9bf0f4e5ae","numer_type":"Numeric","numer_description":"","numer_t_description":null,"denom_aggregate":null,"denom_colname":null,"denom_geomref_colname":null,"denom_tablename":null,"denom_type":null,"denom_reltype":null,"denom_description":null,"denom_t_description":null,"geom_colname":"the_geom","geom_geomref_colname":"cusec_id","geom_tablename":"obs_01b060d28ba00522076d6f7d7e8939adc6069c28","geom_type":"Geometry","geom_timespan":"2011","geom_description":"The smallest division of the Spanish Census.","geom_t_description":null,"numer_timespan":"2015","numer_name":"Total population","denom_name":null,"geom_name":"Sección Censal","normalization":"area","max_timespan_rank":null,"max_score_rank":null,"target_geoms":null,"target_area":null,"num_geoms":0.0912014279825554,"denom_id":null,"geom_id":"es.ine.the_geom"}]');

returns the expected value:

'[{"value":30.4982346984447}]'

Querying both measurements (OBS_GetData)

SELECT * FROM cdb_observatory.OBS_GetData(ARRAY[(ST_Transform(ST_Buffer(ST_Transform(ST_SetSRID(ST_MakePoint(-4, 41), 4326), 3857), 250), 4326), 1)::geomval], '[{"id":1,"numer_id":"es.ine.t1_1","timespan_rank":1,"score_rank":1,"timespan_rownum":1,"score_rownum":1,"score":18.055877553474502,"suggested_name":"total_pop_per_sq_km_2015","numer_aggregate":"sum","numer_colname":"total_pop","numer_geomref_colname":"cusec_id","numer_tablename":"obs_24b656e9e23d1dac2c8ab5786a388f9bf0f4e5ae","numer_type":"Numeric","numer_description":"","numer_t_description":null,"denom_aggregate":null,"denom_colname":null,"denom_geomref_colname":null,"denom_tablename":null,"denom_type":null,"denom_reltype":null,"denom_description":null,"denom_t_description":null,"geom_colname":"the_geom","geom_geomref_colname":"cusec_id","geom_tablename":"obs_01b060d28ba00522076d6f7d7e8939adc6069c28","geom_type":"Geometry","geom_timespan":"2011","geom_description":"The smallest division of the Spanish Census.","geom_t_description":null,"numer_timespan":"2015","numer_name":"Total population","denom_name":null,"geom_name":"Sección Censal","normalization":"area","max_timespan_rank":null,"max_score_rank":null,"target_geoms":null,"target_area":null,"num_geoms":0.0912014279825554,"denom_id":null,"geom_id":"es.ine.the_geom"},{"id":2,"numer_id":"es.ine.t1_1","timespan_rank":1,"score_rank":1,"timespan_rownum":1,"score_rownum":1,"score":18.055877553474502,"suggested_name":"total_pop_2015","numer_aggregate":"sum","numer_colname":"total_pop","numer_geomref_colname":"cusec_id","numer_tablename":"obs_24b656e9e23d1dac2c8ab5786a388f9bf0f4e5ae","numer_type":"Numeric","numer_description":"","numer_t_description":null,"denom_aggregate":null,"denom_colname":null,"denom_geomref_colname":null,"denom_tablename":null,"denom_type":null,"denom_reltype":null,"denom_description":null,"denom_t_description":null,"geom_colname":"the_geom","geom_geomref_colname":"cusec_id","geom_tablename":"obs_01b060d28ba00522076d6f7d7e8939adc6069c28","geom_type":"Geometry","geom_timespan":"2011","geom_description":"The smallest division of the Spanish Census.","geom_t_description":null,"numer_timespan":"2015","numer_name":"Total population","denom_name":null,"geom_name":"Sección Censal","normalization":"prenormalized","max_timespan_rank":null,"max_score_rank":null,"target_geoms":null,"target_area":null,"num_geoms":0.0912014279825554,"denom_id":null,"geom_id":"es.ine.the_geom"}]');

Also returns the expected value:

'[{"value":30.4982346984447},{"value":3.38578494040731}]'

from camshaft.

javitonino avatar javitonino commented on August 18, 2024

Yes, IIRC the DO part works, this is a problem with the analysis in camshaft itself, and how it generates the column names.

from camshaft.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.