JAVA IDEA集成geotools gt-mif gdal读取.MIF

2023-11-09

1. 结论

gdal maven可以下载下来,读取MIF报错;

geotools与gt-mif可以成功读取mif,源码下方;

2. 问题1:gdal maven下载不下来

解决: 配置maven repositories

 <dependencies>
	 <dependency>
	    <groupId>org.gdal</groupId>
	    <artifactId>gdal</artifactId>
	    <version>1.11.2</version>
	</dependency>
</dependencies>
<repositories>
    <repository>
        <id>osgeo</id>
        <name>OSGeo Release Repository</name>
        <url>https://repo.osgeo.org/repository/release/</url>
        <snapshots>
            <enabled>false</enabled>
        </snapshots>
        <releases>
            <enabled>true</enabled>
            <!--不加如下updatePolicy会报错:resolution will not be reattempted until the update interval of XXX has elapsed or updates are force-->
            <updatePolicy>always</updatePolicy>
        </releases>
    </repository>
    <repository>
        <id>maven2-repository.dev.java.net</id>
        <name>Java.net repository</name>
        <url>http://download.java.net/maven/2</url>
    </repository>
    <repository>
        <snapshots>
            <enabled>true</enabled>
        </snapshots>
        <id>boundless</id>
        <name>Boundless Maven Repository</name>
        <url>http://repo.boundlessgeo.com/main</url>
    </repository>
 <!--   <repository>
        <id>osgeo</id>
        <name>Open Source Geospatial Foundation Repository</name>
        <url>http://download.osgeo.org/webdav/geotools/</url>
    </repository>-->
</repositories>

3. geotools,gt-mif maven配置

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.test.mif</groupId>
    <artifactId>mif2json</artifactId>
    <version>1.0-SNAPSHOT</version>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>2.3</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
    <properties>
        <gt-main.version>22.0</gt-main.version>
        <gt-mif.version>2.5.5</gt-mif.version>
        <jts.version>1.13</jts.version>
        <spring.version>4.3.14.RELEASE</spring.version>
    </properties>
    <dependencies>
        <dependency>
            <groupId>com.alibaba</groupId>
            <artifactId>fastjson</artifactId>
            <version>1.2.75</version>
        </dependency>
        <dependency>
            <groupId>com.vividsolutions</groupId>
            <artifactId>jts</artifactId>
            <version>${jts.version}</version>
        </dependency>
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>2.4</version>
        </dependency>
        <dependency>
            <groupId>org.geotools</groupId>
            <artifactId>gt-main</artifactId>
            <version>22-RC</version>
        </dependency>
        <dependency>
            <groupId>org.geotools</groupId>
            <artifactId>gt-mif</artifactId>
            <version>2.5.5</version>
        </dependency>
    </dependencies>

    <repositories>
        <repository>
            <id>osgeo</id>
            <name>OSGeo Release Repository</name>
            <url>https://repo.osgeo.org/repository/release/</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
            <releases>
                <enabled>true</enabled>
                <!--不加如下updatePolicy会报错:resolution will not be reattempted until the update interval of XXX has elapsed or updates are force-->
                <updatePolicy>always</updatePolicy>
            </releases>
        </repository>
    </repositories>
</project>

4. 源码

package com.mif2json.utils;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.vividsolutions.jts.geom.Coordinate;
import com.vividsolutions.jts.geom.Geometry;
import com.vividsolutions.jts.io.ParseException;
import com.vividsolutions.jts.io.WKTReader;
import org.apache.commons.io.FileUtils;
import org.geotools.data.FeatureReader;
import org.geotools.data.mif.MIFFile;
import org.opengis.feature.Feature;
import org.opengis.feature.simple.SimpleFeature;
import org.opengis.feature.simple.SimpleFeatureType;

import java.io.*;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/*************************************
 *Class Name: ReadMif2Json
 *Description: <读取Mif文件转为GeoJson格式>
 *@author: seminar
 *@since 1.0.0
 *************************************/
public class ReadMif2Json {

