本文整理汇总了C++中Sector::intersection方法的典型用法代码示例。如果您正苦于以下问题:C++ Sector::intersection方法的具体用法?C++ Sector::intersection怎么用?C++ Sector::intersection使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sector
的用法示例。
在下文中一共展示了Sector::intersection方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getFeatureInfoURL
URL WMSLayer::getFeatureInfoURL(const Geodetic2D& position,
const Sector& tileSector) const {
if (!_sector.touchesWith(tileSector)) {
return URL::nullURL();
}
const Sector sector = tileSector.intersection(_sector);
//Server name
std::string req = _queryServerURL.getPath();
if (req[req.size()-1] != '?') {
req += '?';
}
//If the server refer to itself as localhost...
int pos = req.find("localhost");
if (pos != -1) {
req = req.substr(pos+9);
int pos2 = req.find("/", 8);
std::string newHost = req.substr(0, pos2);
req = newHost + req;
}
req += "REQUEST=GetFeatureInfo&SERVICE=WMS";
//SRS
if (_srs != "") {
req += "&SRS=" + _srs;
}
else {
req += "&SRS=EPSG:4326";
}
switch (_queryServerVersion) {
case WMS_1_3_0:
{
req += "&VERSION=1.3.0";
IStringBuilder* isb = IStringBuilder::newStringBuilder();
isb->addString("&WIDTH=");
isb->addInt(_parameters->_tileTextureResolution._x);
isb->addString("&HEIGHT=");
isb->addInt(_parameters->_tileTextureResolution._y);
isb->addString("&BBOX=");
isb->addDouble( toBBOXLatitude( sector._lower._latitude ) );
isb->addString(",");
isb->addDouble( toBBOXLongitude( sector._lower._longitude ) );
isb->addString(",");
isb->addDouble( toBBOXLatitude( sector._upper._latitude ) );
isb->addString(",");
isb->addDouble( toBBOXLongitude( sector._upper._longitude ) );
req += isb->getString();
delete isb;
req += "&CRS=EPSG:4326";
break;
}
case WMS_1_1_0:
default:
{
// default is 1.1.1
req += "&VERSION=1.1.1";
IStringBuilder* isb = IStringBuilder::newStringBuilder();
isb->addString("&WIDTH=");
isb->addInt(_parameters->_tileTextureResolution._x);
isb->addString("&HEIGHT=");
isb->addInt(_parameters->_tileTextureResolution._y);
isb->addString("&BBOX=");
isb->addDouble( toBBOXLongitude( sector._lower._longitude ) );
isb->addString(",");
isb->addDouble( toBBOXLatitude( sector._lower._latitude ) );
isb->addString(",");
isb->addDouble( toBBOXLongitude( sector._upper._longitude ) );
isb->addString(",");
isb->addDouble( toBBOXLatitude( sector._upper._latitude ) );
req += isb->getString();
delete isb;
break;
}
}
req += "&LAYERS=" + _queryLayer;
req += "&QUERY_LAYERS=" + _queryLayer;
req += "&INFO_FORMAT=text/plain";
const IMathUtils* mu = IMathUtils::instance();
double u;
//.........这里部分代码省略.........
示例2: switch
std::vector<Petition*> WMSLayer::createTileMapPetitions(const G3MRenderContext* rc,
const Tile* tile) const {
std::vector<Petition*> petitions;
const Sector tileSector = tile->getSector();
if (!_sector.touchesWith(tileSector)) {
return petitions;
}
const Sector sector = tileSector.intersection(_sector);
if (sector._deltaLatitude.isZero() ||
sector._deltaLongitude.isZero() ) {
return petitions;
}
//TODO: MUST SCALE WIDTH,HEIGHT
const Vector2I tileTextureResolution = _parameters->_tileTextureResolution;
//Server name
std::string req = _mapServerURL.getPath();
if (req[req.size() - 1] != '?') {
req += '?';
}
// //If the server refer to itself as localhost...
// const int localhostPos = req.find("localhost");
// if (localhostPos != -1) {
// req = req.substr(localhostPos+9);
//
// const int slashPos = req.find("/", 8);
// std::string newHost = req.substr(0, slashPos);
//
// req = newHost + req;
// }
req += "REQUEST=GetMap&SERVICE=WMS";
switch (_mapServerVersion) {
case WMS_1_3_0:
{
req += "&VERSION=1.3.0";
IStringBuilder* isb = IStringBuilder::newStringBuilder();
isb->addString("&WIDTH=");
isb->addInt(tileTextureResolution._x);
isb->addString("&HEIGHT=");
isb->addInt(tileTextureResolution._y);
isb->addString("&BBOX=");
isb->addDouble( toBBOXLatitude( sector._lower._latitude ) );
isb->addString(",");
isb->addDouble( toBBOXLongitude( sector._lower._longitude ) );
isb->addString(",");
isb->addDouble( toBBOXLatitude( sector._upper._latitude ) );
isb->addString(",");
isb->addDouble( toBBOXLongitude( sector._upper._longitude ) );
req += isb->getString();
delete isb;
req += "&CRS=EPSG:4326";
break;
}
case WMS_1_1_0:
default:
{
// default is 1.1.1
req += "&VERSION=1.1.1";
IStringBuilder* isb = IStringBuilder::newStringBuilder();
isb->addString("&WIDTH=");
isb->addInt(tileTextureResolution._x);
isb->addString("&HEIGHT=");
isb->addInt(tileTextureResolution._y);
isb->addString("&BBOX=");
isb->addDouble( toBBOXLongitude( sector._lower._longitude ) );
isb->addString(",");
isb->addDouble( toBBOXLatitude( sector._lower._latitude ) );
isb->addString(",");
isb->addDouble( toBBOXLongitude( sector._upper._longitude ) );
isb->addString(",");
isb->addDouble( toBBOXLatitude( sector._upper._latitude ) );
req += isb->getString();
delete isb;
break;
}
}
req += "&LAYERS=" + _mapLayer;
req += "&FORMAT=" + _format;
if (_srs != "") {
//.........这里部分代码省略.........
示例3: Petition
std::vector<Petition*> GoogleMapsLayer::createTileMapPetitions(const G3MRenderContext* rc,
const Tile* tile) const {
std::vector<Petition*> petitions;
const Sector tileSector = tile->getSector();
if (!_sector.touchesWith(tileSector)) {
return petitions;
}
const Sector sector = tileSector.intersection(_sector);
if (sector._deltaLatitude.isZero() ||
sector._deltaLongitude.isZero() ) {
return petitions;
}
IStringBuilder* isb = IStringBuilder::newStringBuilder();
// http://maps.googleapis.com/maps/api/staticmap?center=New+York,NY&zoom=13&size=600x300&key=AIzaSyC9pospBjqsfpb0Y9N3E3uNMD8ELoQVOrc&sensor=false
/*
http://maps.googleapis.com/maps/api/staticmap
?center=New+York,NY
&zoom=13
&size=600x300
&key=AIzaSyC9pospBjqsfpb0Y9N3E3uNMD8ELoQVOrc
&sensor=false
*/
isb->addString("http://maps.googleapis.com/maps/api/staticmap?sensor=false");
isb->addString("¢er=");
isb->addDouble(tileSector._center._latitude._degrees);
isb->addString(",");
isb->addDouble(tileSector._center._longitude._degrees);
const int level = tile->getLevel();
isb->addString("&zoom=");
isb->addInt(level);
isb->addString("&size=");
isb->addInt(_parameters->_tileTextureResolution._x);
isb->addString("x");
isb->addInt(_parameters->_tileTextureResolution._y);
isb->addString("&format=jpg");
// isb->addString("&maptype=roadmap);
// isb->addString("&maptype=satellite");
isb->addString("&maptype=hybrid");
// isb->addString("&maptype=terrain");
isb->addString("&key=");
isb->addString(_key);
const std::string path = isb->getString();
delete isb;
petitions.push_back( new Petition(tileSector,
URL(path, false),
getTimeToCache(),
getReadExpired(),
true) );
return petitions;
}