[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[McIDAS #EKV-159239]: MAKEMAP and GeoJSON



Hi Mike,

re: GEMPAK's shapefile reader?

> Well this led me down a rabbit hole, but you're right.  And what's more, it
> still works (mostly)!

I am _pleasantly_ surprised :-)

re:
> The Gempak program is shpcv, and after finding the documentation for it I
> gave it a try with a roads shapefile I got from here:
> https://www.naturalearthdata.com/downloads/10m-cultural-vectors/roads/

Thanks for the URL.

re:
> For the sake of documenting the details of what I did:
> 
> - The shpcv program died reading the full original file (Segmentation
>   fault (core dumped)), can't say I'm surprised by that as it's a detailed
>   global dataset
> 
> - I opened it up in Qgis and exported roads in the USA that had
>   level=Interstate, and shpcv was able to generate output for that subset.
> 
> - The next issue I found though is ^A characters preceding each group in
>   the output ASCII file, and I believe MAKEMAP was choking on those...
> 
> - MAKEMAP: Begin
>   makemap.k: ERROR reading number of points in segment
>   makemap.k: ERROR writing OUTINTZ
> 
> - A sed -e "s/^A//" command was able to take care of that, and
>   MAKEMAP worked afterwards.
> 
> - There were of course a few other nuances such as having the right
>   files in the right MCDATA directory and setting West=NEG, but the map works
>   in McIDAS!

I write emails that contain information "for the files" all of the time :-)

re:
> So now that I know this process gets results, I should be able to formalize
> this and make more.  But it's still a janky process that relies on shpcv
> (which doesn't have a Gempak doc page, though that can change ;) ), so I
> still feel it's not a fully ideal method.  Maybe I'm just being picky.

I agree that it is not even remotely ideal.  But, my approach has pretty
much always been to get something working and move on to the next thing.

re:

> After getting the above process to work I'd probably keep trying that over
> writing my own code, mostly because the output was already formatted
> correctly (apart from the ^A characters) so that would likely be less
> effort required on my part.  But in the event I run into a shapefile that
> shpcv can't handle, reading it with Python could still be another option.

Sounds good.

re: send a note to the SSEC/MUG to find out what they use

> Thanks for reaching out to the MUG, I'm very curious to hear what they'll
> have to say.  I really want to believe there's a more streamlined process
> than the two above.

I would imagine that someone there has created a non-McIDAS 
application/procedure
that can create McDAS OUTline files, but I could be wrong.  Let's see what
they have to say, if anything.

re: Tcl

> I've never had the pleasure of working with Tcl, but I'll check it out and
> maybe add another tool to my belt.  At a glance though it does appear
> there's a Json package available:
> https://core.tcl-lang.org/tcllib/doc/trunk/embedded/md/tcllib/files/modules/json/json.md

I discovered Tcl/Tk (Tcl is the scripting language, and Tk provides the ability 
to create
GUIs) about 20-25 years ago when I was an up and coming tool.  During one of my 
MUG
Meeting visits, I talked up the packages (I may have even done a talk, but I can
remember if I did), and they inspired SSEC to adopt their use for a McIDAS-X 
GUI.
Like Python, Tcl/Tk has had a LOT of packages developed as addons, and they have
been very useful to me, at least, in a variety of contexts.  However, when I
set about to write the scripts that create content for various IDD datastreams,
I decided to drop back to using BASH as it is a lowest common denominator.  If
I were to revamp all of the scripts starting now, I may choose Python or more
likely Go.

re:

> Thanks for your insight as always,

No worries.

On a separate, but somewhat related note, I just re-cut the McIDAS-X/XCD/XRD
v2020a distribution.  Why, you may ask?  The ABIN server needed to be updated
to once again work correctly with CSU/CIRA Level2 products (e.g., GeoColor,
DebraDust, and CloudSnow), and the make file setup needed some adjustments
to fix typos, undefined macros, etc.  I will be putting this updated
"release" out on FTP for another site to grab sometime today.  I will send
you a note to let you know when the code is there so you can grab it.

Cheers,

Tom
--
****************************************************************************
Unidata User Support                                    UCAR Unidata Program
(303) 497-8642                                                 P.O. Box 3000
address@hidden                                   Boulder, CO 80307
----------------------------------------------------------------------------
Unidata HomePage                       http://www.unidata.ucar.edu
****************************************************************************


Ticket Details
===================
Ticket ID: EKV-159239
Department: Support McIDAS
Priority: Normal
Status: Closed
===================
NOTE: All email exchanges with Unidata User Support are recorded in the Unidata 
inquiry tracking system and then made publicly available through the web.  If 
you do not want to have your interactions made available in this way, you must 
let us know in each email you send to us.