python-awips/dynamicserialize/adapters/JTSEnvelopeAdapter.py

31 lines
849 B
Python
Raw Permalink Normal View History

2018-09-05 15:52:38 -06:00
#
# Adapter for com.vividsolutions.jts.geom.Envelope
#
#
# SOFTWARE HISTORY
#
# Date Ticket# Engineer Description
# ------------ ---------- ----------- --------------------------
# 05/29/13 2023 dgilling Initial Creation.
#
from dynamicserialize.dstypes.com.vividsolutions.jts.geom import Envelope
ClassAdapter = 'com.vividsolutions.jts.geom.Envelope'
2018-10-14 17:37:08 -06:00
2018-09-05 15:52:38 -06:00
def serialize(context, envelope):
context.writeDouble(envelope.getMinX())
context.writeDouble(envelope.getMaxX())
context.writeDouble(envelope.getMinY())
context.writeDouble(envelope.getMaxY())
2018-10-14 17:37:08 -06:00
2018-09-05 15:52:38 -06:00
def deserialize(context):
env = Envelope()
env.setMinX(context.readDouble())
env.setMaxX(context.readDouble())
env.setMinY(context.readDouble())
env.setMaxY(context.readDouble())
return env