| | |
| | | package com.lf.server.helper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.lf.server.entity.all.BaseGeoEntity; |
| | | import com.lf.server.entity.all.StaticData; |
| | | import com.lf.server.mapper.all.BasicMapper; |
| | |
| | | field.set(t, f.GetFieldAsInteger(i)); |
| | | break; |
| | | case "java.sql.Timestamp": |
| | | field.set(t, getTimestamp(f, i)); |
| | | Timestamp ts = getTimestamp(f, i); |
| | | if (null != ts) { |
| | | field.set(t, ts); |
| | | } |
| | | break; |
| | | case "java.time.LocalDate": |
| | | field.set(t, getLocalDate(f, i)); |
| | | LocalDate ld = getLocalDate(f, i); |
| | | if (null != ld) { |
| | | field.set(t, ld); |
| | | } |
| | | break; |
| | | default: |
| | | field.set(t, f.GetFieldAsString(i)); |
| | |
| | | String geo = "null"; |
| | | if (null != f.GetGeometryRef()) { |
| | | String wkt = f.GetGeometryRef().ExportToWkt(); |
| | | // noinspection AlibabaRemoveCommentedCode |
| | | switch (f.GetGeometryRef().GetGeometryType()) { |
| | | //case 1: |
| | | // wkt = wkt.replace("POINT", "MULTIPOINT"); |
| | | // break; |
| | | case 2: |
| | | wkt = wkt.replace("LINESTRING (", "MULTILINESTRING ((") + ")"; |
| | | break; |
| | | case 3: |
| | | wkt = wkt.replace("POLYGON (", "MULTIPOLYGON ((") + ")"; |
| | | break; |
| | | default: |
| | | break; |
| | | // f.GetGeometryRef().GetGeometryType() |
| | | if (wkt.contains("LINESTRING") && !wkt.contains("MULTILINESTRING")) { |
| | | wkt = wkt.replace("LINESTRING (", "MULTILINESTRING ((") + ")"; |
| | | } |
| | | if (wkt.contains("POLYGON") && !wkt.contains("MULTIPOLYGON")) { |
| | | wkt = wkt.replace("POLYGON (", "MULTIPOLYGON ((") + ")"; |
| | | } |
| | | wkt = wkt.replace(" 0,", ",").replace(" 0)", ")"); |
| | | |
| | | geo = String.format("ST_GeomFromText('%s')", wkt); |
| | | } |
| | | |