Skip to content

Commit

Permalink
use configured srid in blob mode
Browse files Browse the repository at this point in the history
  • Loading branch information
lgoltz committed Aug 2, 2023
1 parent df806dc commit a19e559
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1666,12 +1666,12 @@ private Map<FeatureType, FeatureTypeMapping> collectFeatureTypesAndMappings(List

private AbstractWhereBuilder getWhereBuilderBlob(OperatorFilter filter, Connection conn)
throws FilterEvaluationException, UnmappableException {
final String undefinedSrid = dialect.getUndefinedSrid();
final String srid = detectConfiguredSrid();
PropertyNameMapper mapper = new PropertyNameMapper() {
@Override
public PropertyNameMapping getMapping(ValueReference propName, TableAliasManager aliasManager)
throws FilterEvaluationException, UnmappableException {
GeometryStorageParams geometryParams = new GeometryStorageParams(blobMapping.getCRS(), undefinedSrid,
GeometryStorageParams geometryParams = new GeometryStorageParams(blobMapping.getCRS(), srid,
CoordinateDimension.DIM_2);
GeometryMapping bboxMapping = new GeometryMapping(null, false, new DBField(blobMapping.getBBoxColumn()),
GeometryType.GEOMETRY, geometryParams, null);
Expand All @@ -1688,6 +1688,13 @@ public PropertyNameMapping getSpatialMapping(ValueReference propName, TableAlias
return dialect.getWhereBuilder(mapper, filter, null, null, allowInMemoryFiltering);
}

private String detectConfiguredSrid() {
if (this.config.getStorageCRS() != null && this.config.getStorageCRS().getSrid() != null) {
return this.config.getStorageCRS().getSrid();
}
return dialect.getUndefinedSrid();
}

public SQLDialect getDialect() {
return dialect;
}
Expand Down

0 comments on commit a19e559

Please sign in to comment.