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

求职网站网页模板WordPress 5.2.1

求职网站网页模板,WordPress 5.2.1,网站维保方法,绵阳市住房 和城乡建设局网站准备工作 本项目依赖于两个关键库#xff1a;JTS Topology Suite#xff08;简称JTS#xff09;#xff0c;用于几何对象创建和空间分析#xff1b;以及GeoTools#xff0c;用于处理坐标转换和其他地理信息任务。确保开发环境中已经包含了这两个库#xff0c;并且正确配…准备工作 本项目依赖于两个关键库JTS Topology Suite简称JTS用于几何对象创建和空间分析以及GeoTools用于处理坐标转换和其他地理信息任务。确保开发环境中已经包含了这两个库并且正确配置了相关依赖项。 数据加载与解析 实际车辆行驶轨迹 我们将从CSV文件中读取实际车辆行驶的数据这些数据通常包含时间戳、纬度和经度信息。下面是一个简化的VehicleTrack类它负责读取CSV文件并将其转换为JTS中的几何对象——LineString代表车辆的实际行驶路径。 import org.geotools.geometry.jts.JTS; import org.geotools.referencing.CRS; import org.locationtech.jts.geom.Coordinate; import org.locationtech.jts.geom.GeometryFactory; import org.locationtech.jts.geom.LineString; import org.opengis.referencing.FactoryException; import org.opengis.referencing.operation.MathTransform; import org.opengis.referencing.operation.TransformException;import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException; import java.util.ArrayList; import java.util.List;public class VehicleTrack {private LineString trackLine;public VehicleTrack(String csvFilePath) throws IOException, FactoryException, TransformException {ListCoordinate coordinates new ArrayList();try (BufferedReader br new BufferedReader(new FileReader(csvFilePath))) {String line;while ((line br.readLine()) ! null) {String[] values line.split(,);double lat Double.parseDouble(values[0]);double lon Double.parseDouble(values[1]);// 将经纬度坐标转换为目标投影坐标Coordinate projectedCoord transformCoord(lon, lat);coordinates.add(projectedCoord);}}GeometryFactory geometryFactory new GeometryFactory();this.trackLine geometryFactory.createLineString(coordinates.toArray(new Coordinate[0]));}private Coordinate transformCoord(double x, double y) throws FactoryException, TransformException {String sourceCRS EPSG:4326; // WGS84String targetCRS EPSG:32650; // UTM Zone 50N 示例MathTransform transform CRS.findMathTransform(CRS.decode(sourceCRS), CRS.decode(targetCRS), true);return JTS.transform(new Coordinate(x, y), null, transform);}public LineString getTrackLine() {return trackLine;} }预设行驶路线 预设路线可以从KML文件中读取该文件格式常用于描述地理特征。以下是一个简化版的PresetRoute类它实现了从KML文件加载预设路线的功能。 public class PresetRoute {private LineString routeLine;public PresetRoute(String kmlFilePath) throws Exception {// 这里简化处理假设从KML文件直接读取并转换为LineString// 实际应用中可能需要更复杂的解析逻辑// ...}public LineString getRouteLine() {return routeLine;} }计算偏离距离 需要编写一个函数来计算每个轨迹点到预设路线的最短距离。如果该距离超过了设定的阈值则认为发生了偏离。这里定义了一个名为DeviationChecker的类来进行这项工作。 import org.locationtech.jts.geom.Coordinate; import org.locationtech.jts.geom.GeometryFactory; import org.locationtech.jts.geom.LineString; import org.locationtech.jts.geom.Point;public class DeviationChecker {private static final double MAX_DEVIATION_THRESHOLD 50; // 最大允许偏离距离单位为米public static void checkDeviation(LineString actualTrack, LineString presetRoute) {GeometryFactory geometryFactory new GeometryFactory();for (Coordinate coord : actualTrack.getCoordinates()) {Point point geometryFactory.createPoint(coord);double distance point.distance(presetRoute);if (distance MAX_DEVIATION_THRESHOLD) {System.out.printf(偏离发生于 %s偏离距离 %.2f 米%n, point, distance);}}} }输出结果 最后在主函数中调用上述方法并传入实际轨迹和预设路线的数据以检查是否存在偏离情况。 public class Main {public static void main(String[] args) {try {VehicleTrack vehicleTrack new VehicleTrack(path/to/actual_track.csv);PresetRoute presetRoute new PresetRoute(path/to/preset_route.kml);DeviationChecker.checkDeviation(vehicleTrack.getTrackLine(), presetRoute.getRouteLine());} catch (Exception e) {e.printStackTrace();}} }
http://www.sczhlp.com/news/257394/

相关文章:

  • 有关网站建设的网站川畅咨询 做网站多少钱
  • 网站优化培训中心烟台H5网站设计
  • 大型网站开发深圳龙华区招聘网最新招聘信息
  • 为什么做企业网站做网站工作室名字
  • wap网站 什么意思网站优化建设
  • 重庆网站设计排名长沙第三方网站建设公司
  • 铁岭免费网站建设thinkphp5 做网站
  • 广西注册公司网站服务网站建设推广
  • 泉州网站建设培训机构怎样网站seo
  • 建设银行信用卡在网站激活后如何设置密码wordpress系统通知邮箱
  • 网站团队建设wordpress苏醒主题破解
  • 有哪些网站的搜索引擎网络服务器系统是什么
  • 微网站免费开发平台免费民事法律咨询
  • 公众号做网站群晖套件做网站
  • 个人如何注册网址沈阳优化推广哪家好
  • 文明网站建设情况织梦和wordpress哪个seo好
  • 标志设计logo网站品牌策划网站建设
  • 北京网站搜索优化电子商务网站建设课程性质
  • 网站建设具体工作有什么好看手机网站推荐
  • 网站为什么百度不收录达州做网站的公司有哪些
  • 如何做网站的百科盐城网站制作
  • 家庭宽带做网站服务器吗二手电商怎么做
  • 单目三角化原理 - MKT
  • 20232304 2025-2026-1 《网络与系统攻防技术》实验四实验报告
  • 记录
  • k8s-java应用部署(4)
  • 企业网站设计能否以做app一般多少钱
  • 学校网站开发招标法律对网站建设的规制
  • 成都学校网站建设公司在家做网站维护兼职
  • 网站seo综合公司联想官方服务网站