Esri / spatial-framework-for-hadoop

The Spatial Framework for Hadoop allows developers and data scientists to use the Hadoop data processing system for spatial data analysis.
Apache License 2.0
363 stars 160 forks source link

Need below function to execute in hive #159

Open kullaibigdata opened 5 years ago

kullaibigdata commented 5 years ago

Hi I am very new to spatial function . As I searched on google I find out the ESRI github code and I Clone that code and I add the dependencies and it's working fine.

Now below spatial functions we are not able to find out . Can you please share below spatial hive UDF code.

st_closestpoint st_distancesphere st_linesubstring st_linemerge st_covers st_makeline

If you have any alternatives spatial function kindly please share for the same.

Thanks & Regards, Kullaireddy N.

randallwhitman commented 5 years ago

Thanks for filing the request for enhancement to the set of functions available (cross-reference #90). Although the core contributors have no immediate plans to add more functions, the Spatial-framework-for-Hadoop is open-source and contributions are welcome.

kullaibigdata commented 5 years ago

thanks for quick response Randall..! we will work on the enhancement and please let us know if anybody is completed any of these functions for the time being.

kullaibigdata commented 5 years ago

Hi Randall .. Have tried to implement the functionalities which i have mentioned you in my previous query. For the functionality ST_LineMerge, i have got a source code from https://github.com/orbisgis/h2gis/tree/master/h2gis-functions/src/main/java/org/h2gis/functions/spatial/aggregate While trying to incorporate the logic what i got from h2gis i was stuck with the methods written in Geometry.utils class. Could we please give few suggestions from your side on how to implement the logic from h2gic to our esri in ST_LineMerge functionality. Please do the needful.

Thanks in advance.

randallwhitman commented 5 years ago

Hi @kullaibigdata - I'll avoid looking at the H2GIS source code, because [if I'm seeing correctly] it has a license incompatible with the Apache license of this Spatial Framework for Hadoop. Is LineMerge part of an OGC standard, and if so, can you point me to which standard and which section?

kullaibigdata commented 5 years ago

Hi Randallwhitman,

st_closestpoint st_distancesphere st_linesubstring st_linemerge

we are taking H2GIS logic and trying to implement OGC standard for the above spatial function but we are not succeeded in this case because bit complex structure for the understanding OGC standard.

Please advise for the above spatial query's how to implement in the OGC standard or else can you please provide the logic for the same.

Thanks & Regards, Kullaireddy N.

randallwhitman commented 5 years ago

OpenGIS Implementation Standard for Geographic information - Simple feature access

OGC-06-103r4-1.2.1 Part 1: Common architecture

OGC-06-104r4-1.2.1 Part 2: SQL option

Those are the OGC standard documents that I have, in which I do not find specification for any of the four functions listed in previous comment (2019/04/09 22:23 PT). Can you point me to a standard (and which section) that specifies those functions? @kullaibigdata

kullaibigdata commented 5 years ago

Thanks Randallwhitman for quick response. Yes we have checked OGC-06-104r4-1.2.1 (Part 2: SQL option) functions but required spatial functions are not available in this section. Coming to the standard functions which are available in POSTGRESQL. Below are the links for your reference. https://postgis.net/docs/ST_LineMerge.html https://postgis.net/docs/ST_LineSubstring.html https://postgis.net/docs/ST_DistanceSphere.html https://postgis.net/docs/ST_ClosestPoint.html https://postgis.net/docs/ST_Covers.html https://postgis.net/docs/ST_MakeLine.html

Currently we are using ESRI custom spatial functions jar but the above functions are not available in ESRI .Kindly provide the solution to move forward.

Thank you

Thanks & Regards, Kullaireddy N.

randallwhitman commented 5 years ago

@alocke @stolstov For a contributor planning to implement the six functions ST-LineMerge, ST-LineSubstring, ST-DistanceSphere, ST-ClosestPoint, ST-Covers, and ST-MakeLine : would you recommend implementing those inside geometry-api-java, versus, would you recommend implementing those at spatial-framework-for-hadoop level (utilizing geometry-api-java of course)? Thanks in advance for your comments.

stolstov commented 5 years ago

Firstly: https://github.com/Esri/contributing/issues/10 @randallwhitman Maybe provide a mechanism to be able to register external spatial functions so that the user could have their own implementation with their own licensing requirements?

I think: ST_ClosestPoint - OperatorProximity2D ST_Covers - OperatorRelate with "**FF*". ST_DistanceSphere - Distance on a sphere calculation is a short function that has many example on the internet. ST_LineMerge - Maybe this is ST_Union? LineSubstring we don't have I think. This is not too complicated method to write externally. MakeLine seems like some simple construction method.