    public static void main(String[] args) throws ParseException, IOException {
        String mifPathDir = "E:\\mat\\mif\\";
        List<Feature> roadLinkMifFeatures = readFeature(mifPathDir + File.separator + "ROAD_LINK.mif");
        //1、将mif内容加载到内存
        JSONArray jsonFeatures = new JSONArray();
        JSONObject resultJson = new JSONObject();

        for (int i = 0; i < roadLinkMifFeatures.size(); i++) {
            Feature roadLinkMifFeature = roadLinkMifFeatures.get(i);


            JSONObject jsonFeature = new JSONObject();
            // 组装geometry
            JSONObject geometry = getRoadLinkGeometry(roadLinkMifFeature);
            jsonFeature.put("geometry", geometry);

            //组装type
            jsonFeature.put("type", "Feature");
            //组装properties
            JSONObject roadLinkProperties = getRoadLinkProperties(roadLinkMifFeature);
            jsonFeature.put("properties", roadLinkProperties);
            //组装id 
            // todo 待定id的值
            jsonFeature.put("id", i * 2);
            jsonFeatures.add(jsonFeature);

            if (i == 0) {
                testField(roadLinkMifFeature);
                System.out.println("geojson: " + JSON.toJSONString(jsonFeature));
            }
        }
        resultJson.put("type", "FeatureCollection");
        resultJson.put("features", jsonFeatures);

        //将结果json写入制定目录
        writeJson(mifPathDir, resultJson, "roadlink");
    }

    /**
     * 读取Feature
     *
     * @param mifPath mif文件路径
     * @return List<Feature>
     */
    public static List<Feature> readFeature(String mifPath) throws IOException {
        Map<String, String> params = new HashMap<String, String>();
        params.put("version", "300");
        params.put("charset", "WindowsSimpChinese");
        params.put("delimiter", ",");
        params.put("coordsys", "Earth Projection 1, 0");
        transferEncoding(mifPath);
        transferEncoding(mifPath.replaceFirst("\\.(mif|MIF)", ".mid"));
        List<Feature> features = new ArrayList<Feature>();
        try {
            MIFFile mifFile = new MIFFile(mifPath, params);
            FeatureReader<SimpleFeatureType, SimpleFeature> reader = mifFile.getFeatureReader();

            while (reader.hasNext()) {
                Feature f = reader.next();
                features.add(f);
            }
            reader.close();
        } catch (IOException e) {
            e.printStackTrace();
            return new ArrayList<Feature>();
        }
        return features;
    }

