Subversion Repositories public

Rev

Rev 284 | Rev 288 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 284 Rev 285
Line 204... Line 204...
204
	getCapabilities();
204
	getCapabilities();
205
}
205
}
206
 
206
 
207
void wmsSelectorWidget::slotDetails()
207
void wmsSelectorWidget::slotDetails()
208
{
208
{
-
 
209
int i;
-
 
210
 
209
	wmsCapabilitiesWidget *dlg = new wmsCapabilitiesWidget(this);
211
	wmsCapabilitiesWidget *dlg = new wmsCapabilitiesWidget(this);
-
 
212
	dlg->setName(Service.Name);
-
 
213
	dlg->setTitle(Service.Title);
-
 
214
	dlg->setAbstract(Service.Abstract);
-
 
215
	dlg->setOnline(Service.OnlineResource);
-
 
216
 
210
	dlg->setPerson(Service.ContactPerson);
217
	dlg->setPerson(Service.ContactPerson);
211
	dlg->setOrg(Service.ContactOrganisation);
218
	dlg->setOrg(Service.ContactOrganisation);
212
	dlg->setPhone(Service.ContactVoiceTelephone);
219
	dlg->setPhone(Service.ContactVoiceTelephone);
213
	dlg->setFax(Service.ContactFacsimileTelephone);
220
	dlg->setFax(Service.ContactFacsimileTelephone);
214
	dlg->setMail(Service.ContactElectronicMailAddress);
221
	dlg->setMail(Service.ContactElectronicMailAddress);
-
 
222
 
-
 
223
	dlg->setAddress(Service.Address);
-
 
224
	dlg->setCity(Service.City);
-
 
225
	dlg->setState(Service.StateOrProvince);
-
 
226
	dlg->setPostCode(Service.PostCode);
-
 
227
	dlg->setCountry(Service.Country);
-
 
228
 
215
	dlg->setCapabilitiesGet(Request.GetCapabilities.Get);
229
	dlg->setCapabilitiesGet(Request.GetCapabilities.Get);
216
	dlg->setCapabilitiesPost(Request.GetCapabilities.Post);
230
	dlg->setCapabilitiesPost(Request.GetCapabilities.Post);
217
 
231
 
218
	if (Request.GetCapabilities.Format.size() > 0)
232
	if (Request.GetCapabilities.Format.size() > 0)
219
	   dlg->setFormat(Request.GetCapabilities.Format.at(0));
233
	   dlg->setFormat(Request.GetCapabilities.Format.at(0));
220
 
234
 
221
	dlg->setMapGet(Request.GetMap.Get);
235
	dlg->setMapGet(Request.GetMap.Get);
222
	dlg->setMapPost(Request.GetMap.Post);
236
	dlg->setMapPost(Request.GetMap.Post);
223
 
237
 
224
	for (int i = 0; i < Request.GetMap.Format.size(); ++i)
238
	for (i = 0; i < Request.GetMap.Format.size(); ++i)
225
	   dlg->addFormats(Request.GetMap.Format.at(i));
239
	   dlg->addFormats(Request.GetMap.Format.at(i));
226
 
240
 
-
 
241
	for (i = 0; i < Request.GetFeatureInfo.Format.size(); ++i)
-
 
242
	   dlg->addFeatures(Request.GetFeatureInfo.Format.at(i));
-
 
243
 
-
 
244
	if (firstLayer)
-
 
245
	{
-
 
246
	LAYER *akt = firstLayer;
-
 
247
	QStringList sl;
-
 
248
 
-
 
249
	   while (akt)
-
 
250
	   {
-
 
251
	      for (i = 0; i < akt->SRS.size(); ++i)
-
 
252
	         sl << akt->SRS.at(i);
-
 
253
 
-
 
254
	      akt = akt->next;
-
 
255
	   }
-
 
256
 
-
 
257
	   sl.removeDuplicates();
-
 
258
 
-
 
259
	   for (i = 0; i < sl.size(); ++i)
-
 
260
	      dlg->addDate(sl.at(i));
-
 
261
	}
-
 
262
 
227
	dlg->exec();
263
	dlg->exec();
228
	delete dlg;
264
	delete dlg;
229
}
265
}
230
 
266
 
231
void wmsSelectorWidget::slotAdded(QListWidgetItem *item)
267
void wmsSelectorWidget::slotAdded(QListWidgetItem *item)
Line 644... Line 680...
644
	   attribute = at_Title;
680
	   attribute = at_Title;
645
	else if (qName.toLower() == QString("onlineresource"))
