This article explains how to use IronPython scripting to set a projection for a map chart layer in Spotfire®.
Introduction
This example shows how to set the projection for a Map Chart layer. For more information on projections and Coordinate Reference Systems, see Spotfire Analyst User's Guide.
Code Sample
# Copyright © 2020. TIBCO Software Inc. Licensed under TIBCO BSD-style license. from Spotfire.Dxp.Application.Visuals import * from Spotfire.Dxp.Application.Visuals.Maps import * mapchart=chart.As[MapChart]() for layer in mapchart.Layers: if layer.Title == "Image Layer": #Creating a projection using an EPSG code #Available since 6.5.0 layer.Projection = Projection("EPSG:3857") #Creating a projection using an proj4 definition #Available since 10.8.0 #For more info about proj4 definitions https://proj.org/ layer.Projection = Projection("Imported:1", "+proj=aeqd +lat_0=0 +lon_0=0 +x_0=0 +y_0=0 +units=m +datum=WGS84 +no_defs", "Generated CRS")
References
License: BSD License
Recommended Comments
There are no comments to display.