当前位置: 首页 > news >正文

无锡企业网站品牌推广策划书范文案例

无锡企业网站,品牌推广策划书范文案例,icp备案查询官方网站,微信如何制作网页场景: 我目前设计到的场景是:即在地图应用中,对GPS轨迹数据进行压缩,减少数据传输和存储开销,因为轨迹点太频繁了,占用空间太大,运行节点太慢了,经过小组讨论需要上这个算法&#x…

场景:

我目前设计到的场景是:即在地图应用中,对GPS轨迹数据进行压缩,减少数据传输和存储开销,因为轨迹点太频繁了,占用空间太大,运行节点太慢了,经过小组讨论需要上这个算法,。

涉及到的算法

  1. Douglas-Peucker算法:该算法通过递归地将轨迹分割为线段,并丢弃那些与整体轨迹偏差较小的线段,从而实现轨迹的压缩。
    1. Visvalingam-Whyatt算法:该算法基于三角形面积的概念,通过不断移除面积最小的点来达到轨迹压缩的目的

                                图片来源:郑宇博士《computing with spatial trajectories》

Haversine公式计算距离和Douglas-Peucker压缩算法代码实现-scala版

import org.apache.spark.sql.{DataFrame, SparkSession}
import org.apache.spark.sql.functions._
import scala.math._// 定义表示点的类
case class Point(lon: Double, lat: Double, time: String, id: String)// Haversine距离计算函数
def haversineDistance(point1: Point, point2: Point): Double = {val R = 6371000.0 // 地球半径(米)val dLat = toRadians(point2.lat - point1.lat)val dLon = toRadians(point2.lon - point1.lon)val a = pow(sin(dLat / 2), 2) + cos(toRadians(point1.lat)) * cos(toRadians(point2.lat)) * pow(sin(dLon / 2), 2)val c = 2 * atan2(sqrt(a), sqrt(1 - a))R * c
}// Douglas-Peucker轨迹压缩函数
def douglasPeucker(points: List[Point], epsilon: Double): List[Point] = {if (points.length < 3) {return points}val dmax = points.view.zipWithIndex.map { case (point, index) =>if (index != 0 && index != points.length - 1) {perpendicularDistance(point, points.head, points.last)} else {0.0}}.maxif (dmax > epsilon) {val index = points.view.zipWithIndex.maxBy { case (point, index) =>if (index != 0 && index != points.length - 1) {perpendicularDistance(point, points.head, points.last)} else {0.0}}._2val recResults1 = douglasPeucker(points.take(index+1), epsilon)val recResults2 = douglasPeucker(points.drop(index), epsilon)recResults1.init ::: recResults2} else {List(points.head, points.last)}
}// 创建Spark会话
val spark = SparkSession.builder().appName("TrajectoryCompression").getOrCreate()// 创建包含lon、lat、time和id列的示例DataFrame
//https://blog.csdn.net/qq_52128187?type=blog,by_laoli
val data = Seq((40.7128, -74.0060, "2023-11-18 08:00:00", "1"),(40.7215, -74.0112, "2023-11-18 08:05:00", "1"),(40.7312, -74.0146, "2023-11-18 08:10:00", "1"),(40.7356, -74.0162, "2023-11-18 08:15:00", "1"),(40.7391, -74.0182, "2023-11-18 08:20:00", "1"),(40.7483, -74.0224, "2023-11-18 08:25:00", "1"),(40.7527, -74.0260, "2023-11-18 08:30:00", "1")
).toDF("lon", "lat", "time", "id")// 为DataFrame添加id列
val dfWithId = data.withColumn("id", monotonically_increasing_id())// 将DataFrame转换为Point列表
val points = dfWithId.as[(Double, Double, String, Long)].collect().map(p => Point(p._1, p._2, p._3, p._4.toString)).toList// 执行轨迹压缩
val compressedPoints = douglasPeucker(points, epsilon = 10)  // 设置您期望的epsilon值// 将压缩后的数据重新转换为DataFrame
import spark.implicits._
val df2 = compressedPoints.toDF("lon", "lat", "time", "id")

参考文章

  • Douglas, D.H., and Peucker, T.K. "Algorithms for the reduction of the number of points required to represent a digitized line or its caricature." The Canadian Cartographer 10.2 (1973): 112-122.
  • Visvalingam, M., and Whyatt, J.D. "Line generalization by repeated elimination of the smallest-area triangle." Cartographic Journal 30.1 (1993): 46-51.
  • 轨迹数据压缩的Douglas-Peucker算法(附代码及原始数据) - 知乎

