Jump to content

How to set Coordinate Columns (longitude, latitude) in an ironpython script

Taylor Rumsey

Recommended Posts

I'm making a script using IronPython to automate the configuring of a MapChart's properties. I've managed to set the positioning method to longitude latitude, now I need to assign the longitude(X-column)/latitude(Y-column) to columns in my dataset. Ive been digging through the API documentation but can't find a solution. I've attached my current code below.


from Spotfire.Dxp.Application.Visuals import *

from Spotfire.Dxp.Application.Visuals.Maps import *


#v1 is defined in Script Parameters

map = v1.As[MapChart]()

#setting scales to be the die size

map.Transform = map.Transform.FromScales(12.7,15.8)

#turning off coordinate system on main chart

map.Projection = Projection.None

#looping through lyrs in V1's "Page > Map"

for lyr in map.Layers:

if (lyr.Title == "Map Layer"):

lyr.Enabled = False

if (lyr.Title != "Map Layer"):

#turning off coordinate system by layer

lyr.Projection = Projection.None

#setting positioning method to Coordinate Columns (longitudelatitude)

markerLayer = lyr.As[MarkerLayerVisualization]()

markerLayer.PositioningMethod = PositioningMethod.LongitudeLatitude

#Setting markerClass to tiled markers

markerLayer.MarkerClass = MarkerClass.Tile

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...