| | |
| | | public class GdbHelper { |
| | | private final static Log log = LogFactory.getLog(GdbHelper.class); |
| | | |
| | | public static List<String> excludeFields = new ArrayList<String>(); |
| | | |
| | | static { |
| | | excludeFields.add("gid"); |
| | | excludeFields.add("shape_leng"); |
| | | } |
| | | |
| | | /** |
| | | * 获取表名 |
| | | */ |
| | |
| | | FieldDefn fieldDefn = fd.GetFieldDefn(i); |
| | | try { |
| | | String name = fieldDefn.GetName().toLowerCase(); |
| | | if ("gid".equals(name)) { |
| | | if (excludeFields.contains(name)){ |
| | | continue; |
| | | } |
| | | |
| | |
| | | |
| | | /** |
| | | * 设置 geom 字段值 |
| | | * |
| | | * <p> |
| | | * wkbUnknown = 0, |
| | | * wkbPoint = 1, |
| | | * wkbLineString = 2, |
| | |
| | | String wkt = geometry.ExportToWkt(); |
| | | switch (geometry.GetGeometryType()) { |
| | | case 2: |
| | | wkt = wkt.replace("LINESTRING (", "MultiLINESTRING ((") + ")"; |
| | | wkt = wkt.replace("LINESTRING (", "MULTILINESTRING ((") + ")"; |
| | | break; |
| | | case 3: |
| | | wkt = wkt.replace("POLYGON (", "LINESTRINGPOLYGON ((") + ")"; |
| | | wkt = wkt.replace("POLYGON (", "MULTIPOLYGON ((") + ")"; |
| | | break; |
| | | default: |
| | | break; |