681
	else if (qName.toLower() == QString("onlineresource"))
646
	{
682
	{
647
	   if (element == el_Service)
683
	   if (element == el_Service)
648
	   {
684
	   {
649
	      if ((index = att.index(QString("href"))) != -1)
685
	      if ((index = att.index(QString("href"))) != -1 || (index = att.index(QString("xlink:href"))) != -1)
650
		 Service.OnlineResource = att.value(index);
686
		 Service.OnlineResource = att.value(index);
651
 
687
 
652
	      if ((index = att.index(QString("type"))) != -1)
688
	      if ((index = att.index(QString("type"))) != -1)
653
		 Service.Type = att.value(index);
689
		 Service.Type = att.value(index);
654
	   }
690
	   }
655
	   else if (element == el_GetCapabilities && el2 == el_Get)
691
	   else if (element == el_GetCapabilities && el2 == el_Get)
656
	   {
692
	   {
657
	      if ((index = att.index(QString("href"))) != -1)
693
	      if ((index = att.index(QString("href"))) != -1 || (index = att.index(QString("xlink:href"))) != -1)
658
		 Request.GetCapabilities.Get = att.value(index);
694
		 Request.GetCapabilities.Get = att.value(index);
659
	   }
695
	   }
660
	   else if (element == el_GetCapabilities && el2 == el_Post)
696
	   else if (element == el_GetCapabilities && el2 == el_Post)
661
	   {
697
	   {
662
	      if ((index = att.index(QString("href"))) != -1)
698
	      if ((index = att.index(QString("href"))) != -1 || (index = att.index(QString("xlink:href"))) != -1)
663
		 Request.GetCapabilities.Post = att.value(index);
699
		 Request.GetCapabilities.Post = att.value(index);
664
	   }
700
	   }
665
	   else if (element == el_GetMap && el2 == el_Get)
701
	   else if (element == el_GetMap && el2 == el_Get)
666
	   {
702
	   {
667
	      if ((index = att.index(QString("href"))) != -1)
703
	      if ((index = att.index(QString("href"))) != -1 || (index = att.index(QString("xlink:href"))) != -1)
668
		 Request.GetMap.Get = att.value(index);
704
		 Request.GetMap.Get = att.value(index);
669
	   }
705
	   }
670
	   else if (element == el_GetMap && el2 == el_Post)
706
	   else if (element == el_GetMap && el2 == el_Post)
671
	   {
707
	   {
672
	      if ((index = att.index(QString("href"))) != -1)
708
	      if ((index = att.index(QString("href"))) != -1 || (index = att.index(QString("xlink:href"))) != -1)
673
		 Request.GetMap.Post = att.value(index);
709
		 Request.GetMap.Post = att.value(index);
674
	   }
710
	   }
675
	   else if (element == el_GetFeatureInfo && el2 == el_Get)
711
	   else if (element == el_GetFeatureInfo && el2 == el_Get)
676
	   {
712
	   {
677
	      if ((index = att.index(QString("href"))) != -1)
713
	      if ((index = att.index(QString("href"))) != -1 || (index = att.index(QString("xlink:href"))) != -1)
678
		 Request.GetFeatureInfo.Get = att.value(index);
714
		 Request.GetFeatureInfo.Get = att.value(index);
679
	   }
715
	   }
680
	   else if (element == el_GetFeatureInfo && el2 == el_Post)
716
	   else if (element == el_GetFeatureInfo && el2 == el_Post)
681
	   {
717
	   {
682
	      if ((index = att.index(QString("href"))) != -1)
718
	      if ((index = att.index(QString("href"))) != -1 || (index = att.index(QString("xlink:href"))) != -1)
683
		 Request.GetFeatureInfo.Post = att.value(index);
719
		 Request.GetFeatureInfo.Post = att.value(index);
684
	   }
720
	   }
685
	}
721
	}
686
	else if (qName.toLower() == QString("contactinformation"))
722
	else if (qName.toLower() == QString("contactinformation"))
687
	   element = el_ContactInformation;
723
	   element = el_ContactInformation;
688
	else if (qName.toLower() == QString("contactpersonprimary"))
724
	else if (qName.toLower() == QString("contactpersonprimary"))
689
	   element = el_ContactPersonPrimary;
725
	   element = el_ContactPersonPrimary;
690
	else if (qName.toLower() == QString("contactperson"))
726
	else if (qName.toLower() == QString("contactperson"))
691
	   attribute = at_ContactPerson;
727
	   attribute = at_ContactPerson;
