Opened 17 years ago

Closed 17 years ago

#15 closed defect (fixed)

Missing Raster Extents

Reported by: warmerdam Owned by: warmerdam
Priority: major Milestone: 3.3.0
Component: GDAL Provider Version: 3.2.0
Severity: 2 Keywords:
Cc: External ID:

Description (last modified by warmerdam)

MapGuide does not know the default extents for raster data coming from the GDAL raster provider.

Traian reports:

You need to make sure that your FdoISpatialContextReader::GetExtent() returns correct extents for the rasters you are connected to. If it already does that, then we would have to dig deeper, but I think that should be sufficient. Fyi, this is what I am using in the OGR provider, and it works most of the time:

FdoByteArray* OgrSpatialContextReader::GetExtent()
{
OGREnvelope e;
/*OGRErr err =*/ m_connection->GetOGRDataSource()->GetLayer(m_nIndex)->GetExtent(&e, TRUE);
 
//generate FGF polygon and return as refcounted byte array
double coords[10];
coords[0] = e.MinX;
coords[1] = e.MinY;
coords[2] = e.MaxX;
coords[3] = e.MinY;
coords[4] = e.MaxX;
coords[5] = e.MaxY;
coords[6] = e.MinX;
coords[7] = e.MaxY;
coords[8] = e.MinX;
coords[9] = e.MinY;
FdoPtr<FdoFgfGeometryFactory> gf = FdoFgfGeometryFactory::GetInstance();
FdoPtr<FdoILinearRing> lr = gf->CreateLinearRing(FdoDimensionality_XY, 10, coords);
FdoPtr<FdoIPolygon> fgfgeom = gf->CreatePolygon(lr, NULL);
return gf->GetFgf(fgfgeom);
}

Change History (3)

comment:1 by warmerdam, 17 years ago

Description: modified (diff)

comment:2 by warmerdam, 17 years ago

Status: newassigned

In r2610 I made lots of changes to capture spatial references and extents properly in trunk. I think the changes are too comprehensive to migrate into 3.2.x branch and will attempt a narrow change to return proper extents without completly overhauling spatial reference handling.

At this point there are still several unit tests failing, mainly due to the fact that the pci_eg directory has files in a variety of coordinate system, and this isn't allowed in a single FDO feature class where all features (apparently) must have the same coordinate system.

comment:3 by warmerdam, 17 years ago

Resolution: fixed
Status: assignedclosed

I have modified the 3.2.x branch in the fdogdal repository in r101 and r102.

r101 captures the extents as files are scanned.

r102 modifies the default spatial context "coordsys" and "wkt" values so that mapguide will consider it valid for the purposes of examining the extent.

With these changes 3.2.x now supports default raster extents in studio and mgos.

Thanks to Traian for identifying the "name" issue.

Note: See TracTickets for help on using tickets.