После ознакомления с кратким описанием геоинструментов: https://docs.geotools.org/latest/userguide/tutorial/quickstart/intellij.html
В нем показан пример восстановления характеристик формы с использованием этого кода:
File file = new File("myfile.shp");
FileDataStore store = FileDataStoreFinder.getDataStore(file);
SimpleFeatureSource featureSource = store.getFeatureSource();
FeatureCollection collection = featureSource.getFeatures();
FeatureIterator iterator = collection.features();
Однако этот код зависит от File
. В моем реальном проекте содержимое формы предоставляется мне в виде байтового массива, и я не могу создать временный файл. Итак, как я могу получить доступ к функциям?
Это мой код до сих пор
public static Map<String,Vector<String>> getAllPropsValues(byte[] fileContent){
//Some other code here
DataStore store = DataStoreFinder.getDataStore(fileContent); //<-- how to replace this line
SimpleFeatureSource featureSource = store.getFeatureSource();
FeatureCollection collection = featureSource.getFeatures();
FeatureIterator iterator = collection.features();
//other things here
}