Opened 13 years ago
Closed 13 years ago
#2001 closed defect (invalid)
Spatial Contexts are overridden incorrectly
Reported by: | jng | Owned by: | |
---|---|---|---|
Priority: | high | Milestone: | 2.4 |
Component: | Feature Service | Version: | 2.2.0 |
Severity: | blocker | Keywords: | |
Cc: | External ID: |
Description
Consider this example output (GetSpatialContexts) of an ODBC feature source with no coordinate system overrides:
<?xml version="1.0" encoding="UTF-8"?> <FdoSpatialContextList> <ProviderName>OSGeo.ODBC.3.5</ProviderName> <SpatialContext IsActive="false"> <Name>Default</Name> <Description/> <CoordinateSystemName/> <CoordinateSystemWkt/> <ExtentType>Static</ExtentType> <Extent> <LowerLeftCoordinate> <X>-2000000</X> <Y>-2000000</Y> </LowerLeftCoordinate> <UpperRightCoordinate> <X>2000000</X> <Y>2000000</Y> </UpperRightCoordinate> </Extent> <XYTolerance>0.001000</XYTolerance> <ZTolerance>0.001000</ZTolerance> </SpatialContext> </FdoSpatialContextList>
Here's what the output looks like with a coordinate system override on the "Default" spatial context
<?xml version="1.0" encoding="UTF-8"?> <FdoSpatialContextList> <ProviderName>OSGeo.ODBC.3.5</ProviderName> <SpatialContext IsActive="false"> <Name>GEOGCS["LL84",DATUM["WGS84",SPHEROID["WGS84",6378137.000,298.25722293]],PRIMEM["Greenwich",0],UNIT["Degree",0.01745329251994]]</Name> <Description>This coordinate system has been overridden.</Description> <CoordinateSystemName>Default</CoordinateSystemName> <CoordinateSystemWkt>GEOGCS["LL84",DATUM["WGS84",SPHEROID["WGS84",6378137.000,298.25722293]],PRIMEM["Greenwich",0],UNIT["Degree",0.01745329251994]]</CoordinateSystemWkt> <ExtentType>Static</ExtentType> <Extent> <LowerLeftCoordinate> <X>-2000000</X> <Y>-2000000</Y> </LowerLeftCoordinate> <UpperRightCoordinate> <X>2000000</X> <Y>2000000</Y> </UpperRightCoordinate> </Extent> <XYTolerance>0.001000</XYTolerance> <ZTolerance>0.001000</ZTolerance> </SpatialContext> </FdoSpatialContextList>
This output is wrong because the name component of the spatial context is the unique key by which Geometry Properties in a class definition use to look up a particular spatial context (via its SpatialContextAssociation).
The most evident symptom of this issue is attempting to preview such a Feature Class from a Feature Source (w/ overrides) via the schema report. The preview will fail because it tries to fetch extents via the geometry property's spatial context association. Because the CS override clobbers the name, no matching spatial context is found, resulting in a empty extent, therefore no preview is possible.
Similarly, any function that involves spatial context lookup via it's geometry property is also affected by this incorrect overrides.
The fix is simply to never modify the name of the spatial context if overrides are to be applied
Chalk up another invalid ticket due to bad data!