{"record":{"id":"c073805e49f6bdf1","repo":"OtterMind/Chat2DB","slug":"nested-ewkb-srid-differs-from-its-parent","errorCode":null,"errorMessage":"Nested EWKB SRID differs from its parent","messagePattern":"Nested EWKB SRID differs from its parent","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"chat2db-community-server/chat2db-community-plugins/chat2db-community-postgresql/src/main/java/ai/chat2db/plugin/postgresql/value/sub/PostgreSQLGeometryProcessor.java","lineNumber":194,"sourceCode":"        ByteOrder byteOrder = readByteOrder(cursor);\n        int typeWord = cursor.readInt(byteOrder);\n        if ((typeWord & EWKB_BBOX_FLAG) != 0) {\n            throw new IllegalArgumentException(\"EWKB bounding-box headers are not supported\");\n        }\n\n        int isoType = typeWord & EWKB_TYPE_MASK;\n        int dimensionCode = isoType / 1000;\n        int baseType = isoType % 1000;\n        if (dimensionCode > 3 || baseType < 1 || baseType > 7) {\n            throw new IllegalArgumentException(\"Unsupported EWKB geometry type\");\n        }\n\n        boolean hasZ = (typeWord & EWKB_Z_FLAG) != 0 || dimensionCode == 1 || dimensionCode == 3;\n        boolean hasMeasure = (typeWord & EWKB_M_FLAG) != 0 || dimensionCode == 2 || dimensionCode == 3;\n        boolean hasSrid = (typeWord & EWKB_SRID_FLAG) != 0;\n        Integer srid = hasSrid ? cursor.readInt(byteOrder) : null;\n        if (!root && srid != null && !srid.equals(inheritedSrid)) {\n            throw new IllegalArgumentException(\"Nested EWKB SRID differs from its parent\");\n        }\n\n        WkbHeader header = new WkbHeader(baseType, hasZ, hasMeasure, srid);\n        int coordinateDimension = 2 + (hasZ ? 1 : 0) + (hasMeasure ? 1 : 0);\n        switch (baseType) {\n            case 1 -> inspectPoint(cursor, byteOrder, coordinateDimension);\n            case 2 -> inspectLineString(cursor, byteOrder, coordinateDimension);\n            case 3 -> {\n                int ringCount = readCount(cursor, byteOrder);\n                for (int i = 0; i < ringCount; i++) {\n                    inspectLinearRing(cursor, byteOrder, coordinateDimension);\n                }\n            }\n            case 4 -> inspectChildren(cursor, byteOrder, header, inheritedSrid, 1, depth);\n            case 5 -> inspectChildren(cursor, byteOrder, header, inheritedSrid, 2, depth);\n            case 6 -> inspectChildren(cursor, byteOrder, header, inheritedSrid, 3, depth);\n            case 7 -> inspectChildren(cursor, byteOrder, header, inheritedSrid, 0, depth);\n            default -> throw new IllegalArgumentException(\"Unsupported EWKB geometry type\");","sourceCodeStart":176,"sourceCodeEnd":212,"githubUrl":"https://github.com/OtterMind/Chat2DB/blob/5ee1e990e73fbcae1969dc554be254fedb3ab888/chat2db-community-server/chat2db-community-plugins/chat2db-community-postgresql/src/main/java/ai/chat2db/plugin/postgresql/value/sub/PostgreSQLGeometryProcessor.java#L176-L212","documentation":"Error \"Nested EWKB SRID differs from its parent\" thrown in OtterMind/Chat2DB.","triggerScenarios":"A nested EWKB geometry declared a different SRID than its enclosing collection.","commonSituations":"See trigger scenarios.","solutions":["Ensure all nested geometries share the same SRID as the parent collection, or remove SRIDs from children."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5ee1e990e73fbcae1969dc554be254fedb3ab888","analyzedAt":"2026-08-14T07:05:03.077Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}