Ticket #968 (closed defect: fixed)

Opened 4 years ago

Last modified 4 years ago

Preview FeatureSource depends on Aggregates

Reported by: ksgeograf Owned by: brucedechant
Priority: low Milestone: 2.1
Component: General Version: 2.0.2
Severity: trivial Keywords: preview viewer aggregate OGR extent
Cc: brucedechant External ID:

Description (last modified by brucedechant) (diff)

The FeatureSource Preview has been updated to use the actual contents of the datasource for determining the preview extent. This is optimal for most FeatureSources, but some providers (like the OGR provider) does not support the requested aggregates.

There should be a fallback method to use the spatial extent from the spatial context, if the aggregate function fails, as that is better than no preview at all (and actually correct for the OGR provider).

Attachments

Fallback for feature preview.patch Download (1.4 KB) - added by ksgeograf 4 years ago.
Correct fallback to spatial extents if aggregates fail

Change History

Changed 4 years ago by tomfukushima

  • cc brucedechant added

Changed 4 years ago by brucedechant

There is code for the failback method still there.

I tried using the OGR provider to connect to a SHP file (Sample World Countries) and I get back a useless SpatialContext?. Here are the results:

<?xml version="1.0" encoding="UTF-8"?> <FdoSpatialContextList?> <ProviderName?></ProviderName> </FdoSpatialContextList>

In the above the provider isn't even listed. The interesting thing is that I can use the feature source preview to see the attribute data just fine. So at least the OGR provider appears to be partially working, but there looks to be a bug in the OGR provider for returning spatial context information.

So even if the SelectAggregates? call fails there is no spatial context information to fall back on and so the preview still fails.

Changed 4 years ago by ksgeograf

Odd results, I tried it on a .TAB file, and got back a result (see below).

I see the fallback in showgeom.php, but it does not work because the operation throws an exception. I will attach a patch.

<?xml version="1.0"?>
<FdoSpatialContextList xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xsi:noNamespaceSchemaLocation="FdoSpatialContextList-1.0.0.xsd">
  <ProviderName>OSGeo.OGR.3.4</ProviderName>
  <SpatialContext IsActive="true">
    <Name>Brugsgraense</Name>
    <Description />
    <CoordinateSystemName>PROJCS["unnamed",GEOGCS["unnamed",DATUM["Euref_98",SPHEROID["GRS 80",6378137,298.257222101],TOWGS84[0,0,0,-0,-0,-0,0]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",9],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["Meter",1.0]]</CoordinateSystemName>
    <CoordinateSystemWkt>PROJCS["unnamed",GEOGCS["unnamed",DATUM["Euref_98",SPHEROID["GRS 80",6378137,298.257222101],TOWGS84[0,0,0,-0,-0,-0,0]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",9],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["Meter",1.0]]</CoordinateSystemWkt>
    <ExtentType>Dynamic</ExtentType>
    <Extent>
      <LowerLeftCoordinate>
        <X>678681.08834935876</X>
        <Y>6178990.4343695538</Y>
      </LowerLeftCoordinate>
      <UpperRightCoordinate>
        <X>702478.16620384331</X>
        <Y>6202927.0221463479</Y>
      </UpperRightCoordinate>
    </Extent>
    <XYTolerance>0</XYTolerance>
    <ZTolerance>0</ZTolerance>
  </SpatialContext>
</FdoSpatialContextList>

Changed 4 years ago by ksgeograf

Correct fallback to spatial extents if aggregates fail

Changed 4 years ago by ksgeograf

With the attached patch applied, the preview works correctly for me.

Changed 4 years ago by brucedechant

  • owner set to brucedechant
  • status changed from new to assigned

Thanks for the patch.

I'll give it a try and submit once done.

Changed 4 years ago by brucedechant

  • version changed from 2.1.0 to 2.0.2
  • milestone set to 2.1

Changed 4 years ago by brucedechant

  • status changed from assigned to closed
  • resolution set to fixed
  • description modified (diff)

Fixed.

See changeset r3831

Note: See TracTickets for help on using tickets.