CartoDB / analytics-toolbox-core

A set of UDFs and Procedures to extend BigQuery, Snowflake, Redshift, Postgres and Databricks with Spatial Analytics capabilities
Other
189 stars 43 forks source link

Crosses? #15

Closed RoboDonut closed 4 years ago

RoboDonut commented 4 years ago

Any way to get Turf Crosses function in?

jatorre commented 4 years ago

Do you mean this one?

https://turfjs.org/docs/#booleanCrosses

RoboDonut commented 4 years ago

Yup. That’s the one I need!

RoboDonut commented 4 years ago

I couldn’t locate the docs for doing this all myself for the greater good. Any direction there would be helpful

jatorre commented 4 years ago

Yeah. There is not much documentation right now for development.

But if you look at the repo on the folder for turf you will see a function for buffer. Best, will be to get started there looking at replicating that.

But probably we should create some docs for development to unify style.

On Thu, 16 Jul 2020 at 19:13, RoboDonut notifications@github.com wrote:

I couldn’t locate the docs for doing this all myself for the greater good. Any direction there would be helpful

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/CartoDB/bigquery-jslibs/issues/15#issuecomment-659550030, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAA7GOZZKMOS72YWHKBOUF3R34YKVANCNFSM4O2APQSA .

-- Javier de la Torre

(US) +1 917 463 3232 | (ES) +34 911 165 823 | jatorre@carto.com https://spatial-data-science-conference.com/

RoboDonut commented 4 years ago
CREATE OR REPLACE FUNCTION jslibs.turf.ST_CROSSES(geojson_a GEOGRAPHY, geojson_b GEOGRAPHY) AS (
  ST_GEOGFROMGEOJSON(jslibs.turf.booleanCrosses(ST_ASGEOJSON(geojson_a),ST_ASGEOJSON(geojson_b)))
);

But got Access Denied: Dataset jslibs:turf: User does not have bigquery.routines.create permission for dataset jslibs:turf. when executing

RoboDonut commented 4 years ago

if you can open this up somehow so i can test, i'd be happy to add as many of these as possible.

jatorre commented 4 years ago

Yeah, right now I would have to give you rights to deploy, the best is for you to try on your own project, and if the function works well then submit them as Pull Requests. That way I can just add them.

We have a testing environment for continuos integration, but still is not here.

RoboDonut commented 4 years ago

thanks . I got it working locally will fork and build and PR ASAP