package org.gcube.application.geoportal.utils;

import java.net.MalformedURLException;
import java.net.URL;
import java.util.Collections;

import org.geotoolkit.data.DataStore;
import org.geotoolkit.data.DataStoreFinder;
import org.geotoolkit.data.FeatureCollection;
import org.geotoolkit.storage.DataStoreException;
import org.opengis.feature.simple.SimpleFeature;
import org.opengis.feature.simple.SimpleFeatureType;

public class ShpUtils {

	
	public static void read(String uri) throws MalformedURLException, DataStoreException {
		
		// Read
		DataStore inputDataStore = DataStoreFinder.open(
		        Collections.singletonMap("url", new URL(uri)));

		String inputTypeName = inputDataStore.getTypeNames()[0];
		inputDataStore.getFeatureReader(null).getFeatureType().getCoordinateReferenceSystem();

//		FeatureSource<SimpleFeatureType, SimpleFeature>
//		        source = inputDataStore.getFeatureSource(inputTypeName);
//
//		FeatureCollection<SimpleFeatureType, SimpleFeature>
//		        inputFeatureCollection = source.getFeatures();
		
	}
	
}
