Skip to content

Commit d1bf5d2

Browse files
committed
rollback
1 parent ec1357c commit d1bf5d2

1 file changed

Lines changed: 0 additions & 26 deletions

File tree

src/common-utils/src/data-type.ts

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -11,27 +11,6 @@ import {h3IsValid} from './h3-utils';
1111

1212
const H3_ANALYZER_TYPE = 'H3';
1313

14-
// Returns true if the value is likely a WKT geometry string (heuristic check).
15-
const WKT_PREFIX_RE =
16-
/^(?:SRID=\d+\s*;\s*)?(?:POINT|LINESTRING|POLYGON|MULTIPOINT|MULTILINESTRING|MULTIPOLYGON|GEOMETRYCOLLECTION)(?:\s+(?:Z|M|ZM))?\s*\(/i;
17-
18-
export function isWkt(value: unknown): boolean {
19-
if (typeof value !== 'string') {
20-
return false;
21-
}
22-
23-
const s = value.trim();
24-
if (s.length < 10) {
25-
return false;
26-
}
27-
28-
if (!s.includes('(') || !s.includes(')')) {
29-
return false;
30-
}
31-
32-
return WKT_PREFIX_RE.test(s);
33-
}
34-
3514
export const ACCEPTED_ANALYZER_TYPES = [
3615
AnalyzerDATA_TYPES.DATE,
3716
AnalyzerDATA_TYPES.TIME,
@@ -288,11 +267,6 @@ export function getFieldsFromData(data: RowData, fieldOrder: string[]): Field[]
288267
type = data.some(d => isHexWkb(d[name])) ? AnalyzerDATA_TYPES.GEOMETRY : type;
289268
}
290269

291-
// quick check if string is wkt
292-
if (type === AnalyzerDATA_TYPES.STRING) {
293-
type = data.some(d => isWkt(d[name])) ? AnalyzerDATA_TYPES.GEOMETRY_FROM_STRING : type;
294-
}
295-
296270
return {
297271
name,
298272
id: name,

0 commit comments

Comments
 (0)