void GDALWMSMiniDriver_TileService::TiledImageRequest(CPLString *url, const GDALWMSImageRequestInfo &iri, const GDALWMSTiledImageRequestInfo &tiri) {
    // http://s0.tileservice.worldwindcentral.com/getTile?interface=map&version=1&dataset=bmng.topo.bathy.200401&level=5&x=18&y=6
    *url = m_base_url;
    URLAppend(url, "&interface=map");
    URLAppendF(url, "&version=%s", m_version.c_str());
    URLAppendF(url, "&dataset=%s", m_dataset.c_str());
    URLAppendF(url, "&level=%d", tiri.m_level);
    URLAppendF(url, "&x=%d", tiri.m_x);
    URLAppendF(url, "&y=%d", tiri.m_y);
}
void GDALWMSMiniDriver_WorldWind::TiledImageRequest(CPLString *url, const GDALWMSImageRequestInfo &iri, const GDALWMSTiledImageRequestInfo &tiri) {
    const GDALWMSDataWindow *data_window = m_parent_dataset->WMSGetDataWindow();
    int worldwind_y = static_cast<int>(floor(((data_window->m_y1 - data_window->m_y0) / (iri.m_y1 - iri.m_y0)) + 0.5)) - tiri.m_y - 1;
    // http://worldwind25.arc.nasa.gov/tile/tile.aspx?T=geocover2000&L=0&X=86&Y=39
    *url = m_base_url;
    URLAppendF(url, "&T=%s", m_dataset.c_str());
    URLAppendF(url, "&L=%d", tiri.m_level);
    URLAppendF(url, "&X=%d", tiri.m_x);
    URLAppendF(url, "&Y=%d", worldwind_y);
}
Exemplo n.º 3
0
void GDALWMSMiniDriver_WMS::GetTiledImageInfo(CPLString *url,
                                              const GDALWMSImageRequestInfo &iri,
                                              CPL_UNUSED const GDALWMSTiledImageRequestInfo &tiri,
                                              int nXInBlock,
                                              int nYInBlock)
{
    BuildURL(url, iri, "GetFeatureInfo");
    URLAppendF(url, "&query_layers=%s", m_layers.c_str());
    URLAppendF(url, "&x=%d", nXInBlock);
    URLAppendF(url, "&y=%d", nYInBlock);
    const char* pszInfoFormat = CPLGetConfigOption("WMS_INFO_FORMAT", "application/vnd.ogc.gml");
    URLAppendF(url, "&info_format=%s", pszInfoFormat);

    CPLDebug("WMS", "URL = %s", url->c_str());
}
Exemplo n.º 4
0
void GDALWMSMiniDriver_WMS::ImageRequest(CPLString *url, const GDALWMSImageRequestInfo &iri) {
    // http://onearth.jpl.nasa.gov/wms.cgi?request=GetMap&width=1000&height=500&layers=modis,global_mosaic&styles=&srs=EPSG:4326&format=image/jpeg&bbox=-180.000000,-90.000000,180.000000,090.000000    
    *url = m_base_url;
    URLAppend(url, "&request=GetMap");
    URLAppendF(url, "&version=%s", m_version.c_str());
    URLAppendF(url, "&layers=%s", m_layers.c_str());
    URLAppendF(url, "&styles=%s", m_styles.c_str());
    if (m_srs.size()) URLAppendF(url, "&srs=%s", m_srs.c_str());
    if (m_crs.size()) URLAppendF(url, "&crs=%s", m_crs.c_str());
    if (m_transparent.size()) URLAppendF(url, "&transparent=%s", m_transparent.c_str());
    URLAppendF(url, "&format=%s", m_image_format.c_str());
    URLAppendF(url, "&width=%d", iri.m_sx);
    URLAppendF(url, "&height=%d", iri.m_sy);
    URLAppendF(url, "&bbox=%.8f,%.8f,%.8f,%.8f", 
        GetBBoxCoord(iri, m_bbox_order[0]), GetBBoxCoord(iri, m_bbox_order[1]), 
        GetBBoxCoord(iri, m_bbox_order[2]), GetBBoxCoord(iri, m_bbox_order[3]));
    CPLDebug("WMS", "URL = %s", url->c_str());
}
Exemplo n.º 5
0
void GDALWMSMiniDriver_AGS::GetTiledImageInfo(CPLString *url,
                                              const GDALWMSImageRequestInfo &iri,
                                              CPL_UNUSED const GDALWMSTiledImageRequestInfo &tiri,
                                              int nXInBlock,
                                              int nYInBlock)
{
    *url = m_base_url;

    if (m_base_url.ifind( "/identify?") == std::string::npos)
        URLAppend(url, "/identify?");

	URLAppendF(url, "&f=json");

	double fX = GetBBoxCoord(iri, 'x') + nXInBlock * (GetBBoxCoord(iri, 'X') - 
	            GetBBoxCoord(iri, 'x')) / iri.m_sx;
	double fY = GetBBoxCoord(iri, 'y') + (iri.m_sy - nYInBlock) * (GetBBoxCoord(iri, 'Y') - 
	            GetBBoxCoord(iri, 'y')) / iri.m_sy;
	            
    URLAppendF(url, "&geometry=%8f,%8f", fX, fY);
	URLAppendF(url, "&geometryType=esriGeometryPoint");

	URLAppendF(url, "&sr=%s", m_irs.c_str());
	URLAppendF(url, "&layerdefs=");
	URLAppendF(url, "&time=");
	URLAppendF(url, "&layerTimeOptions=");

	CPLString layers("visible");
	if ( m_layers.find("show") != std::string::npos )
	{
		layers = m_layers;
		layers.replace( layers.find("show"), 4, "all" );
	}
	
	if ( m_layers.find("hide") != std::string::npos )
	{
		layers = "top";
	}
	
	if ( m_layers.find("include") != std::string::npos )
	{
		layers = "top";
	}
	
	if ( m_layers.find("exclude") != std::string::npos )
	{
		layers = "top";
	}

	URLAppendF(url, "&layers=%s", layers.c_str());

	URLAppendF(url, "&tolerance=%s", m_identification_tolerance.c_str());
	URLAppendF(url, "&mapExtent=%.8f,%.8f,%.8f,%.8f", 
		GetBBoxCoord(iri, m_bbox_order[0]), GetBBoxCoord(iri, m_bbox_order[1]), 
        GetBBoxCoord(iri, m_bbox_order[2]), GetBBoxCoord(iri, m_bbox_order[3]));
	URLAppendF(url, "&imageDisplay=%d,%d,96", iri.m_sx,iri.m_sy);
	URLAppendF(url, "&returnGeometry=false");

	URLAppendF(url, "&maxAllowableOffset=");
    CPLDebug("AGS", "URL = %s", url->c_str());
}
Exemplo n.º 6
0
void GDALWMSMiniDriver_AGS::ImageRequest(CPLString *url, const GDALWMSImageRequestInfo &iri) 
{
    *url = m_base_url;

    if (m_base_url.ifind( "/export?") == std::string::npos)
        URLAppend(url, "/export?");
	
	URLAppendF(url, "&f=image");
	URLAppendF(url, "&bbox=%.8f,%.8f,%.8f,%.8f", 
		GetBBoxCoord(iri, m_bbox_order[0]), GetBBoxCoord(iri, m_bbox_order[1]), 
        GetBBoxCoord(iri, m_bbox_order[2]), GetBBoxCoord(iri, m_bbox_order[3]));
	URLAppendF(url, "&size=%d,%d", iri.m_sx,iri.m_sy);
	URLAppendF(url, "&dpi=");
	URLAppendF(url, "&imageSR=%s", m_irs.c_str());
	URLAppendF(url, "&bboxSR=%s", m_irs.c_str());
	URLAppendF(url, "&format=%s", m_image_format.c_str());

	URLAppendF(url, "&layerdefs=");
	URLAppendF(url, "&layers=%s", m_layers.c_str());

    if(m_transparent.size())
	    URLAppendF(url, "&transparent=%s", m_transparent.c_str());
    else
        URLAppendF(url, "&transparent=%s", "false");
        
	URLAppendF(url, "&time=");
	URLAppendF(url, "&layerTimeOptions=");
	URLAppendF(url, "&dynamicLayers=");

	CPLDebug("AGS", "URL = %s\n", url->c_str());
}