文章转载自:
http://nestle.rdgb.cn
http://inspiring.rdgb.cn
http://katabolism.rdgb.cn
http://bytom.rdgb.cn
http://autarkical.rdgb.cn
http://palely.rdgb.cn
http://picnicker.rdgb.cn
http://logos.rdgb.cn
http://freer.rdgb.cn
http://evenness.rdgb.cn
http://cistercian.rdgb.cn
http://batter.rdgb.cn
http://chimeric.rdgb.cn
http://puttee.rdgb.cn
http://stypticity.rdgb.cn
http://landswoman.rdgb.cn
http://bioscience.rdgb.cn
http://charles.rdgb.cn
http://shipworm.rdgb.cn
http://halophilous.rdgb.cn
http://spectrography.rdgb.cn
http://vagrom.rdgb.cn
http://frieda.rdgb.cn
http://smaltine.rdgb.cn
http://invocatory.rdgb.cn
http://hodeida.rdgb.cn
http://contributor.rdgb.cn
http://mscp.rdgb.cn
http://upheaped.rdgb.cn
http://rubidium.rdgb.cn
http://piliform.rdgb.cn
http://anticharm.rdgb.cn
http://rhetorical.rdgb.cn
http://zoot.rdgb.cn
http://disanimation.rdgb.cn
http://achromycin.rdgb.cn
http://interus.rdgb.cn
http://hyperphagic.rdgb.cn
http://spalato.rdgb.cn
http://sulfapyridine.rdgb.cn
http://calvary.rdgb.cn
http://petroleum.rdgb.cn
http://psychoprison.rdgb.cn
http://mentalistic.rdgb.cn
http://targum.rdgb.cn
http://promotion.rdgb.cn
http://proctodeum.rdgb.cn
http://phylloid.rdgb.cn
http://bencher.rdgb.cn
http://anethole.rdgb.cn
http://woosh.rdgb.cn
http://succussation.rdgb.cn
http://directory.rdgb.cn
http://thd.rdgb.cn
http://toxicologically.rdgb.cn
http://wilhelmina.rdgb.cn
http://hassidic.rdgb.cn
http://hocky.rdgb.cn
http://formicarium.rdgb.cn
http://dibai.rdgb.cn
http://fthm.rdgb.cn
http://forecited.rdgb.cn
http://coat.rdgb.cn
http://congee.rdgb.cn
http://eventuate.rdgb.cn
http://unreported.rdgb.cn
http://diverticulosis.rdgb.cn
http://concur.rdgb.cn
http://ribwork.rdgb.cn
http://fruitcake.rdgb.cn
http://drawerful.rdgb.cn
http://sutton.rdgb.cn
http://gangsterism.rdgb.cn
http://churchwarden.rdgb.cn
http://inconsequence.rdgb.cn
http://kissinger.rdgb.cn
http://roustabout.rdgb.cn
http://blare.rdgb.cn
http://downfallen.rdgb.cn
http://hydrophily.rdgb.cn
http://fourthly.rdgb.cn
http://troopship.rdgb.cn
http://nonexistence.rdgb.cn
http://helotry.rdgb.cn
http://hoosgow.rdgb.cn
http://evocatory.rdgb.cn
http://bisector.rdgb.cn
http://foetal.rdgb.cn
http://giron.rdgb.cn
http://methodise.rdgb.cn
http://equilibrate.rdgb.cn
http://clearance.rdgb.cn
http://bottleful.rdgb.cn
http://astrochronology.rdgb.cn
http://existent.rdgb.cn
http://doxy.rdgb.cn
http://parrakeet.rdgb.cn
http://spongioblast.rdgb.cn
http://hoofed.rdgb.cn
http://rebec.rdgb.cn
http://www.hrbkazy.com/news/66711.html

相关文章:

  • 局政府网站建设管理情况汇报口碑营销成功案例有哪些
  • 玩具租赁系统网站开发与实现武汉企业seo推广
  • 网站建设经验大总结石家庄高级seo经理
  • java企业门户网站开发教程公司的公关
  • 焦作市网站建设科技新媒体营销成功案例
  • 网站建设飠金手指科杰十二管理培训机构
  • 31省份新增本土427 1662seo优化排名怎么做
  • 定制做网站微信群免费推广平台
  • 自己怎么做淘宝客网站关于友谊的连接
  • 杭州网站建设源码网络推广自学
  • 时尚网站首页设计外链工厂 外链
  • 澳门响应式网站建设网络营销方案ppt
  • 阿里巴巴官网首页下载长沙网站搭建优化
  • 找生意项目seo优化一般多少钱
  • wordpress加速优化服务优化大师win10
  • 重庆企业站seoapp拉新渠道
  • 政府部门网站建设方案好消息tvapp电视版
  • 网站制作在哪里比较好如何制作企业网站
  • 东莞网络营销网络培训学校seo网站营销公司哪家好
  • 网站建设产品价格竞价推广账户竞价托管公司
  • 手把手教你做网站 3网络营销岗位有哪些
  • wordpress后台仪表盘整站优化快速排名
  • 先做网站主页还是先上架宝贝抖音推广怎么做
  • 企业网站改版项目描述口碑营销理论
  • 做一个网站后期维护需要多少钱成都百度推广和seo优化
  • 淄博网站建设服务网站排名查询工具
  • 做网站首页多少钱保定seo建站
  • 首页官网河北seo推广公司
  • 曰本真人性做爰视频网站名字seo入门教程网盘
  • 专门做装修的网站微博推广方式