Преглед на файлове

余杭一张图 属性识别

liutao преди 2 месеца
родител
ревизия
53f9f729f9
променени са 3 файла, в които са добавени 321 реда и са изтрити 161 реда
  1. 3 3
      YHYZT/client/src/components/ol/ShpParser.vue
  2. 315 155
      YHYZT/client/src/views/DataCenter.vue
  3. 3 3
      YHYZT/client/src/views/DataCenter/ReadCoordinates.vue

+ 3 - 3
YHYZT/client/src/components/ol/ShpParser.vue

@@ -37,7 +37,7 @@
 import { open as shapeOpen,openDbf as dbfOpen } from 'shapefile'
 import proj4 from 'proj4'
 import { GeoJSON } from 'ol/format'
-import GeometryType from 'ol/geom/GeometryType'
+// import GeometryType from 'ol/geom/GeometryType'
 import { MultiPolygon } from 'ol/geom'
 import { createTransformFromCoordinateTransform, Projection } from 'ol/proj'
 import * as zip from '@zip.js/zip.js/dist/zip'
@@ -202,9 +202,9 @@ export default {
 
       const flatMap = geometrys.flatMap(i => {
         // console.log(i, typeof i, 'i')
-        if (i.getType() === GeometryType.POLYGON) {
+        if (i.getType() === "Polygon") {
           return [i]
-        } else if (i.getType() === GeometryType.MULTI_POLYGON) {
+        } else if (i.getType() === "MultiPolygon") {
           return i.getPolygons()
         } else {
           console.error('unsupport type')

Файловите разлики са ограничени, защото са твърде много
+ 315 - 155
YHYZT/client/src/views/DataCenter.vue


+ 3 - 3
YHYZT/client/src/views/DataCenter/ReadCoordinates.vue

@@ -39,7 +39,7 @@
 import { open as shapeOpen,openDbf as dbfOpen } from 'shapefile'
 import proj4 from 'proj4'
 import { GeoJSON } from 'ol/format'
-import GeometryType from 'ol/geom/GeometryType'
+// import GeometryType from 'ol/geom/GeometryType'
 import { MultiPolygon } from 'ol/geom'
 import { createTransformFromCoordinateTransform, Projection,transform } from 'ol/proj'
 import * as zip from '@zip.js/zip.js/dist/zip'
@@ -191,9 +191,9 @@ export default {
       const geometrys = featureJsons.map(i => new GeoJSON().readGeometry(i.geometry))
       const flatMap = geometrys.flatMap(i => {
         // console.log(i, typeof i, 'i')
-        if (i.getType() === GeometryType.POLYGON) {
+        if (i.getType() ==="Polygon") {
           return [i]
-        } else if (i.getType() === GeometryType.MULTI_POLYGON) {
+        } else if (i.getType() === "MultiPolygon") {
           return i.getPolygons()
         } else {
           console.error('unsupport type')

Някои файлове не бяха показани, защото твърде много файлове са промени