主页 > 云储存 > > 正文

香港带宽_cdn负载均衡_高性能

来源:胜利云 发布时间:2021-06-11 05:46 标签:香港高性能负载带宽均衡
浏览:

Hi Folks,

This blog is intended to share my experiences on Geo-Spatial Functions implementation in SAP HANA. One of the implementation is implementing Information view to calculate distance between Cities Using Geo-Spatial Functions which I am sharing today.

Background: Geo- Spatial function used geospatial data which stored in a geographic information system (GIS). The geospatial data needs to be combined with data from the internet and sensor data, data from business partner to implement point to point implementation, to manage coordinates of different stores, warehouse, utilities of an organization, business for real-time analysis, reporting, forecasting, threat detection.

In the below scenario we will show how to Implementing Information view to calculate distance between Cities Using Geo-Spatial Functions

Let us create a table Cities, where we store the city name and its Coordinates. Go to catalog -> right click on schema  -> open SQL console

Create a table CITY, where we store the city name and its Coordinates. Write the code as shown in below screenshot –

Giving you the code for your reference:

CREATE COLUMN TABLE CITY ( Id BIGINT not null primary key generated by default as IDENTITY, /* To automatically fill the Id column */ City NVARCHAR (40) NULL, LongLat ST_GEOMETRY (4326)) /* Using ST_GOEMETRY shape which is a super set to load points information */ Click on execute

Here it is successfully executed.

Here you can see table under BEST schema

Some observations while creating the table: 1) ID Column: Identity column to generate the numbers for the ID column 2) Longitude & Latitude points: For different areas we have different latitude and longitude point. Here I have taken latitude and longitude points of Hyderabad and Vishakhapatnam 3) ST_GEOMETRY: We are using this data type ST_GEOMETRY to load our coordinates for the city. SRID Value 4326: Spatial reference identifier (SRID) and that the 4326 refers to the WGS84 standard which is commonly used. To insert the data into that table Write the below code as shown in below screenshot

Code for your reference: Insert into CITY (City, LongLat) values (‘Hyderabad’, new ST_POINT (‘POINT (78.4744400 17.3752800)’)); Insert into CITY (City, LongLat) values (‘Vishakapatnam’, new ST_POINT (‘POINT (83.3000000 17.7000000)’));

Click on execute and it will successfully executed.

Write the select statement as shown below Code for your reference: SELECT LongLat.ST_AsEWKT () FROM CITY;

and execute it.

Result:

Now we have data so now let us create stored procedure to calculate the distance between the 2 cities Hyderabad and Visakhapatnam. And also convert the distance into KM’s or Meters as required. To create procedures write the code as shown in below screenshot-

Code for your reference:

CREATE PROCEDURE SP_CALC_DISTANCE2 (In Latitude DECIMAL (18, 10), In Longitude DECIMAL (18, 10), In Conversion NVARCHAR(10)) LANGUAGE SQLSCRIPT AS BEGIN DECLARE STRING_STR varchar (200); /* Converting the Meters to KM */ IF: Conversion = ‘KM’ THEN EXECUTE IMMEDIATE (‘select A. City AS "Origin City", B.City AS "Destination City" , A.LongLat.st_distance (B.LongLat)/1000 AS "Distance (KM)" from CITY A,CITY B where A.id = 1 and B.id = 2’); ELSE EXECUTE IMMEDIATE (‘select A.City AS "Origin City",B.City AS "Destination City", A.LongLat.st_distance(B.LongLat) AS "Distance(meters)" from CITY A,CITY B where A.id = 1 and B.id = 2’); END IF; /* Calculating the distance from the location points given in the input against the table */ STRING_STR:= ‘SELECT NEW ST_Point("POINT (‘ || :Latitude ||’ ‘ || :Longitude || ‘)",4326).ST_Distance(LongLat)/1000 AS "Distance(KM)" FROM CITY WHERE id = 2’; EXECUTE IMMEDIATE ( :STRING_STR); END; Click on execute and it will successfully executed.

Here we can see the procedure under BEST schema

CALL statement to get output in KM Code for your reference: CALL SP_CALC_DISTANCE2 (78.4744400, 17.3752800,’KM’)

Click on execute and Output in KM:

CALL statement to get output in meters Code for your reference:

CALL SP_CALC_DISTANCE2 (78.4744400, 17.3752800,’METERS’)

Output in Meters:

We will continue another Scenario in the next session………………….

,大数据的,购物返利app,什么叫大数据分析,大数据100,服务器 云服务器
发表评论
验证码: 点击我更换图片

注:网友评论仅供其表达个人看法,并不代表本站立场。

热门文章

  • 对象存储_网站集约化建设_哪家好
    对象存储_网站集约化建设_哪家好

    对象存储_网站集约化建设_哪家好

    当戴夫·麦克卢尔首次提出海盗指标的概念时,它震撼了创业界的核心。尽管你现在可能知道他是500家初创企业的幕后推手,但在贝宝(PayPal)上市前担任...

  • 数据库_数据库事务原理_安全稳定
    <strong>数据库_数据库事务原理_安全稳定</strong>

    数据库_数据库事务原理_安全稳定

    为CloudFlare客户提供对源站的免费和高性能加密2014年秋季,CloudFlare推出了Universal SSL,并将通过HTTPS访问的网站数量增加了一倍。在短短几天内,我们颁发了...

  • 百度云_企业邮箱怎么设置签名_排行榜
    百度云_企业邮箱怎么设置签名_排行榜

    百度云_企业邮箱怎么设置签名_排行榜

    在快节奏的销售世界里,时间是无价的。这正是为什么你需要停止切换标签,使用新的Pipedrive Chrome扩展直接从Gmail使用Pipedrive的强大功能。如果你是一个狂...

  • 游戏服务器_节点服务器_优惠
    <strong>游戏服务器_节点服务器_优惠</strong>

    游戏服务器_节点服务器_优惠

    nomad0.11为任务引入了生命周期部分,可以用来表示任务依赖关系。这可以用来表示任务组中任务之间的任务依赖关系,甚至可以利用consur来表示任务间的任...

  • 企业邮箱_华为云techwave_企业级
    <strong>企业邮箱_华为云techwave_企业级</strong>

    企业邮箱_华为云techwave_企业级

    遵守一套不断发展的数据隐私法规的需求可能看起来很繁重,或者会导致公司停滞不前,不知道下一步该采取什么措施。如果不了解这些法规对日常运营的...

云储存

更多 >
  • <strong>亚马逊云_数据库分类_三重好礼</strong>
    亚马逊云_数据库分类_三重好礼

    业务规则一直是自动化决策或实现验证或定义复杂的监管或法规遵从性规则等的出色工具。随着从ABAP到云等平台的不断变化,该工具不断发展。随着最近的...

  • <strong>网站空间_app的服务器_怎么买</strong>
    网站空间_app的服务器_怎么买

    Vineet Hingrani和Robert Meusel 工业4.0背景下物联网的兴起为资产管理领域引入了许多新的可能性和用例。资产管理,在旧世界的背景下,是关于反应式维护和传...

云储存MySQL数据库_新疆建设网站_最新活动
云储存CDN_数据库下载_企业0元试用
云储存美国服务器_ae2017破解版百度云_高性价比
云储存MySQL数据库_京东云闪付下载_价格
云储存CDN_文件存储权限怎么打开_怎么买