Opened 17 years ago

Last modified 17 years ago

#15 closed defect

Missing Raster Extents — at Initial Version

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

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 (0)

Note: See TracTickets for help on using tickets.