File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2424use PhpMyAdmin \Plugins \ImportPlugin ;
2525use PhpMyAdmin \Properties \Plugins \ImportPluginProperties ;
2626use PhpMyAdmin \Sanitize ;
27+ use PhpMyAdmin \ShapeFile \ShapeType ;
2728use PhpMyAdmin \ZipExtension ;
2829use ZipArchive ;
2930
@@ -99,7 +100,7 @@ public function doImport(File|null $importHandle = null): array
99100
100101 $ compression = $ importHandle ->getCompression ();
101102
102- $ shp = new ShapeFileImport (1 );
103+ $ shp = new ShapeFileImport (ShapeType::Point );
103104 // If the zip archive has more than one file,
104105 // get the correct content to the buffer from .shp file.
105106 if (
@@ -183,23 +184,18 @@ public function doImport(File|null $importHandle = null): array
183184 }
184185
185186 switch ($ shp ->shapeType ) {
186- // ESRI Null Shape
187- case 0 :
187+ case ShapeType::Null:
188188 break ;
189- // ESRI Point
190- case 1 :
189+ case ShapeType::Point:
191190 $ gisType = 'point ' ;
192191 break ;
193- // ESRI PolyLine
194- case 3 :
192+ case ShapeType::PolyLine:
195193 $ gisType = 'multilinestring ' ;
196194 break ;
197- // ESRI Polygon
198- case 5 :
195+ case ShapeType::Polygon:
199196 $ gisType = 'multipolygon ' ;
200197 break ;
201- // ESRI MultiPoint
202- case 8 :
198+ case ShapeType::MultiPoint:
203199 $ gisType = 'multipoint ' ;
204200 break ;
205201 default :
You can’t perform that action at this time.
0 commit comments