692
	else if (qName.toLower() == QString("contactorganisation"))
728
	else if (qName.toLower() == QString("contactorganization"))
693
	   attribute = at_ContactOrganisation;
729
	   attribute = at_ContactOrganisation;
694
	else if (qName.toLower() == QString("contactposition"))
730
	else if (qName.toLower() == QString("contactposition"))
695
	   attribute = at_ContactPosition;
731
	   attribute = at_ContactPosition;
696
	else if (qName.toLower() == QString("contactaddress"))
732
	else if (qName.toLower() == QString("contactaddress"))
697
	   element = el_ContactAddress;
733
	   element = el_ContactAddress;
Line 1430... Line 1466...
1430
#if defined HAVE_GDAL
1466
#if defined HAVE_GDAL
1431
QFile fl(MAP);
1467
QFile fl(MAP);
1432
QString xml, s, srs, crs, styles, bSize, ext;
1468
QString xml, s, srs, crs, styles, bSize, ext;
1433
QDir dir = QDir::home();
1469
QDir dir = QDir::home();
1434
QString path = dir.absolutePath();
1470
QString path = dir.absolutePath();
-
 
1471
QStringList sl;
1435
//int item;
1472
//int item;
1436
double _llat, _llon, _rlat, _rlon;
1473
double _llat, _llon, _rlat, _rlon;
1437
 
1474
 
1438
	if (!fl.open(QIODevice::ReadWrite | QIODevice::Truncate))
1475
	if (!fl.open(QIODevice::ReadWrite | QIODevice::Truncate))
1439
	{
1476
	{
Line 1456... Line 1493...
1456
	_llon = llon;
1493
	_llon = llon;
1457
	_llat = llat;
1494
	_llat = llat;
1458
	_rlon = rlon;
1495
	_rlon = rlon;
1459
	_rlat = rlat;
1496
	_rlat = rlat;
1460
 
1497
 
-
 
1498
	if (firstLayer)
-
 
1499
	{
-
 
1500
	LAYER *akt = firstLayer;
-
 
1501
 
-
 
1502
	   while (akt)
-
 
1503
	   {
1461
	if (firstLayer && firstLayer->SRS.size())
1504
	      for (int i = 0; i < akt->SRS.size(); ++i)
1462
	   srs = firstLayer->SRS.at(0);
1505
	         sl << akt->SRS.at(i);
-
 
1506
 
-
 
1507
	      akt = akt->next;
-
 
1508
	   }
-
 
1509
 
-
 
1510
	   sl.removeDuplicates();
-
 
1511
 
-
 
1512
	   if (sl.contains("EPSG:4326") || sl.contains("WGS:84"))
-
 
1513
	      srs = QString("EPSG:4326");
-
 
1514
	   else
-
 
1515
	      srs = sl.at(0);
-
 
1516
	}
1463
	else
1517
	else
1464
	   srs = QString("EPSG:4326");
1518
	   srs = QString("EPSG:4326");
1465
 
1519
 
1466
	xml += "      <SRS>" + srs + "</SRS>\n";
1520
	xml += "      <SRS>" + srs + "</SRS>\n";
1467
 
1521
 
1468
	if (firstLayer && firstLayer->CRS.size())
1522
	if (firstLayer && firstLayer->CRS.size())
-
 
1523
	{
-
 
1524
	LAYER *akt = firstLayer;
-
 
1525
 
-
 
1526
	   sl.clear();
-
 
1527
 
-
 
1528
	   while (akt)
-
 
1529
	   {
-
 
1530
	      for (int i = 0; i < akt->CRS.size(); ++i)
1469
	   crs = firstLayer->CRS.at(0);
1531
	         sl << akt->CRS.at(i);
-
 
1532
 
-
 
1533
	      akt = akt->next;
-
 
1534
	   }
-
 
1535
 
-
 
1536
	   sl.removeDuplicates();
-
 
1537
 
-
 
1538
	   if (sl.contains("EPSG:4326") || sl.contains("CRS:84"))
-
 
1539
	      crs = QString("EPSG:4326");
-
 
1540
	   else
-
 
1541
	      crs = sl.at(0);
-
 
1542
	}
1470
	else
1543
	else
1471
	   crs = QString("EPSG:4326");
1544
	   crs = QString("EPSG:4326");
1472
 
1545
 
1473
	xml += "      <CRS>" + crs + "</CRS>\n";
1546
	xml += "      <CRS>" + crs + "</CRS>\n";
1474
	xml += "      <ImageFormat>image/";
1547
	xml += "      <ImageFormat>image/";