mirror of
https://github.com/Unidata/python-awips.git
synced 2025-02-24 06:57:56 -05:00
34 lines
725 B
Python
34 lines
725 B
Python
|
##
|
||
|
##
|
||
|
|
||
|
|
||
|
#
|
||
|
# Adapter for com.vividsolutions.jts.geom.Coordinate
|
||
|
#
|
||
|
#
|
||
|
# SOFTWARE HISTORY
|
||
|
#
|
||
|
# Date Ticket# Engineer Description
|
||
|
# ------------ ---------- ----------- --------------------------
|
||
|
# 01/20/11 dgilling Initial Creation.
|
||
|
#
|
||
|
#
|
||
|
#
|
||
|
|
||
|
from dynamicserialize.dstypes.com.vividsolutions.jts.geom import Coordinate
|
||
|
|
||
|
ClassAdapter = 'com.vividsolutions.jts.geom.Coordinate'
|
||
|
|
||
|
def serialize(context, coordinate):
|
||
|
context.writeDouble(coordinate.getX())
|
||
|
context.writeDouble(coordinate.getY())
|
||
|
|
||
|
def deserialize(context):
|
||
|
x = context.readDouble()
|
||
|
y = context.readDouble()
|
||
|
coord = Coordinate()
|
||
|
coord.setX(x)
|
||
|
coord.setY(y)
|
||
|
return coord
|
||
|
|