package com.base.biz.utils;






/*import org.geotools.data.FeatureSource;
import org.geotools.data.FileDataStore;
import org.geotools.data.FileDataStoreFinder;
import org.geotools.data.shapefile.ShapefileDataStore;
import org.geotools.data.simple.SimpleFeatureCollection;
import org.geotools.feature.FeatureCollection;
import org.geotools.feature.FeatureIterator;
import org.geotools.geometry.jts.JTS;
import org.locationtech.jts.geom.Coordinate;
import org.locationtech.jts.geom.Geometry;
import org.opengis.feature.Property;
import org.opengis.feature.simple.SimpleFeature;
import org.opengis.feature.simple.SimpleFeatureType;
import org.opengis.geometry.BoundingBox;*/

import java.io.File;

import java.awt.*;
import java.io.*;
import java.net.MalformedURLException;
import java.nio.charset.Charset;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;


public class FileUtils {

    /**
     */
    public static String readInfo(String poingX, String pointY) {
        return "";
/*        try {
            // shp文件路径
*//*            ShapefileDataStore shpDataStore = new ShapefileDataStore(new File("D:\\xm\\duoxingyanshi\\12.shp").toURI().toURL());
            shpDataStore.setStringCharset(Charset.forName("GBK"));*//*
            File shapefile = new File("D:/xm/duoxingyanshi/12.shp");
            FileDataStore store = FileDataStoreFinder.getDataStore(shapefile);
            // 文件名称
           String typeName = store.getTypeNames()[0];
            FeatureSource<SimpleFeatureType, SimpleFeature> featureSource = null;
            featureSource = (FeatureSource<SimpleFeatureType, SimpleFeature>) store.getFeatureSource(typeName);
            FeatureCollection<SimpleFeatureType, SimpleFeature> result = featureSource.getFeatures();
            FeatureIterator<SimpleFeature> itertor = result.features();
            Geometry point = JTS.toGeometry((BoundingBox) new Coordinate(125.754000, 39.798000));

            // 迭代iterator
            boolean found = false;
            String name="";
            while (itertor.hasNext() && !found) {
                SimpleFeature feature = itertor.next();
                Geometry countryBoundary = (Geometry) feature.getDefaultGeometryProperty().getValue();
                if (countryBoundary.contains(point)) {
                    System.out.println("The point is in: " + feature.getAttribute("NAME") + " (" + feature.getAttribute("ISO2") + ")");
                    name= String.valueOf(feature.getAttribute("NAME"));
                    found = true;
                }
            }

            if (!found) {
                System.out.println("The point is not inside any country in the shapefile.");
            }
return   name;
        } catch (Exception e) {
            return   "name";
        }*/

    }




}
