Reader for Well Known Text format

44 views
Skip to first unread message

Andrew Cool

unread,
May 13, 2024, 11:10:49 PM5/13/24
to idl-pvwave
Hi,

Does anyone have a general reader routine for files in Well Known Text (WKT) format?

In particular, I'm trying to parse this file of Auroral predictions :-


TIA,

Andrew

Bernat

unread,
May 13, 2024, 11:18:34 PM5/13/24
to idl-pvwave

Chris Torrence

unread,
May 15, 2024, 12:03:45 AM5/15/24
to idl-pvwave
Yep, that's JSON alright. I was able to read the data using the new HttpRequest class:

IDL> !version.release
9.0.0
IDL> data = httprequest.get('https://services.swpc.noaa.gov/json/ovation_aurora_latest.json')
IDL> json = data.json()
IDL> json.keys()
[
    "Observation Time",
    "Forecast Time",
    "Data Format",
    "coordinates",
    "type"
]
IDL> coord = (json['coordinates']).toArray()
IDL> help, coord                            
COORD           LONG64    = Array[65160, 3]
IDL> print, min(coord, dim=1)
                     0                   -90                     0
IDL> print, max(coord, dim=1)
                   359                    90                    18

-Chris
NV5 Geospatial Software
Reply all
Reply to author
Forward
0 new messages