Marble

GeoDataPlacemark.cpp
1// SPDX-License-Identifier: LGPL-2.1-or-later
2//
3// SPDX-FileCopyrightText: 2004-2007 Torsten Rahn <tackat@kde.org>
4// SPDX-FileCopyrightText: 2007 Inge Wallin <ingwa@kde.org>
5// SPDX-FileCopyrightText: 2008-2009 Patrick Spendrin <ps_ml@gmx.de>
6//
7
8// Own
9#include "GeoDataPlacemark.h"
10
11// Private
12#include "GeoDataPlacemark_p.h"
13
14#include "GeoDataData.h"
15#include "GeoDataLatLonAltBox.h"
16#include "GeoDataMultiGeometry.h"
17#include "osm/OsmPlacemarkData.h"
18
19// Qt
20#include "GeoDataModel.h"
21#include "GeoDataTrack.h"
22#include "MarbleDebug.h"
23#include <QDataStream>
24#include <QString>
25#include <QStringRef>
26#include <QXmlStreamWriter>
27
28namespace Marble
29{
30
31const OsmPlacemarkData GeoDataPlacemarkPrivate::s_nullOsmPlacemarkData = OsmPlacemarkData();
32const GeoDataPlacemarkExtendedData GeoDataPlacemarkPrivate::s_nullPlacemarkExtendedData = GeoDataPlacemarkExtendedData();
33
35 : GeoDataFeature(new GeoDataPlacemarkPrivate)
36{
38 d->m_geometry->setParent(this);
39}
40
42 : GeoDataFeature(other, new GeoDataPlacemarkPrivate(*other.d_func()))
43{
45 if (d->m_geometry) {
46 d->m_geometry->setParent(this);
47 }
48}
49
51 : GeoDataFeature(new GeoDataPlacemarkPrivate)
52{
54 d->m_name = name;
55 d->m_geometry->setParent(this);
56}
57
59{
60 // nothing to do
61}
62
63GeoDataPlacemark &GeoDataPlacemark::operator=(const GeoDataPlacemark &other)
64{
65 if (this != &other) {
67 *d = *other.d_func();
68 if (d->m_geometry) {
69 d->m_geometry->setParent(this);
70 }
71 }
72
73 return *this;
74}
75
77{
78 Q_D(const GeoDataPlacemark);
79 const GeoDataPlacemarkPrivate *const other_d = other.d_func();
80 if (!equals(other) || d->m_population != other_d->m_population) {
81 return false;
82 }
83
84 if ((d->m_placemarkExtendedData && !other_d->m_placemarkExtendedData) && (*d->m_placemarkExtendedData != GeoDataPlacemarkExtendedData())) {
85 return false;
86 }
87
88 if ((!d->m_placemarkExtendedData && other_d->m_placemarkExtendedData) && (GeoDataPlacemarkExtendedData() != *other_d->m_placemarkExtendedData)) {
89 return false;
90 }
91
92 if (d->m_placemarkExtendedData && other_d->m_placemarkExtendedData && !(*d->m_placemarkExtendedData == *other_d->m_placemarkExtendedData)) {
93 return false;
94 }
95
96 if (!d->m_geometry && !other_d->m_geometry) {
97 return true;
98 }
99 if ((!d->m_geometry && other_d->m_geometry) || (d->m_geometry && !other_d->m_geometry)) {
100 return false;
101 }
102
103 if (*d->m_geometry != *other_d->m_geometry) {
104 return false;
105 }
106
107 return true;
108}
109
110bool GeoDataPlacemark::operator!=(const GeoDataPlacemark &other) const
111{
112 return !this->operator==(other);
113}
114
115const char *GeoDataPlacemark::nodeType() const
116{
117 return GeoDataTypes::GeoDataPlacemarkType;
118}
119
121{
122 return new GeoDataPlacemark(*this);
123}
124
126{
127 Q_D(const GeoDataPlacemark);
128 return d->m_visualCategory;
129}
130
132{
134 d->m_visualCategory = index;
135}
136
138{
140 return d->m_geometry;
141}
142
144{
145 Q_D(const GeoDataPlacemark);
146 return d->m_geometry;
147}
148
149const OsmPlacemarkData &GeoDataPlacemark::osmData() const
150{
151 Q_D(const GeoDataPlacemark);
152 return d->osmPlacemarkData();
153}
154
155void GeoDataPlacemark::setOsmData(const OsmPlacemarkData &osmData)
156{
158 d->osmPlacemarkData() = osmData;
159}
160
162{
164 return d->osmPlacemarkData();
165}
166
167bool GeoDataPlacemark::hasOsmData() const
168{
169 Q_D(const GeoDataPlacemark);
170 return d->m_osmPlacemarkData != nullptr;
171}
172
174{
176 delete d->m_osmPlacemarkData;
177 d->m_osmPlacemarkData = nullptr;
178}
179
180const GeoDataLookAt *GeoDataPlacemark::lookAt() const
181{
182 return dynamic_cast<const GeoDataLookAt *>(abstractView());
183}
184
185GeoDataLookAt *GeoDataPlacemark::lookAt()
186{
187 return dynamic_cast<GeoDataLookAt *>(abstractView());
188}
189
190bool GeoDataPlacemark::placemarkLayoutOrderCompare(const GeoDataPlacemark *left, const GeoDataPlacemark *right)
191{
192 const GeoDataPlacemarkPrivate *const left_d = left->d_func();
193 const GeoDataPlacemarkPrivate *const right_d = right->d_func();
194
195 if (left_d->m_zoomLevel != right_d->m_zoomLevel) {
196 return (left_d->m_zoomLevel < right_d->m_zoomLevel); // lower zoom level comes first
197 }
198
199 if (left_d->m_popularity != right_d->m_popularity) {
200 return (left_d->m_popularity > right_d->m_popularity); // higher popularity comes first
201 }
202
203 return left < right; // lower pointer value comes first
204}
205
206GeoDataCoordinates GeoDataPlacemark::coordinate(const QDateTime &dateTime, bool *iconAtCoordinates) const
207{
208 Q_D(const GeoDataPlacemark);
209 bool hasIcon = false;
210 GeoDataCoordinates coord;
211
212 if (d->m_geometry) {
213 // Beware: comparison between pointers, not strings.
214 if (geodata_cast<GeoDataPoint>(d->m_geometry) || geodata_cast<GeoDataPolygon>(d->m_geometry) || geodata_cast<GeoDataLinearRing>(d->m_geometry)) {
215 hasIcon = true;
216 coord = d->m_geometry->latLonAltBox().center();
217 } else if (const auto multiGeometry = geodata_cast<GeoDataMultiGeometry>(d->m_geometry)) {
218 QList<GeoDataGeometry *>::ConstIterator it = multiGeometry->constBegin();
219 QList<GeoDataGeometry *>::ConstIterator end = multiGeometry->constEnd();
220 for (; it != end; ++it) {
222 hasIcon = true;
223 break;
224 }
225 }
226
227 coord = d->m_geometry->latLonAltBox().center();
228 } else if (const auto track = geodata_cast<GeoDataTrack>(d->m_geometry)) {
229 hasIcon = track->size() != 0 && track->firstWhen() <= dateTime;
230 coord = track->coordinatesAt(dateTime);
231 } else if (const auto lineString = geodata_cast<GeoDataLineString>(d->m_geometry)) {
232 auto const size = lineString->size();
233 if (size == 0) {
234 return {};
235 } else if (size < 3) {
236 // Approximate center if there are just two coordinates
237 return lineString->latLonAltBox().center();
238 } else {
239 return lineString->at(size / 2);
240 }
241 } else {
242 coord = d->m_geometry->latLonAltBox().center();
243 }
244 }
245
246 if (iconAtCoordinates != nullptr) {
247 *iconAtCoordinates = hasIcon;
248 }
249 return coord;
250}
251
252void GeoDataPlacemark::coordinate(qreal &lon, qreal &lat, qreal &alt) const
253{
254 coordinate().geoCoordinates(lon, lat, alt);
255}
256
257void GeoDataPlacemark::setCoordinate(qreal lon, qreal lat, qreal alt, GeoDataPoint::Unit _unit)
258{
259 setGeometry(new GeoDataPoint(lon, lat, alt, _unit));
260}
261
266
268{
270 delete d->m_geometry;
271 d->m_geometry = entry;
272 d->m_geometry->setParent(this);
273}
274
276{
277 if (hasOsmData()) {
278 OsmPlacemarkData const &data = osmData();
279 QStringList const uiLanguages = QLocale::system().uiLanguages();
280 for (const QString &uiLanguage : uiLanguages) {
281 for (auto tagIter = data.tagsBegin(), end = data.tagsEnd(); tagIter != end; ++tagIter) {
282 if (tagIter.key().startsWith(QLatin1StringView("name:"))) {
283 QString const tagLanguage = tagIter.key().mid(5);
284 if (tagLanguage == uiLanguage) {
285 return tagIter.value();
286 }
287 }
288 }
289 }
290 }
291
292 return name();
293}
294
296{
297 Q_D(const GeoDataPlacemark);
298 switch (d->m_visualCategory) {
299 case Valley:
300 return GeoDataPlacemarkPrivate::tr("Valley");
301 case OtherTerrain:
302 return GeoDataPlacemarkPrivate::tr("Terrain");
303 case Crater:
304 return GeoDataPlacemarkPrivate::tr("Crater");
305 case Mare:
306 return GeoDataPlacemarkPrivate::tr("Sea");
307 case MannedLandingSite:
308 return GeoDataPlacemarkPrivate::tr("Manned Landing Site");
309 case RoboticRover:
310 return GeoDataPlacemarkPrivate::tr("Robotic Rover");
311 case UnmannedSoftLandingSite:
312 return GeoDataPlacemarkPrivate::tr("Unmanned Soft Landing Site");
313 case UnmannedHardLandingSite:
314 return GeoDataPlacemarkPrivate::tr("Unmanned Hard Landing Site");
315 case Mons:
316 return GeoDataPlacemarkPrivate::tr("Mountain");
317 case SmallCity:
318 return GeoDataPlacemarkPrivate::tr("City");
319 case SmallCountyCapital:
320 return GeoDataPlacemarkPrivate::tr("County Capital");
321 case SmallStateCapital:
322 return GeoDataPlacemarkPrivate::tr("State Capital");
323 case SmallNationCapital:
324 return GeoDataPlacemarkPrivate::tr("Nation Capital");
325 case MediumCity:
326 return GeoDataPlacemarkPrivate::tr("City");
327 case MediumCountyCapital:
328 return GeoDataPlacemarkPrivate::tr("County Capital");
329 case MediumStateCapital:
330 return GeoDataPlacemarkPrivate::tr("State Capital");
331 case MediumNationCapital:
332 return GeoDataPlacemarkPrivate::tr("Nation Capital");
333 case BigCity:
334 return GeoDataPlacemarkPrivate::tr("City");
335 case BigCountyCapital:
336 return GeoDataPlacemarkPrivate::tr("County Capital");
337 case BigStateCapital:
338 return GeoDataPlacemarkPrivate::tr("State Capital");
339 case BigNationCapital:
340 return GeoDataPlacemarkPrivate::tr("Nation Capital");
341 case LargeCity:
342 return GeoDataPlacemarkPrivate::tr("City");
343 case LargeCountyCapital:
344 return GeoDataPlacemarkPrivate::tr("County Capital");
345 case LargeStateCapital:
346 return GeoDataPlacemarkPrivate::tr("State Capital");
347 case LargeNationCapital:
348 return GeoDataPlacemarkPrivate::tr("Nation Capital");
349 case Nation:
350 return GeoDataPlacemarkPrivate::tr("Nation");
351 case Mountain:
352 return GeoDataPlacemarkPrivate::tr("Mountain");
353 case Volcano:
354 return GeoDataPlacemarkPrivate::tr("Volcano");
355 case Continent:
356 return GeoDataPlacemarkPrivate::tr("Continent");
357 case Ocean:
358 return GeoDataPlacemarkPrivate::tr("Ocean");
359 case GeographicPole:
360 return GeoDataPlacemarkPrivate::tr("Geographic Pole");
361 case MagneticPole:
362 return GeoDataPlacemarkPrivate::tr("Magnetic Pole");
363 case ShipWreck:
364 return GeoDataPlacemarkPrivate::tr("Ship Wreck");
365 case AirPort:
366 return GeoDataPlacemarkPrivate::tr("Air Port");
367 case Observatory:
368 return GeoDataPlacemarkPrivate::tr("Observatory");
369 case MilitaryDangerArea:
370 return GeoDataPlacemarkPrivate::tr("Military Danger Area");
371 case OsmSite:
372 return GeoDataPlacemarkPrivate::tr("OSM Site");
373 case Coordinate:
374 return GeoDataPlacemarkPrivate::tr("Coordinate");
375 case Bookmark:
376 return GeoDataPlacemarkPrivate::tr("Bookmark");
377 case Satellite:
378 return GeoDataPlacemarkPrivate::tr("Satellite");
379
380 // OpenStreetMap categories
381 case PlaceCity:
382 return GeoDataPlacemarkPrivate::tr("City");
383 case PlaceCityCapital:
384 return GeoDataPlacemarkPrivate::tr("City Capital");
385 case PlaceCityNationalCapital:
386 return GeoDataPlacemarkPrivate::tr("National Capital");
387 case PlaceSuburb:
388 return GeoDataPlacemarkPrivate::tr("Suburb");
389 case PlaceHamlet:
390 return GeoDataPlacemarkPrivate::tr("Hamlet");
391 case PlaceLocality:
392 return GeoDataPlacemarkPrivate::tr("Locality");
393 case PlaceTown:
394 return GeoDataPlacemarkPrivate::tr("Town");
395 case PlaceTownCapital:
396 return GeoDataPlacemarkPrivate::tr("Town Capital");
397 case PlaceTownNationalCapital:
398 return GeoDataPlacemarkPrivate::tr("National Capital");
399 case PlaceVillage:
400 return GeoDataPlacemarkPrivate::tr("Village");
401 case PlaceVillageCapital:
402 return GeoDataPlacemarkPrivate::tr("Village Capital");
403 case PlaceVillageNationalCapital:
404 return GeoDataPlacemarkPrivate::tr("National Capital");
405 case NaturalWater:
406 return GeoDataPlacemarkPrivate::tr("Water");
407 case NaturalReef:
408 return GeoDataPlacemarkPrivate::tr("Reef");
409 case NaturalWood:
410 return GeoDataPlacemarkPrivate::tr("Wood");
411 case NaturalBeach:
412 return GeoDataPlacemarkPrivate::tr("Beach");
413 case NaturalWetland:
414 return GeoDataPlacemarkPrivate::tr("Wetland");
415 case NaturalGlacier:
416 return GeoDataPlacemarkPrivate::tr("Glacier");
417 case NaturalIceShelf:
418 return GeoDataPlacemarkPrivate::tr("Ice Shelf");
419 case NaturalScrub:
420 return GeoDataPlacemarkPrivate::tr("Scrub");
421 case NaturalCliff:
422 return GeoDataPlacemarkPrivate::tr("Cliff");
423 case NaturalHeath:
424 return GeoDataPlacemarkPrivate::tr("Heath");
425 case HighwayTrafficSignals:
426 return GeoDataPlacemarkPrivate::tr("Traffic Signals");
427 case HighwayElevator:
428 return GeoDataPlacemarkPrivate::tr("Elevator");
429 case HighwaySteps:
430 return GeoDataPlacemarkPrivate::tr("Steps");
431 case HighwayUnknown:
432 return GeoDataPlacemarkPrivate::tr("Unknown Road");
433 case HighwayPath:
434 return GeoDataPlacemarkPrivate::tr("Path");
435 case HighwayFootway:
436 return GeoDataPlacemarkPrivate::tr("Footway");
437 case HighwayTrack:
438 return GeoDataPlacemarkPrivate::tr("Track");
439 case HighwayPedestrian:
440 return GeoDataPlacemarkPrivate::tr("Footway");
441 case HighwayCycleway:
442 return GeoDataPlacemarkPrivate::tr("Cycleway");
443 case HighwayService:
444 return GeoDataPlacemarkPrivate::tr("Service Road");
445 case HighwayRoad:
446 return GeoDataPlacemarkPrivate::tr("Road");
447 case HighwayResidential:
448 return GeoDataPlacemarkPrivate::tr("Residential Road");
449 case HighwayLivingStreet:
450 return GeoDataPlacemarkPrivate::tr("Living Street");
451 case HighwayUnclassified:
452 return GeoDataPlacemarkPrivate::tr("Unclassified Road");
453 case HighwayTertiaryLink:
454 return GeoDataPlacemarkPrivate::tr("Tertiary Link Road");
455 case HighwayTertiary:
456 return GeoDataPlacemarkPrivate::tr("Tertiary Road");
457 case HighwaySecondaryLink:
458 return GeoDataPlacemarkPrivate::tr("Secondary Link Road");
459 case HighwaySecondary:
460 return GeoDataPlacemarkPrivate::tr("Secondary Road");
461 case HighwayPrimaryLink:
462 return GeoDataPlacemarkPrivate::tr("Primary Link Road");
463 case HighwayPrimary:
464 return GeoDataPlacemarkPrivate::tr("Primary Road");
465 case HighwayRaceway:
466 return GeoDataPlacemarkPrivate::tr("Raceway");
467 case HighwayTrunkLink:
468 return GeoDataPlacemarkPrivate::tr("Trunk Link Road");
469 case HighwayTrunk:
470 return GeoDataPlacemarkPrivate::tr("Trunk Road");
471 case HighwayMotorwayLink:
472 return GeoDataPlacemarkPrivate::tr("Motorway Link Road");
473 case HighwayMotorway:
474 return GeoDataPlacemarkPrivate::tr("Motorway");
475 case HighwayCorridor:
476 return GeoDataPlacemarkPrivate::tr("Corridor");
477 case Building:
478 return GeoDataPlacemarkPrivate::tr("Building");
479 case AccomodationCamping:
480 return GeoDataPlacemarkPrivate::tr("Camping");
481 case AccomodationHostel:
482 return GeoDataPlacemarkPrivate::tr("Hostel");
483 case AccomodationHotel:
484 return GeoDataPlacemarkPrivate::tr("Hotel");
485 case AccomodationMotel:
486 return GeoDataPlacemarkPrivate::tr("Motel");
487 case AccomodationYouthHostel:
488 return GeoDataPlacemarkPrivate::tr("Youth Hostel");
489 case AccomodationGuestHouse:
490 return GeoDataPlacemarkPrivate::tr("Guest House");
491 case AmenityLibrary:
492 return GeoDataPlacemarkPrivate::tr("Library");
494 return GeoDataPlacemarkPrivate::tr("Kindergarten");
495 case EducationCollege:
496 return GeoDataPlacemarkPrivate::tr("College");
497 case EducationSchool:
498 return GeoDataPlacemarkPrivate::tr("School");
499 case EducationUniversity:
500 return GeoDataPlacemarkPrivate::tr("University");
501 case FoodBar:
502 return GeoDataPlacemarkPrivate::tr("Bar");
503 case FoodBiergarten:
504 return GeoDataPlacemarkPrivate::tr("Biergarten");
505 case FoodCafe:
506 return GeoDataPlacemarkPrivate::tr("Cafe");
507 case FoodFastFood:
508 return GeoDataPlacemarkPrivate::tr("Fast Food");
509 case FoodPub:
510 return GeoDataPlacemarkPrivate::tr("Pub");
511 case FoodRestaurant:
512 return GeoDataPlacemarkPrivate::tr("Restaurant");
513 case HealthDentist:
514 return GeoDataPlacemarkPrivate::tr("Dentist");
515 case HealthDoctors:
516 return GeoDataPlacemarkPrivate::tr("Doctors");
517 case HealthHospital:
518 return GeoDataPlacemarkPrivate::tr("Hospital");
519 case HealthPharmacy:
520 return GeoDataPlacemarkPrivate::tr("Pharmacy");
521 case HealthVeterinary:
522 return GeoDataPlacemarkPrivate::tr("Veterinary");
523 case MoneyAtm:
524 return GeoDataPlacemarkPrivate::tr("ATM");
525 case MoneyBank:
526 return GeoDataPlacemarkPrivate::tr("Bank");
527 case HistoricArchaeologicalSite:
528 return GeoDataPlacemarkPrivate::tr("Archaeological Site");
529 case AmenityEmbassy:
530 return GeoDataPlacemarkPrivate::tr("Embassy");
531 case AmenityEmergencyPhone:
532 return GeoDataPlacemarkPrivate::tr("Emergency Phone");
533 case AmenityMountainRescue:
534 return GeoDataPlacemarkPrivate::tr("Mountain Rescue");
535 case LeisureWaterPark:
536 return GeoDataPlacemarkPrivate::tr("Water Park");
537 case AmenityCommunityCentre:
538 return GeoDataPlacemarkPrivate::tr("Community Centre");
539 case AmenityFountain:
540 return GeoDataPlacemarkPrivate::tr("Fountain");
541 case AmenityNightClub:
542 return GeoDataPlacemarkPrivate::tr("Night Club");
543 case AmenityBench:
544 return GeoDataPlacemarkPrivate::tr("Bench");
545 case AmenityCourtHouse:
546 return GeoDataPlacemarkPrivate::tr("Court House");
547 case AmenityFireStation:
548 return GeoDataPlacemarkPrivate::tr("Fire Station");
549 case AmenityHuntingStand:
550 return GeoDataPlacemarkPrivate::tr("Hunting Stand");
551 case AmenityPolice:
552 return GeoDataPlacemarkPrivate::tr("Police");
553 case AmenityPostBox:
554 return GeoDataPlacemarkPrivate::tr("Post Box");
555 case AmenityPostOffice:
556 return GeoDataPlacemarkPrivate::tr("Post Office");
557 case AmenityPrison:
558 return GeoDataPlacemarkPrivate::tr("Prison");
559 case AmenityRecycling:
560 return GeoDataPlacemarkPrivate::tr("Recycling");
561 case AmenityShelter:
562 return GeoDataPlacemarkPrivate::tr("Shelter");
563 case AmenityTelephone:
564 return GeoDataPlacemarkPrivate::tr("Telephone");
565 case AmenityToilets:
566 return GeoDataPlacemarkPrivate::tr("Toilets");
567 case AmenityTownHall:
568 return GeoDataPlacemarkPrivate::tr("Town Hall");
569 case AmenityWasteBasket:
570 return GeoDataPlacemarkPrivate::tr("Waste Basket");
571 case AmenityDrinkingWater:
572 return GeoDataPlacemarkPrivate::tr("Drinking Water");
573 case AmenityGraveyard:
574 return GeoDataPlacemarkPrivate::tr("Graveyard");
575 case AmenityChargingStation:
576 return GeoDataPlacemarkPrivate::tr("Charging Station");
577 case AmenityCarWash:
578 return GeoDataPlacemarkPrivate::tr("Car Wash");
579 case AmenitySocialFacility:
580 return GeoDataPlacemarkPrivate::tr("Social Facility");
581 case BarrierCityWall:
582 return GeoDataPlacemarkPrivate::tr("City Wall");
583 case BarrierGate:
584 return GeoDataPlacemarkPrivate::tr("Gate");
585 case BarrierLiftGate:
586 return GeoDataPlacemarkPrivate::tr("Lift Gate");
587 case BarrierWall:
588 return GeoDataPlacemarkPrivate::tr("Wall");
589 case NaturalVolcano:
590 return GeoDataPlacemarkPrivate::tr("Volcano");
591 case NaturalPeak:
592 return GeoDataPlacemarkPrivate::tr("Peak");
593 case NaturalTree:
594 return GeoDataPlacemarkPrivate::tr("Tree");
595 case NaturalCave:
596 return GeoDataPlacemarkPrivate::tr("Cave Entrance");
597 case ShopBeverages:
598 return GeoDataPlacemarkPrivate::tr("Beverages");
599 case ShopHifi:
600 return GeoDataPlacemarkPrivate::tr("Hifi");
601 case ShopSupermarket:
602 return GeoDataPlacemarkPrivate::tr("Supermarket");
603 case ShopAlcohol:
604 return GeoDataPlacemarkPrivate::tr("Liquor Store");
605 case ShopBakery:
606 return GeoDataPlacemarkPrivate::tr("Bakery");
607 case ShopButcher:
608 return GeoDataPlacemarkPrivate::tr("Butcher");
609 case ShopConfectionery:
610 return GeoDataPlacemarkPrivate::tr("Confectionery");
611 case ShopConvenience:
612 return GeoDataPlacemarkPrivate::tr("Convenience Shop");
613 case ShopGreengrocer:
614 return GeoDataPlacemarkPrivate::tr("Greengrocer");
615 case ShopSeafood:
616 return GeoDataPlacemarkPrivate::tr("Seafood Shop");
617 case ShopDepartmentStore:
618 return GeoDataPlacemarkPrivate::tr("Department Store");
619 case ShopKiosk:
620 return GeoDataPlacemarkPrivate::tr("Kiosk");
621 case ShopBag:
622 return GeoDataPlacemarkPrivate::tr("Bag Shop");
623 case ShopClothes:
624 return GeoDataPlacemarkPrivate::tr("Clothes Shop");
625 case ShopFashion:
626 return GeoDataPlacemarkPrivate::tr("Fashion Shop");
627 case ShopJewelry:
628 return GeoDataPlacemarkPrivate::tr("Jewelry Shop");
629 case ShopShoes:
630 return GeoDataPlacemarkPrivate::tr("Shoe Shop");
631 case ShopVarietyStore:
632 return GeoDataPlacemarkPrivate::tr("Variety Store");
633 case ShopBeauty:
634 return GeoDataPlacemarkPrivate::tr("Beauty Services");
635 case ShopChemist:
636 return GeoDataPlacemarkPrivate::tr("Chemist");
637 case ShopCosmetics:
638 return GeoDataPlacemarkPrivate::tr("Cosmetics");
639 case ShopHairdresser:
640 return GeoDataPlacemarkPrivate::tr("Hairdresser");
641 case ShopOptician:
642 return GeoDataPlacemarkPrivate::tr("Optician");
643 case ShopPerfumery:
644 return GeoDataPlacemarkPrivate::tr("Perfumery");
645 case ShopDoitYourself:
646 return GeoDataPlacemarkPrivate::tr("Hardware Store");
647 case ShopFlorist:
648 return GeoDataPlacemarkPrivate::tr("Florist");
649 case ShopHardware:
650 return GeoDataPlacemarkPrivate::tr("Hardware Store");
651 case ShopFurniture:
652 return GeoDataPlacemarkPrivate::tr("Furniture Store");
653 case ShopElectronics:
654 return GeoDataPlacemarkPrivate::tr("Electronics Shop");
655 case ShopMobilePhone:
656 return GeoDataPlacemarkPrivate::tr("Mobile Phone Shop");
657 case ShopBicycle:
658 return GeoDataPlacemarkPrivate::tr("Bicycle Shop");
659 case ShopCar:
660 return GeoDataPlacemarkPrivate::tr("Car Dealer");
661 case ShopCarRepair:
662 return GeoDataPlacemarkPrivate::tr("Car Repair Shop");
663 case ShopCarParts:
664 return GeoDataPlacemarkPrivate::tr("Car Parts");
665 case ShopMotorcycle:
666 return GeoDataPlacemarkPrivate::tr("Motorcycle Shop");
667 case ShopOutdoor:
668 return GeoDataPlacemarkPrivate::tr("Outdoor Shop");
669 case ShopSports:
670 return GeoDataPlacemarkPrivate::tr("Sports Shop");
671 case ShopCopy:
672 return GeoDataPlacemarkPrivate::tr("Printing Services");
673 case ShopArt:
674 return GeoDataPlacemarkPrivate::tr("Art Shop");
675 case ShopMusicalInstrument:
676 return GeoDataPlacemarkPrivate::tr("Musical Instrument Shop");
677 case ShopPhoto:
678 return GeoDataPlacemarkPrivate::tr("Photo Shop");
679 case ShopBook:
680 return GeoDataPlacemarkPrivate::tr("Bookshop");
681 case ShopGift:
682 return GeoDataPlacemarkPrivate::tr("Gift Shop");
683 case ShopStationery:
684 return GeoDataPlacemarkPrivate::tr("Stationery");
685 case ShopLaundry:
686 return GeoDataPlacemarkPrivate::tr("Laundry");
687 case ShopPet:
688 return GeoDataPlacemarkPrivate::tr("Pet Shop");
689 case ShopToys:
690 return GeoDataPlacemarkPrivate::tr("Toy Store");
691 case ShopTravelAgency:
692 return GeoDataPlacemarkPrivate::tr("Travel Agency");
693 case ShopDeli:
694 return GeoDataPlacemarkPrivate::tr("Deli");
695 case ShopTobacco:
696 return GeoDataPlacemarkPrivate::tr("Tobacco Shop");
697 case ShopTea:
698 return GeoDataPlacemarkPrivate::tr("Tea Shop");
699 case ShopComputer:
700 return GeoDataPlacemarkPrivate::tr("Computer Shop");
701 case ShopGardenCentre:
702 return GeoDataPlacemarkPrivate::tr("Garden Centre");
703 case Shop:
704 return GeoDataPlacemarkPrivate::tr("Shop");
705 case ManmadeBridge:
706 return GeoDataPlacemarkPrivate::tr("Bridge");
707 case ManmadeLighthouse:
708 return GeoDataPlacemarkPrivate::tr("Lighthouse");
709 case ManmadePier:
710 return GeoDataPlacemarkPrivate::tr("Pier");
711 case ManmadeWaterTower:
712 return GeoDataPlacemarkPrivate::tr("Water Tower");
713 case ManmadeWindMill:
714 return GeoDataPlacemarkPrivate::tr("Wind Mill");
715 case ManmadeCommunicationsTower:
716 return GeoDataPlacemarkPrivate::tr("Communications Tower");
717 case TourismAttraction:
718 return GeoDataPlacemarkPrivate::tr("Tourist Attraction");
719 case TourismArtwork:
720 return GeoDataPlacemarkPrivate::tr("Artwork");
721 case HistoricCastle:
722 return GeoDataPlacemarkPrivate::tr("Castle");
723 case AmenityCinema:
724 return GeoDataPlacemarkPrivate::tr("Cinema");
725 case TourismInformation:
726 return GeoDataPlacemarkPrivate::tr("Information");
727 case HistoricMonument:
728 return GeoDataPlacemarkPrivate::tr("Monument");
729 case TourismMuseum:
730 return GeoDataPlacemarkPrivate::tr("Museum");
731 case HistoricRuins:
732 return GeoDataPlacemarkPrivate::tr("Ruin");
733 case AmenityTheatre:
734 return GeoDataPlacemarkPrivate::tr("Theatre");
735 case TourismThemePark:
736 return GeoDataPlacemarkPrivate::tr("Theme Park");
737 case TourismViewPoint:
738 return GeoDataPlacemarkPrivate::tr("View Point");
739 case TourismZoo:
740 return GeoDataPlacemarkPrivate::tr("Zoo");
741 case TourismAlpineHut:
742 return GeoDataPlacemarkPrivate::tr("Alpine Hut");
743 case TourismWildernessHut:
744 return GeoDataPlacemarkPrivate::tr("Wilderness Hut");
745 case HistoricMemorial:
746 return GeoDataPlacemarkPrivate::tr("Memorial");
747 case TransportAerodrome:
748 return GeoDataPlacemarkPrivate::tr("Aerodrome");
749 case TransportHelipad:
750 return GeoDataPlacemarkPrivate::tr("Helipad");
752 return GeoDataPlacemarkPrivate::tr("Airport Gate");
754 return GeoDataPlacemarkPrivate::tr("Airport Runway");
756 return GeoDataPlacemarkPrivate::tr("Airport Apron");
758 return GeoDataPlacemarkPrivate::tr("Airport Taxiway");
759 case TransportAirportTerminal:
760 return GeoDataPlacemarkPrivate::tr("Airport Terminal");
761 case TransportBusStation:
762 return GeoDataPlacemarkPrivate::tr("Bus Station");
763 case TransportBusStop:
764 return GeoDataPlacemarkPrivate::tr("Bus Stop");
765 case TransportCarShare:
766 return GeoDataPlacemarkPrivate::tr("Car Sharing");
767 case TransportFuel:
768 return GeoDataPlacemarkPrivate::tr("Gas Station");
769 case TransportParking:
770 return GeoDataPlacemarkPrivate::tr("Parking");
771 case TransportParkingSpace:
772 return GeoDataPlacemarkPrivate::tr("Parking Space");
773 case TransportPlatform:
774 return GeoDataPlacemarkPrivate::tr("Platform");
775 case TransportRentalBicycle:
776 return GeoDataPlacemarkPrivate::tr("Bicycle Rental");
777 case TransportRentalCar:
778 return GeoDataPlacemarkPrivate::tr("Car Rental");
779 case TransportRentalSki:
780 return GeoDataPlacemarkPrivate::tr("Ski Rental");
781 case TransportTaxiRank:
782 return GeoDataPlacemarkPrivate::tr("Taxi Rank");
783 case TransportTrainStation:
784 return GeoDataPlacemarkPrivate::tr("Train Station");
785 case TransportTramStop:
786 return GeoDataPlacemarkPrivate::tr("Tram Stop");
787 case TransportBicycleParking:
788 return GeoDataPlacemarkPrivate::tr("Bicycle Parking");
789 case TransportMotorcycleParking:
790 return GeoDataPlacemarkPrivate::tr("Motorcycle Parking");
791 case TransportSubwayEntrance:
792 return GeoDataPlacemarkPrivate::tr("Subway Entrance");
793 case TransportSpeedCamera:
794 return GeoDataPlacemarkPrivate::tr("Speed Camera");
795 case ReligionPlaceOfWorship:
796 return GeoDataPlacemarkPrivate::tr("Place Of Worship");
797 case ReligionBahai:
798 return GeoDataPlacemarkPrivate::tr("Bahai");
799 case ReligionBuddhist:
800 return GeoDataPlacemarkPrivate::tr("Buddhist");
801 case ReligionChristian:
802 return GeoDataPlacemarkPrivate::tr("Christian");
803 case ReligionMuslim:
804 return GeoDataPlacemarkPrivate::tr("Muslim");
805 case ReligionHindu:
806 return GeoDataPlacemarkPrivate::tr("Hindu");
807 case ReligionJain:
808 return GeoDataPlacemarkPrivate::tr("Jain");
809 case ReligionJewish:
810 return GeoDataPlacemarkPrivate::tr("Jewish");
811 case ReligionShinto:
812 return GeoDataPlacemarkPrivate::tr("Shinto");
813 case ReligionSikh:
814 return GeoDataPlacemarkPrivate::tr("Sikh");
815 case ReligionTaoist:
816 return GeoDataPlacemarkPrivate::tr("Taoist");
817 case LeisureGolfCourse:
818 return GeoDataPlacemarkPrivate::tr("Golf Course");
819 case LeisureMarina:
820 return GeoDataPlacemarkPrivate::tr("Marina");
821 case LeisurePark:
822 return GeoDataPlacemarkPrivate::tr("Park");
823 case LeisurePlayground:
824 return GeoDataPlacemarkPrivate::tr("Playground");
825 case LeisurePitch:
826 return GeoDataPlacemarkPrivate::tr("Pitch");
827 case LeisureSportsCentre:
828 return GeoDataPlacemarkPrivate::tr("Sports Centre");
829 case LeisureStadium:
830 return GeoDataPlacemarkPrivate::tr("Stadium");
831 case LeisureTrack:
832 return GeoDataPlacemarkPrivate::tr("Track");
833 case LeisureSwimmingPool:
834 return GeoDataPlacemarkPrivate::tr("Swimming Pool");
835 case LeisureMinigolfCourse:
836 return GeoDataPlacemarkPrivate::tr("Miniature Golf Course");
837 case LanduseAllotments:
838 return GeoDataPlacemarkPrivate::tr("Allotments");
839 case LanduseBasin:
840 return GeoDataPlacemarkPrivate::tr("Basin");
841 case LanduseCemetery:
842 return GeoDataPlacemarkPrivate::tr("Cemetery");
843 case LanduseCommercial:
844 return GeoDataPlacemarkPrivate::tr("Commercial");
845 case LanduseConstruction:
846 return GeoDataPlacemarkPrivate::tr("Construction");
847 case LanduseFarmland:
848 return GeoDataPlacemarkPrivate::tr("Farmland");
849 case LanduseFarmyard:
850 return GeoDataPlacemarkPrivate::tr("Farmyard");
851 case LanduseGarages:
852 return GeoDataPlacemarkPrivate::tr("Garages");
853 case LanduseGrass:
854 return GeoDataPlacemarkPrivate::tr("Grass");
855 case LanduseIndustrial:
856 return GeoDataPlacemarkPrivate::tr("Industrial");
857 case LanduseLandfill:
858 return GeoDataPlacemarkPrivate::tr("Landfill");
859 case LanduseMeadow:
860 return GeoDataPlacemarkPrivate::tr("Meadow");
861 case LanduseMilitary:
862 return GeoDataPlacemarkPrivate::tr("Military");
863 case LanduseQuarry:
864 return GeoDataPlacemarkPrivate::tr("Quarry");
865 case LanduseRailway:
866 return GeoDataPlacemarkPrivate::tr("Railway");
867 case LanduseReservoir:
868 return GeoDataPlacemarkPrivate::tr("Reservoir");
869 case LanduseResidential:
870 return GeoDataPlacemarkPrivate::tr("Residential");
871 case LanduseRetail:
872 return GeoDataPlacemarkPrivate::tr("Retail");
873 case LanduseOrchard:
874 return GeoDataPlacemarkPrivate::tr("Orchard");
875 case LanduseVineyard:
876 return GeoDataPlacemarkPrivate::tr("Vineyard");
877 case RailwayRail:
878 return GeoDataPlacemarkPrivate::tr("Rail");
879 case RailwayNarrowGauge:
880 return GeoDataPlacemarkPrivate::tr("Narrow Gauge");
881 case RailwayTram:
882 return GeoDataPlacemarkPrivate::tr("Tram");
883 case RailwayLightRail:
884 return GeoDataPlacemarkPrivate::tr("Light Rail");
885 case RailwayAbandoned:
886 return GeoDataPlacemarkPrivate::tr("Abandoned Railway");
887 case RailwaySubway:
888 return GeoDataPlacemarkPrivate::tr("Subway");
889 case RailwayPreserved:
890 return GeoDataPlacemarkPrivate::tr("Preserved Railway");
891 case RailwayMiniature:
892 return GeoDataPlacemarkPrivate::tr("Miniature Railway");
893 case RailwayConstruction:
894 return GeoDataPlacemarkPrivate::tr("Railway Construction");
895 case RailwayMonorail:
896 return GeoDataPlacemarkPrivate::tr("Monorail");
897 case RailwayFunicular:
898 return GeoDataPlacemarkPrivate::tr("Funicular Railway");
899 case PowerTower:
900 return GeoDataPlacemarkPrivate::tr("Power Tower");
901 case AerialwayStation:
902 return GeoDataPlacemarkPrivate::tr("Aerialway Station");
903 case AerialwayPylon:
904 return GeoDataPlacemarkPrivate::tr("Pylon", "A pylon supporting the aerialway cable e.g. on a ski lift");
905 case AerialwayCableCar:
906 return GeoDataPlacemarkPrivate::tr("Cable Car");
907 case AerialwayGondola:
908 return GeoDataPlacemarkPrivate::tr("Gondola");
909 case AerialwayChairLift:
910 return GeoDataPlacemarkPrivate::tr("Chair Lift");
911 case AerialwayMixedLift:
912 return GeoDataPlacemarkPrivate::tr("Mixed Lift");
913 case AerialwayDragLift:
914 return GeoDataPlacemarkPrivate::tr("Drag Lift");
915 case AerialwayTBar:
916 return GeoDataPlacemarkPrivate::tr("T-Bar");
917 case AerialwayJBar:
918 return GeoDataPlacemarkPrivate::tr("J-Bar");
919 case AerialwayPlatter:
920 return GeoDataPlacemarkPrivate::tr("Platter");
921 case AerialwayRopeTow:
922 return GeoDataPlacemarkPrivate::tr("Rope Tow");
923 case AerialwayMagicCarpet:
924 return GeoDataPlacemarkPrivate::tr("Magic Carpet");
925 case AerialwayZipLine:
926 return GeoDataPlacemarkPrivate::tr("Zip Line");
927 case AerialwayGoods:
928 return GeoDataPlacemarkPrivate::tr("Goods");
929 case PisteDownhill:
930 return GeoDataPlacemarkPrivate::tr("Downhill Piste");
931 case PisteNordic:
932 return GeoDataPlacemarkPrivate::tr("Nordic Piste");
933 case PisteSkitour:
934 return GeoDataPlacemarkPrivate::tr("Skitour");
935 case PisteSled:
936 return GeoDataPlacemarkPrivate::tr("Sled Piste");
937 case PisteHike:
938 return GeoDataPlacemarkPrivate::tr("Winter Hike");
939 case PisteSleigh:
940 return GeoDataPlacemarkPrivate::tr("Sleigh Piste");
941 case PisteIceSkate:
942 return GeoDataPlacemarkPrivate::tr("Ice Skate");
943 case PisteSnowPark:
944 return GeoDataPlacemarkPrivate::tr("Snow Park");
945 case PistePlayground:
946 return GeoDataPlacemarkPrivate::tr("Ski Playground");
947 case PisteSkiJump:
948 return GeoDataPlacemarkPrivate::tr("Ski Jump");
949 case AdminLevel1:
950 return GeoDataPlacemarkPrivate::tr("Admin Boundary (Level 1)");
951 case AdminLevel2:
952 return GeoDataPlacemarkPrivate::tr("Admin Boundary (Level 2)");
953 case AdminLevel3:
954 return GeoDataPlacemarkPrivate::tr("Admin Boundary (Level 3)");
955 case AdminLevel4:
956 return GeoDataPlacemarkPrivate::tr("Admin Boundary (Level 4)");
957 case AdminLevel5:
958 return GeoDataPlacemarkPrivate::tr("Admin Boundary (Level 5)");
959 case AdminLevel6:
960 return GeoDataPlacemarkPrivate::tr("Admin Boundary (Level 6)");
961 case AdminLevel7:
962 return GeoDataPlacemarkPrivate::tr("Admin Boundary (Level 7)");
963 case AdminLevel8:
964 return GeoDataPlacemarkPrivate::tr("Admin Boundary (Level 8)");
965 case AdminLevel9:
966 return GeoDataPlacemarkPrivate::tr("Admin Boundary (Level 9)");
967 case AdminLevel10:
968 return GeoDataPlacemarkPrivate::tr("Admin Boundary (Level 10)");
969 case AdminLevel11:
970 return GeoDataPlacemarkPrivate::tr("Admin Boundary (Level 11)");
971 case BoundaryMaritime:
972 return GeoDataPlacemarkPrivate::tr("Boundary (Maritime)");
973 case Landmass:
974 return GeoDataPlacemarkPrivate::tr("Land Mass");
975 case UrbanArea:
976 return GeoDataPlacemarkPrivate::tr("Urban Area");
977 case InternationalDateLine:
978 return GeoDataPlacemarkPrivate::tr("International Date Line");
979 case Bathymetry:
980 return GeoDataPlacemarkPrivate::tr("Bathymetry");
981 case WaterwayCanal:
982 return GeoDataPlacemarkPrivate::tr("Canal");
983 case WaterwayDrain:
984 return GeoDataPlacemarkPrivate::tr("Drain");
985 case WaterwayDitch:
986 return GeoDataPlacemarkPrivate::tr("Ditch");
987 case WaterwayStream:
988 return GeoDataPlacemarkPrivate::tr("Stream");
989 case WaterwayRiver:
990 return GeoDataPlacemarkPrivate::tr("River");
991 case WaterwayWeir:
992 return GeoDataPlacemarkPrivate::tr("Weir");
993 case CrossingSignals:
994 return GeoDataPlacemarkPrivate::tr("Crosswalk");
995 case CrossingIsland:
996 return GeoDataPlacemarkPrivate::tr("Crosswalk");
997 case CrossingZebra:
998 return GeoDataPlacemarkPrivate::tr("Crosswalk");
999 case CrossingRailway:
1000 return GeoDataPlacemarkPrivate::tr("Railway Crossing");
1001 case IndoorDoor:
1002 return GeoDataPlacemarkPrivate::tr("Door");
1003 case IndoorWall:
1004 return GeoDataPlacemarkPrivate::tr("Wall");
1005 case IndoorRoom:
1006 return GeoDataPlacemarkPrivate::tr("Room");
1007
1008 case Default:
1009 case Unknown:
1010 case None:
1011 case LastIndex:
1012 return {};
1013 }
1014
1015 return {};
1016}
1017
1019{
1020 Q_D(const GeoDataPlacemark);
1021 return d->m_placemarkExtendedData ? d->m_placemarkExtendedData->m_area : -1.0;
1022}
1023
1025{
1026 if (area == -1.0 && !d_func()->m_placemarkExtendedData) {
1027 return; // nothing to do
1028 }
1029
1031 d->placemarkExtendedData().m_area = area;
1032}
1033
1035{
1036 Q_D(const GeoDataPlacemark);
1037 return d->m_population;
1038}
1039
1040void GeoDataPlacemark::setPopulation(qint64 population)
1041{
1043 d->m_population = population;
1044}
1045
1047{
1048 Q_D(const GeoDataPlacemark);
1049 return d->m_placemarkExtendedData ? d->m_placemarkExtendedData->m_state : QString();
1050}
1051
1053{
1054 if (state.isEmpty() && !d_func()->m_placemarkExtendedData) {
1055 return; // nothing to do
1056 }
1057
1059 d->placemarkExtendedData().m_state = state;
1060}
1061
1063{
1064 Q_D(const GeoDataPlacemark);
1065 return d->m_placemarkExtendedData ? d->m_placemarkExtendedData->m_countrycode : QString();
1066}
1067
1069{
1070 if (countrycode.isEmpty() && !d_func()->m_placemarkExtendedData) {
1071 return; // nothing to do
1072 }
1073
1075 d->placemarkExtendedData().m_countrycode = countrycode;
1076}
1077
1079{
1080 Q_D(const GeoDataPlacemark);
1081 return d->m_placemarkExtendedData ? d->m_placemarkExtendedData->m_isBalloonVisible : false;
1082}
1083
1085{
1086 if (!visible && !d_func()->m_placemarkExtendedData) {
1087 return; // nothing to do
1088 }
1089
1091 d->placemarkExtendedData().m_isBalloonVisible = visible;
1092}
1093
1095{
1096 Q_D(const GeoDataPlacemark);
1097 GeoDataFeature::pack(stream);
1098
1099 stream << d->placemarkExtendedData().m_countrycode;
1100 stream << d->placemarkExtendedData().m_area;
1101 stream << d->m_population;
1102 if (d->m_geometry) {
1103 stream << d->m_geometry->geometryId();
1104 d->m_geometry->pack(stream);
1105 } else {
1106 stream << InvalidGeometryId;
1107 }
1108}
1109
1111{
1112 stream.writeStartElement("placemark");
1113
1114 stream.writeEndElement();
1115 return stream;
1116}
1117
1118QXmlStreamWriter &GeoDataPlacemark::operator<<(QXmlStreamWriter &stream) const
1119{
1120 pack(stream);
1121 return stream;
1122}
1123
1125{
1127 GeoDataFeature::unpack(stream);
1128
1129 stream >> d->placemarkExtendedData().m_countrycode;
1130 stream >> d->placemarkExtendedData().m_area;
1131 stream >> d->m_population;
1132 int geometryId;
1133 stream >> geometryId;
1134 GeoDataGeometry *geometry = nullptr;
1135 switch (geometryId) {
1136 case InvalidGeometryId:
1137 break;
1138 case GeoDataPointId: {
1139 auto point = new GeoDataPoint;
1140 point->unpack(stream);
1141 geometry = point;
1142 } break;
1143 case GeoDataLineStringId: {
1144 auto lineString = new GeoDataLineString;
1145 lineString->unpack(stream);
1146 geometry = lineString;
1147 } break;
1148 case GeoDataLinearRingId: {
1149 auto linearRing = new GeoDataLinearRing;
1150 linearRing->unpack(stream);
1151 geometry = linearRing;
1152 } break;
1153 case GeoDataPolygonId: {
1154 auto polygon = new GeoDataPolygon;
1155 polygon->unpack(stream);
1156 geometry = polygon;
1157 } break;
1158 case GeoDataMultiGeometryId: {
1159 auto multiGeometry = new GeoDataMultiGeometry;
1160 multiGeometry->unpack(stream);
1161 geometry = multiGeometry;
1162 } break;
1163 case GeoDataModelId:
1164 break;
1165 default:
1166 break;
1167 };
1168 if (geometry) {
1169 delete d->m_geometry;
1170 d->m_geometry = geometry;
1171 d->m_geometry->setParent(this);
1172 }
1173}
1174
1175}
Represents a coordinate with the properties of a name and coordinates.
Definition Coordinate.h:19
A 3d point representation.
Unit
enum used constructor to specify the units used
void geoCoordinates(qreal &lon, qreal &lat, GeoDataCoordinates::Unit unit) const
use this function to get the longitude and latitude with one call - use the unit parameter to switch ...
A base class for all geodata features.
void unpack(QDataStream &stream) override
Unserialize the contents of the feature from stream.
QString name() const
The name of the feature.
const GeoDataAbstractView * abstractView() const
Get the Abstract view of the feature.
void pack(QDataStream &stream) const override
Serialize the contents of the feature to stream.
A base class for all geodata features.
A LineString that allows to store a contiguous set of line segments.
void unpack(QDataStream &stream) override
Unserialize the LineString from a stream.
A LinearRing that allows to store a closed, contiguous set of line segments.
A class that can contain other GeoDataGeometry objects.
void setParent(GeoDataObject *parent)
Sets the parent of the object.
a class representing a point of interest on the map
GeoDataVisualCategory
A categorization of a placemark as defined by ...FIXME.
qint64 population() const
Return the population of the placemark.
GeoDataVisualCategory visualCategory() const
Return the symbol index of the placemark.
const GeoDataLookAt * lookAt() const
Returns GeoDataLookAt object if lookAt is setup earlier otherwise It will convert GeoDataCoordinates ...
~GeoDataPlacemark() override
Delete the placemark.
void setCountryCode(const QString &code)
Set the country code of the placemark.
GeoDataPlacemark()
Create a new placemark.
GeoDataFeature * clone() const override
Duplicate into another equal instance.
void setBalloonVisible(bool visible)
Set visibility of the balloon.
const char * nodeType() const override
Provides type information for downcasting a GeoNode.
void setPopulation(qint64 population)
Sets the population of the placemark.
OsmPlacemarkData & osmData()
Quick, safe accessor to the placemark's OsmPlacemarkData stored within it's ExtendedData.
void setGeometry(GeoDataGeometry *entry)
Sets the current Geometry of this Placemark.
void setVisualCategory(GeoDataVisualCategory index)
Sets the symbol category of the placemark.
void setArea(qreal area)
Set the area size of the feature in square km.
GeoDataCoordinates coordinate(const QDateTime &dateTime=QDateTime(), bool *iconAtCoordinates=nullptr) const
Return the coordinates of the placemark at time dateTime as a GeoDataCoordinates.
bool operator==(const GeoDataPlacemark &other) const
Equality operators.
void setState(const QString &state)
Set the state state of the placemark.
const QString state() const
Return the state of the placemark.
bool isBalloonVisible() const
Returns whether balloon is visible or not.
void setCoordinate(qreal longitude, qreal latitude, qreal altitude=0, GeoDataCoordinates::Unit _unit=GeoDataCoordinates::Radian)
Set the coordinate of the placemark in longitude and latitude.
const QString countryCode() const
Return the country code of the placemark.
GeoDataGeometry * geometry()
The geometry of the GeoDataPlacemark is to be rendered to the marble map along with the icon at the c...
void unpack(QDataStream &stream) override
Deserialize the Placemark from a data stream.
qreal area() const
Return the area size of the feature in square km.
void pack(QDataStream &stream) const override
Serialize the Placemark to a data stream.
QString displayName() const
displays the name of a place in the locale language of the user
A Geometry object representing a 3d point.
A polygon that can have "holes".
void unpack(QDataStream &stream) override
Unserialize the Polygon from a stream.
This class is used to encapsulate the osm data fields kept within a placemark's extendedData.
QHash< QString, QString >::const_iterator tagsBegin() const
iterators for the tags hash.
Binds a QML item to a specific geodetic location in screen coordinates.
T * geodata_cast(GeoDataObject *node)
Returns the given node cast to type T if the node was instantiated as type T; otherwise returns 0.
QLocale system()
QStringList uiLanguages() const const
bool isEmpty() const const
QString mid(qsizetype position, qsizetype n) const const
QTextStream & left(QTextStream &stream)
QTextStream & right(QTextStream &stream)
void writeEndElement()
void writeStartElement(QAnyStringView namespaceUri, QAnyStringView name)
Q_D(Todo)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:15:45 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.