[英]How can I convert base64 binary data into wkb - well known binary?
我陷入了使用shptosql将基本64位二进制文件转换为sql服务器的转换。 现在我想将数据转换为支持wkb的二进制文件postgres。 如何将base64字节转换为Java中众所周知的二进制支持格式? 我已经解码了base64,但是wkb仍然离我很远。
第4部分:将wkb存储在postgresSQL中
File f = new File(request.getRealPath("/")+"themes\\\\ProfileImages\\\\temp.xml"); ArrayList<byte[]> byteArray = new ArrayList<byte[]>(); if(f.exists()){ List<String> list = geoserver.getShapes(f); for(String s : list){ BASE64Decoder decoder = new BASE64Decoder(); byte[] decodedBytes=null; try { decodedBytes = decoder.decodeBuffer(s); byteArray.add(decodedBytes); //Here I want to convert bytes to wkb format and want to save in postgres } catch (IOException e) { e.printStackTrace(); } } List<String> objects =geoserver.getObjectIds(f); List<ShapeFile> shapes = new ArrayList<ShapeFile>(); for(int i=0;i<byteArray.size();i++){ try { shapes.add(new ShapeFile(objects.get(i), byteArray.get(i),IOUtils.toString(byteArray.get(i)))); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } }
第三部分留给我。
有人可以告诉我如何以及使用哪些库吗?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.