张洋洋
2025-02-08 3c7edc1846cab6a1bdc02512a5f59a4031e2e07e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
package com.se.simu.utils;
 
 
import cn.smartearth.sem.SEM;
 
public class SemUtils {
    public static void main(String[] args) throws Exception {
        semToCityJson();
    }
    public static void cityJsonToSem(String jsonUrl,String semUrl) throws Exception {
        //cityjson转sem
        SEM sem = SEM.fromCityJSON(jsonUrl);
        sem.writeToFile(semUrl);
    }
    public static void semToCityJson() throws Exception {
        //sem转cityjson
        SEM sem2 = new SEM("D:\\城市内涝\\sem\\tongzhou\\tongzhou\\grid.sem");
        sem2.writeToCityJSON("D:\\城市内涝\\sem\\tongzhou\\tongzhou\\grid\\grid.json");
    }
}