    /**
     * 获取文件的编码字符集
     *
     * @param filePath
     * @return
     */
    public static String getEncoding(String filePath) throws IOException {
        String code = "";
        try {
            File file = new File(filePath);
            byte[] head = FileUtils.readFileToByteArray(file);
            if (head[0] == -1 && head[1] == -2) {
                code = "UTF-16";
                System.err.println("文件编码错误: " + file.getName() + " : " + code);
            } else if (head[0] == -2 && head[1] == -1) {
                code = "Unicode";
                System.err.println("文件编码错误: " + file.getName() + " : " + code);
            } else if (head[0] == -17 && head[1] == -69 && head[2] == -65) {
                code = "UTF-8";
            } else {
                int i = 0;
                int headSize = head.length;
                code = "UTF-8 NoBom";
                while (i < headSize - 2) {
                    if ((head[i] & 0x00FF) < 0x80) {
                        // (10000000)值小于0x80的为ASCII字符
                        i++;
                        continue;
                    } else if ((head[i] & 0x00FF) < 0xC0) {
                        // (11000000)值在0x80和0xC0之间的,不是开头第一个
                        code = "Not UTF-8";
                        System.err.println("文件编码错误: " + file.getName() + " : " + code + "1000");
                        break;
                    } else if ((head[i] & 0x00FF) < 0xE0) {
                        // (11100000)此范围内为2字节UTF-8字符
                        if ((head[i + 1] & (0xC0)) != 0x8) {
                            code = "Not UTF-8";
                            System.err.println("文件编码错误: " + file.getName() + " : " + code + "1100");
                            break;
                        } else {
                            i += 2;
                        }
                    } else if ((head[i] & 0x00FF) < 0xF0) {
                        // (11110000)此范围内为3字节UTF-8字符
                        if ((head[i + 1] & (0xC0)) != 0x80 || (head[i + 2] & (0xC0)) != 0x80) {
                            code = "Not UTF-8";
                            System.err.println("文件编码错误: " + file.getName() + " : " + code + "11100000" + (head[i + 1] & (0xC0)));
                            break;
                        } else {
                            i += 3;
                        }
                    } else {
                        code = "Not UTF-8";
                        System.err.println("文件编码错误: " + file.getName() + " : " + code + "1111");
                        break;
                    }
                }
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
        return code;
    }

    /**
     * 将gbk字符集文件转换为UTF-8编码文件
     *
     * @param filePath
     */
    public static void transferEncoding(String filePath) throws IOException {
        String encoding = getEncoding(filePath);
        if (encoding.startsWith("UTF-8")) {
            return;
        }
        List<String> list = new ArrayList<String>();
        File infile = new File(filePath);
        try {
            InputStream inputStream = new FileInputStream(infile);
            InputStreamReader isReader = new InputStreamReader(inputStream, "GBK");
            BufferedReader br = new BufferedReader(isReader);
            String str;
            // 按行读取字符串
            while ((str = br.readLine()) != null) {
                list.add(str);
            }
            br.close();
            inputStream.close();
        } catch (IOException e) {
            e.printStackTrace();
        }

        if (!list.isEmpty()) {
            File outFile = new File(filePath);
            try {
                OutputStream outStream = new FileOutputStream(outFile);
                OutputStreamWriter outWriter = new OutputStreamWriter(outStream, "UTF-8");
                BufferedWriter bw = new BufferedWriter(outWriter);
                for (String line : list) {
                    bw.write(line);
                    bw.write("\r\n");
                }

                bw.flush();
                bw.close();
                outStream.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }

    }

    /**
     * 给定路径与Json文件,存储到硬盘
     *
     * @param path     给定路径
     * @param json     json文件内容
     * @param fileName 文件名
     */
    public static void writeJson(String path, Object json, String fileName) {
        BufferedWriter writer = null;
        File dir = new File(path);
        if (!dir.exists()) {
            dir.mkdirs();
        }
        File file = new File(dir, fileName);
        //如果文件不存在,则新建一个
        if (!file.exists()) {
            try {
                file.createNewFile();
            } catch (IOException e) {
                e.printStackTrace();
            }
        } else {
            file.delete();
            try {
                file.createNewFile();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        //写入
        try {
            writer = new BufferedWriter(new FileWriter(file));
            writer.write(json.toString());
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            try {
                if (writer != null) {
                    writer.close();
                }
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        System.out.println(Thread.currentThread().getName() + "文件写入成功!");

    }

    /**
     * 根据单个roadLink的要素和Z要素生成对应的Geometry对象
     *
     * @return
     */
    private static JSONObject getRoadLinkGeometry(Feature roadLinkMifFeature) throws ParseException {
        //从linkmif中解析出xyz坐标
        JSONObject geometry = new JSONObject();
        geometry.put("type", "LineString");
        String xY = roadLinkMifFeature.getProperty("the_geom").getValue().toString();
        WKTReader reader = new WKTReader();
        Geometry xYGeo = reader.read(xY);
        //从geo对象中解析出坐标
        Coordinate[] coordinates = xYGeo.getCoordinates();
        //合并xyz坐标,形成新的Coordinate数组
        List<List<Double>> coordinatesList = new ArrayList<List<Double>>();
        for (int i = 0; i < coordinates.length; i++) {
            List<Double> coordinateList = new ArrayList<Double>();
            coordinateList.add(coordinates[i].x);
            coordinateList.add(coordinates[i].y);
            coordinateList.add(coordinates[i].z);
            coordinatesList.add(coordinateList);
        }
        geometry.put("coordinates", coordinatesList);
        return geometry;
    }

    public static void testField(Feature feature) {
        Field[] fields = feature.getClass().getDeclaredFields();
        for (Field field : fields) {
            //设置是否允许访问,不是修改原来的访问权限修饰词
            field.setAccessible(true);
            //获取字段名,和字段的值
            try {
                System.out.println("key: " + field.getName() + " value: " + field.get(feature));
            } catch (IllegalAccessException e) {
                e.printStackTrace();
            }
        }
    }

    /**
     * 根据单个roadLink的要素和Z要素生成对应的Geometry对象
     * 传入roadLink mif对象和Z mif对象
     *
     * @return
     */
    private static JSONObject getRoadLinkGeometry(Feature roadLinkMifFeature, List<Feature> roadLinkZMifFeatures) throws ParseException {
        //从linkmif中解析出xy坐标
        //从zmif中解析出z坐标
        JSONObject geometry = new JSONObject();
        geometry.put("type", "LineString");
        String xY = roadLinkMifFeature.getProperty("the_geom").getValue().toString();
        WKTReader reader = new WKTReader();
        Geometry xYGeo = reader.read(xY);
        //从geo对象中解析出坐标
        Coordinate[] coordinates = xYGeo.getCoordinates();
        //合并xyz坐标,形成新的Coordinate数组
        List<List<Double>> coordinatesList = new ArrayList<List<Double>>();
        for (int i = 0; i < coordinates.length; i++) {
            List<Double> coordinateList = new ArrayList<Double>();
            Double z = Double.parseDouble(roadLinkZMifFeatures.remove(0).getProperty("Z").getValue().toString());
            coordinates[i].setOrdinate(2, z / 100.0);
            coordinateList.add(coordinates[i].x);
            coordinateList.add(coordinates[i].y);
            coordinateList.add(coordinates[i].z);
            coordinatesList.add(coordinateList);
        }
        geometry.put("coordinates", coordinatesList);
        return geometry;

    }

    /**
     * 拼装一个properties对象,并且返回
     *
     * @param mifFeature
     * @return
     */
    private static JSONObject getRoadLinkProperties(Feature mifFeature) {
        JSONObject properties = new JSONObject();
        //挨个字段注入
        properties.put("BRIDGE_TYPE", Integer.parseInt(mifFeature.getProperty("BridgeFlag").getValue().toString()));
        properties.put("DIRECT", Integer.parseInt(mifFeature.getProperty("Direction").getValue().toString()));
        properties.put("PROVINCE_CODE_RIGHT", Integer.parseInt(mifFeature.getProperty("ProvAdminR").getValue().toString()));
        properties.put("LINK_PID", Integer.parseInt(mifFeature.getProperty("LinkID").getValue().toString()));
        properties.put("ACCESS_CHARACTERISTIC", mifFeature.getProperty("Accessible_By").getValue());
        //todo 待定
        properties.put("GUID", "to be determinated");
        properties.put("KIND", Integer.parseInt(mifFeature.getProperty("Kind").getValue().toString()));
        properties.put("VRU", Integer.parseInt(mifFeature.getProperty("VRU").getValue().toString()));
        properties.put("E_NODE_PID", Integer.parseInt(mifFeature.getProperty("EnodeID").getValue().toString()));
        properties.put("IS_VARIABLE_SPEED", Integer.parseInt(mifFeature.getProperty("VarSpeedLimit").getValue().toString()));
        //todo 待定
        properties.put("MEMO", "");
        //todo 待定
        properties.put("LEFT_NUM", 1);
        properties.put("MESH", mifFeature.getProperty("Mesh").getValue());
        properties.put("PROVINCE_CODE_LEFT", Integer.parseInt(mifFeature.getProperty("ProvAdminL").getValue().toString()));
        //todo
        properties.put("IS_REFLINE", 1);
        //todo
        properties.put("TRAFFIC_SIGNAL", 0);
        String LaneNumS2E = mifFeature.getProperty("LaneNumS2E").getValue().toString();
        if (LaneNumS2E.equals("N")) {
            LaneNumS2E = "0";
        }
        properties.put("S_NODE_PID", Integer.parseInt(mifFeature.getProperty("SnodeID").getValue().toString()));
        properties.put("LANE_NUM", Integer.parseInt(LaneNumS2E));
        properties.put("MULTI_DIGITIZED", Integer.parseInt(mifFeature.getProperty("IsMultiDZ").getValue().toString()));
        //todo
        properties.put("LENGTH", 0);
        properties.put("TRANTYPE", Integer.parseInt(mifFeature.getProperty("TranFlag").getValue().toString()));
        properties.put("OVERHEAD_OBSTRUCTION", Integer.parseInt(mifFeature.getProperty("Obstruction").getValue().toString()));
        return properties;
    }
}

5. 运行结果

在这里插入图片描述

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

JAVA IDEA集成geotools gt-mif gdal读取.MIF 的相关文章

  • 为什么 JavaFX API 不包含在 Java 8 J2SE 中? [关闭]

    Closed 这个问题是基于意见的 help closed questions 目前不接受答案 有谁知道为什么 JavaFX 8 仍然不是即将推出的 Java 8 中的日常 J2SE API 显示所有 Java 组件的技术图清楚地将 Jav
  • 在此代码中,Runnable 未实例化。为什么?

    Runnable cannot instantiate public class Thread4 public static void main String args Thread t1 new Thread new Runnable R
  • HttpSession 内的同步是否可行?

    UPDATE 问题后立即解决 问题 通常 同步是在 JVM 内序列化并行请求 例如 private static final Object LOCK new Object public void doSomething synchroniz
  • APNS(Apple 推送通知服务器)的反馈服务

    我们正在使用Java作为推送通知提供商APNS I我能够将消息发送到APNS但我不知道如何获得该消息的反馈 请帮忙 反馈服务具有类似于用于发送推送通知的接口的二进制接口 您可以通过以下方式访问生产反馈服务feedback push appl
  • 如何从 Java 中“double”类型的值中删除小数值

    我正在调用一个名为 calculateStampDuty 的方法 它将返回 财产需缴纳的印花税金额 百分比计算有效 很好 并返回正确的值 15000 0 但是 我想显示该值 前端用户只是 15000 所以只想删除小数点和任何前面的值 此后
  • 在 Java 中的 JFrame/JPanel/JComponent 中添加 Web 浏览器

    我正在开发一个 Java 应用程序 需要在应用程序中使用 Web 浏览器 我见过一些应用程序这样做 例如在同一应用程序中单击左侧面板中的提要并打开右侧面板中的链接时的 RSS 阅读器 我想实现类似的功能 在java中可以做到这一点吗 Jav
  • 如何构建和使用 TimeSeriesCollections

    我想在图表的 X 轴上显示一些日期 并且here https stackoverflow com questions 5118684 jfreechart histogram with dates据说我必须使用 TimeSeriesColl
  • JPA 的 Hibernate 查询提示

    我一直在尝试为所有可以通过设置的提示找到一个明确的资源Query setHint String Object JPA 中的方法调用 但我一无所获 有人知道一个好的参考吗 See 3 4 1 7 查询提示 http docs jboss or
  • 如何将测试类打包到jar中而不运行它们?

    我正在努力将我的测试类包含到 jar 包中 但不运行它们 经过一番谷歌搜索后 我尝试过mvn package DskipTests 但我的测试类根本没有添加到 jar 中 有任何想法吗 如果您遵循 Maven 约定 那么您的测试类位于src
  • Java 常量枚举[重复]

    这个问题在这里已经有答案了 可能的重复 理解 Java 中的枚举 https stackoverflow com questions 1419835 understanding enums in java 为什么我们应该使用枚举而不是 Ja
  • Java 中通用方法参数的 getClass()

    以下 Java 方法无法编译
  • java中的第三个布尔状态是什么?

    虽然我知道根据定义 布尔值仅包含两种状态 真或假 我想知道布尔值在用这些状态之一初始化之前有什么值 它默认为 false http java sun com docs books tutorial java nutsandbolts dat
  • 用于安装 R 软件包的备用编译器:clang:错误:不支持的选项“-fopenmp”

    我正在尝试在 OS X 10 11 6 上使用 R 版本 3 4 0 安装 rJava 包 install packages rJava type source 我收到以下错误 clang o libjri jnilib Rengine o
  • 如何在启用嵌入时间戳和 LTV 的情况下签署 PDF?

    我正在尝试签署启用了时间戳和 LTV 的 pdf 以便它在 Adob e Reader 中显示如下 在英语中 这意味着 签名包含嵌入的时间戳 和 签名启用了 LTV 这是我正在使用的代码 PrivateKey pk get pk from
  • 从特定 JAR 文件读取资源(文件的重复路径)

    假设您有 jar1 和artifactId 动物园 jar2 和artifactId 动物 两个 jar 都有一个具有相同路径的资源文件 例如 animals animal txt 有什么方法可以从特定的 jar 中读取该文件吗 使用 ge
  • 将 PropertyPlaceholderConfigurer 中的所有属性注入到 bean 中

    我有一个PropertyPlaceholderConfigurer加载多个属性文件 我想通过配置 XML 将合并的属性映射注入到 Spring Bean 中 我可以这样做以及如何做 您只需创建一个属性 bean 并将其用于您的Propert
  • Java给定长度的随机数

    我需要在 Java 中生成一个恰好 6 位数字的随机数 我知道我可以在随机发生器上循环 6 次 但是在标准 Java SE 中还有其他方法可以做到这一点吗 要生成 6 位数字 Use Random http download oracle
  • 动态创建 JSON 对象

    我正在尝试使用以下格式创建 JSON 对象 tableID 1 price 53 payment cash quantity 3 products ID 1 quantity 1 ID 3 quantity 2 我知道如何使用 JSONOb
  • 在java中创建一个XML树并将其转换为json对象

    我尝试创建也能够转换为 json 的树 但对于只有一个xpath 当我尝试实现多个 xpath 时 我无法获得所需的输出 这里我分享一下我的实现 private static Document addElemtbypath List
  • while循环只执行一次

    我很难弄清楚为什么 while 循环实际上不会循环 它运行一次并停止 import java util public class mileskm public static void main String args Scanner inp

随机推荐

  • include_directories和find_package

    通过一个自己要写的工程文件 终于弄明白了CMakeLists中的include directories和find package是什么意思了 简单而言 cmake本身不提供任何搜索库的便捷方法 所有搜索库并给变量赋值的操作必须由cmake代
  • Typora 语法说明

    Markdown介绍 Markdown 是一种轻量级标记语言 它允许人们使用易读易写的纯文本格式编写文档 Markdown 语言在 2004 由约翰 格鲁伯 英语 John Gruber 创建 Markdown 编写的文档可以导出 HTML
  • Docker Desktop 如何运行容器

    第一次使用windows环境下的DockerDesktop记录下使用方法 1 配置镜像源 虽然配置了镜像源 但是在界面你还是搜索不到镜像 应该默认使用的是官方dockerhub的原因 后面可以手动创建避开这个问题 2 运行系统的window
  • IntelliJ IDEA里Maven默认情况下编译版本为JDK1.5

    2019独角兽企业重金招聘Python工程师标准 gt gt gt IntelliJ IDEA里面Maven插件 如果pom xml里面没有设置编译版本 便采用默认的1 5版本 即便安装的JDK是jdk1 7 jdk1 8也是采用1 5版本
  • flutter中TextField光标偏移处理

    在flutter中当使用localizationsDelegates国际化之后 TextField输入框的光标出现了偏移错位的情况 只需要在style中加入textBaseline TextBaseline alphabetic就可以解决光
  • Java(变量+int+double+String+boolean四种数据类型)

    JavaDAY2 变量 int double String boolean四种数据类型 1 变量 表示变化的量 2 变量的简单运算 3 整数int与小数double 4 字符串String 5 布尔boolean 非此即彼 1 变量 表示变
  • Docker基本操作

    镜像命名规范 镜像名称一般分两部分组成 repository tag 如 mysql 8 1 在没有指定tag时 默认是latest 代表最新版本的镜像 Docker常用操作 在docker官网中输入你要的镜像名称 https hub do
  • 宋浩高等数学笔记(十)重积分

    本章更新第10章重积分 关于三重积分的应用部分暂时略过 本部分在考察的时候不会很难 困难在于对重积分本质的理解 以及极坐标下相关公式的计算 类比普通的定积分 如果对一个宽度不均匀的函数 求积分分后相当于计算总的面积 而对1积分则是相当于这段
  • HTML页面添加自定义水印(watermark)

    在需要引入HTML页面添加方法 document ready function 开启水印 watermark set 雨天路滑 小心驾驶 关闭水印 watermark del 页面添加水印效果 页面添加水印效果 method set 设置水
  • vue elmentui 日期选择器 多段时间 不可选

    日期选择器 实现动态的多段时间禁用
  • dijikstra 旅行商问题_『数学建模』TSP和MTSP问题

    2020 7 14更新 补充一下后续获奖情况 这次比赛我们小队获得了三等奖 为本次比赛中唯一获奖的大一学生队伍 完整问题及详细地参赛论文地址 2019 12 02 校内数模新手赛 blog csdn net 数模问题梗概 先给出一张地铁路线
  • 基于pygame的消消乐小游戏开发

    1 简介 今天向大家介绍一个帮助往届学生完成的毕业设计项目 基于pygame的消消乐小游戏开发 计算机毕业生设计 课程设计需要帮助的可以找我 2 设计概要 21世纪是信息化时代 随着信息技术和网络技术的发展 信息化已经渗透到人们日常生活的各
  • 用引用函数找出包含20个元素的整型数组中的最大值最小值以及其平均值(使用随机数初始化数组)#C++

    用引用函数找出包含20个元素的整型数组中的最大值最小值以及其平均值 使用随机数初始化数组 利用选择排序法 代码如下 include
  • 磁盘一把锁一个感叹号_硬盘上面一个感叹号是什么东西。求高手帮忙解决下。谢谢(下图)...

    出现这个提示是我隔热觉得是系统临时文件太多了 或是磁盘坏道出了问题引起的 看看下面的方法 不过还是要看看你的D盘 能不能进去读取数据 1 任务栏右下角出现这种提示 某文件损坏 请运行运用chkdsk工具修复 一般是系统垃圾文件太多导致的 主
  • 个人安装Ubuntu20.04和修复BIOS引导的过程(2022年5月)

    记录一下我个人安装Ubuntu20 04和修复BIOS引导的过程 不建议全部按照我的方法做 步骤9建议按照这个链接 https askubuntu com questions 1314321 select device boot insta
  • 一个完整的产品设计都要哪些设计流程

    设计理念是抽象的 它描述了一个产品从概念到完成的一般过程 然而 真正的产品设计过程要复杂得多 也要具体得多 因此 我们将分解这个过程中最重要的部分 并给实践中使用的建议 1 设计前期 通常 设计过程的第一步在产品设计之前就已经开始了 这是因
  • 如何利用数组实现高精度算法

    目录 引言 原理介绍 数据的输入 数字对齐的格式 以加法为例 小细节tips 代码如下 代码分析与书写过程 第一段 书写结构体 第二段 将字符串转化为数字输入数组 第三段 进行高精度数据的运算 以加法为例 最后一步 输出 引言 在C C 语
  • 分区容错性是什么意思_一篇文章搞清楚什么是分布式系统 CAP 定理

    专注于Java领域优质技术号 欢迎关注 来自 小旋锋 CAP定理是分布系统中的一个基本定理 它指出任何分布系统最多可以具有以下三个属性中的两个 一致性 Consistency 可用性 Availability 分区容错性 Partition
  • 充电IC驱动调试----移植充电IC bq25601

    关键词 MTK android 充电IC 内核 linux3 18 系统 android7 0 作者 arunboy 欢迎转载 请注明作者 在原有展讯平台下面的bq25601的基础上编写mtk平台下的bq25601代码 参考mtk平台下的
  • JAVA IDEA集成geotools gt-mif gdal读取.MIF

    JAVA IDEA集成geotools gt mif gdal读取 MIF 1 结论 2 问题1 gdal maven下载不下来 3 geotools gt mif maven配置 4 源码 5 运行结果 1 结论 gdal maven可以