KML imagery is vertically squished with certain Basemaps

244
6
10-16-2021 11:14 AM
KennSebesta
New Contributor III

For whatever reason, with most basemaps the imagery from the attached KML file is vertically-- but not horizontally-- squished.

ArcGIS.Enums.BasemapTopographicVector

Screen Shot 2021-10-16 at 14.10.05.png

 

However, at least with `BasemapStyleArcGISImageryStandard` it works.

ArcGIS.Enums.BasemapStyleArcGISImageryStandard

Screen Shot 2021-10-16 at 14.09.50.png

Using some debug statements to look at the spatial references, I'm not seeing a difference between the two basemaps. AFAICT so far, the KML should be projected the same in both cases but very visibly is not.

Thoughts on how this can be fixed?

0 Kudos
6 Replies
DanPatterson
MVP Esteemed Contributor

The basemaps look different to me.  What was their coordinate systems


... sort of retired...
0 Kudos
JayantaPoddar
MVP Esteemed Contributor

Could you check if you can alternatively use

Enums.BasemapStyleArcGISTopographic

More options in Enums.BasemapStyle enumeration | ArcGIS Runtime API for Qt | ArcGIS Developer



Think Location
0 Kudos
KennSebesta
New Contributor III

It seems like I can use all the BasemapStyleArcGISXXX maps listed at https://developers.arcgis.com/qt/qml/api-reference/enums-basemapstyle.html. Whereas everything listed in the "Inherited by" box at https://developers.arcgis.com/qt/qml/api-reference/qml-esri-arcgisruntime-basemap.html results in the wrong projection.

0 Kudos
LucasDanzinger
Esri Frequent Contributor
ArcGIS.Enums.BasemapTopographicVector

This is invalid and should be  

Enums.BasemapStyleArcGISTopographic

 

What is happening is the basemap style enum was invalid so the basemap fails to load, so the map takes on the first layer's spatial reference, which is the KML in WGS84. The basemap styles are all in web mercator, so we are comparing two different spatial references, hence the different shape. 

0 Kudos
KennSebesta
New Contributor III

I use 

import Esri.ArcGISRuntime 100.11 as ArcGIS

so the `ArcGIS` component is correct. The BasemapTopographicVector is documented at https://developers.arcgis.com/qt/qml/api-reference/qml-esri-arcgisruntime-basemaptopographicvector.h... so I will assume that that is correct as well.

 

How would I align the spatial reference, either by setting the basemap's or the KML's? I've tried with something like

        spatialReference: Factory.SpatialReference.createWgs84() // I've also tried Factory.SpatialReference.createWebMercator()
initBasemapStyle: Enums.BasemapStyleNone

but that doesn't seem to work. It seems like KMLLayer documentation does not mention supporting reprojection, so maybe the only way to do this is to project everything into WGS84.

0 Kudos
KennSebesta
New Contributor III

Using the SetMapSpatialReference sample app, and adding the KML layer, it looks like it clobbers the map's spatial reference.

import QtQuick 2.6
import Esri.ArcGISRuntime 100.11

Rectangle {
width: 800
height: 600

MapView {
anchors.fill: parent
wrapAroundMode: Enums.WrapAroundModeDisabled

Map {
id: map
// Specify the SpatialReference
spatialReference: SpatialReference { wkid:54024 }

KmlLayer {
dataset: KmlDataset {
url: "http://www.chartbundle.com/charts/kml/sec.kml"
}
}
}
}

Basemap {
id: basemap
ArcGISMapImageLayer {
url: "https://sampleserver6.arcgisonline.com/arcgis/rest/services/SampleWorldCities/MapServer"
}
}

Component.onCompleted: {
map.basemap = basemap;
}
}   

 

Without KMLLayer:

Screen Shot 2021-10-19 at 14.39.36.png

 

With KMLLayer:

Screen Shot 2021-10-19 at 14.39.43.png

 

0 Kudos