PyANGKernel.GKCoordinateTranslator

class GKCoordinateTranslator

Utility class to transform a point either in degrees or meters between Coordinate Systems (project or reproject).

Synopsis

Methods

Static functions

Note

This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE

PyANGKernel.GKCoordinateTranslator.defaultCS
__init__(model)
Parameters:

modelGKModel

convert(fromCS, toCS, b)
Parameters:
  • fromCS – str

  • toCS – str

  • bGKBBox

Return type:

GKBBox

Converts a bbox from a CS to another

convert(fromCS, toCS, p)
Parameters:
  • fromCS – str

  • toCS – str

  • pGKPoint

Return type:

GKPoint

Converts a point from a CS to another

static getCSFromUTM(zone, northing)
Parameters:
  • zone – int

  • northing – bool

Return type:

str

Returns the EPSG code from a WGS 84 UTM zone as a string with the format EPSG:XXXX

maybeSetModelCSFromData(topWidget, newCS, leftMostPoint)
Parameters:
  • topWidgetQWidget

  • newCS – str

  • leftMostPointGKPoint

Return type:

bool

Importing data from an external source with a CS. If this CS is: * - Unprojected: either set the projected CS from data (UTM) or keep the model CS * - Projected: either set the CS ot keep the model one

toDegrees(p)
Parameters:

pGKPoint

Return type:

GKPoint

Converts a point in m to longitude (X) and latitude (Y) using the model coordinate system

toMeters(pts)
Parameters:

ptsGKPoints

Converts a vector of points from the default degree CS (“EPSG:4326”) to the model coordinate system. The input vector is modified

toMeters(p)
Parameters:

pGKPoint

Return type:

GKPoint

Converts a point from the default degree CS (“EPSG:4326”) to the model coordinate system. The point to be converted should be defined as GKPoint ( latitude, longitude ).

toMeters(fromCS, p)
Parameters:
Return type:

GKPoint

Converts a point from a CS to the model coordinate system. UnknownCommand GKModel::getDefaultCS.

toMeters(units, p, fromCS)
Parameters:
Return type:

GKPoint

Converts a point from “units” to m. Entry point is in fromCS coordinate system. The destination * coordinate system is the one defined in the model. UnknownCommand GKModel::getDefaultCS.

validateCSForAimsunMap(cs)
Parameters:

cs – str

Return type:

str

See if the CS can be used as the Aimsun model CS. Must be projected and in meters. * Returns an error explanation or an empty string if it is OK.