Register | Login
Attackpoint - performance and training tools for orienteering athletes

Discussion: OCAD file parser

in: Orienteering; General

Mar 18, 2014 4:39 PM # 
Tundra/Desert:
I was just randomly hoping that someone has at some point written an OCAD file format parser that could dump an XML output... specifically interested in things that OCAD either doesn't display back, or displays with less precision than is stored internally. Interested in OCAD 8.
Advertisement  
Mar 18, 2014 4:49 PM # 
edwarddes:
I don't know of any that are easily available, but there are a number that have been written.
Purple pen has one, and its source is mostly available. Ghetto Cad/Catching Features has a parser for OCAD 8, Greg may be able to help you out. I wrote one but got really frustrated with the file format and gave up on that project.

I was working on a parser that could read OCAD 6/8/9/10 and do version conversion without having OCAD, and then secondarily wanted to get a set of GDAL/OGR drivers written so I could dump data in and out in a sensible way.
Mar 18, 2014 5:13 PM # 
eddie:
I have ocad5 and 6 readers (written in IDL), and a 5 writer. They're clumsy, but you're welcome to the source. Halfway through the 6 writer, with a similar goal as Ed. But there are millions of other mapping priorities at the moment and I never seem to get it done. Although I do have an actual project in this vein for DVOA which will bump it up my list after the TT. I have no plans to move beyond 6 - like Ed said, the formats get uglier...
Mar 18, 2014 5:30 PM # 
cedarcreek:
Open Orienteering Mapper opens OCAD files, and is open source, so it might have something to start with.
Mar 18, 2014 11:48 PM # 
jjcote:
Somewhere I probably still have the C source code for reading and writing 0CAD 3 and 4...
Mar 19, 2014 12:46 AM # 
Juffy:
I wrote one but got really frustrated with the file format and gave up on that project.

Oh good, I'm not the only one. Partially-documented binary formats drive me completely insane.

From memory I got halfway through parsing the symbol table before I randomly lost a byte somewhere and it would all fall to pieces.
Mar 19, 2014 1:06 AM # 
edwarddes:
I wrote one but got really frustrated with the file format and gave up on that project.

Oh good, I'm not the only one. Partially-documented binary formats drive me completely insane.

From memory I got halfway through parsing the symbol table before I randomly lost a byte somewhere and it would all fall to pieces.


It helps to think like a pascal programmer. The older formats are just dumps of the in memory data structures. The newer (9+) formats have moved a lot of data into the strings section.
Mar 19, 2014 2:09 AM # 
Juffy:
It helps to think like a pascal programmer.

But I don't want to think like a Pascal programmer, that would make me....well, basically, my father.

Actually I think he might have done Fortran, but you get the idea. Why can't we re-write the OCAD format as a nice JSON web service or something? :)
Mar 19, 2014 3:15 PM # 
Tundra/Desert:
Why can't OCAD be rewritten so it's not possible to F9 perfectly happily georeferenced rasters? I digress.
Mar 19, 2014 3:22 PM # 
edwarddes:
Because OCAD isn't a GIS platform?
Why can't OCAD be rewritten as a plugin for QGIS? (ignoring that QGIS is large and slow, and not at all designed to do the level of display manipulation that OCAD is actually good at)

One of my goals of having a GDAL/OGR OCAD driver was to be able to load OCAD files into QGIS for display.
Mar 20, 2014 8:39 AM # 
f93erad:
I've written a parser that converts OCAD files into Quartz primitives for rendering on iPhones / Macs. My experience is that the information is incredibly detailed and any other file format you could invent for maps would be very complicated as well. The only benefit would be to get rid of all the cruft in the OCAD file format - it really shows its age.
Oct 1, 2016 2:37 PM # 
Juffy:
Nothing like having a really good idea, doing a thread search and finding that not only are you not the first person to have this idea, but I actually posted in the old thread as well.

One of my goals of having a GDAL/OGR OCAD driver was to be able to load OCAD files into QGIS for display.


I'm currently exploring a similar idea - before I either:
a) go mad,
b) write my own, or
c) go mad writing my own,
has anyone seen/written/imagined an OCAD parser written in PHP, or similar server-side language?
Oct 1, 2016 4:52 PM # 
jjcote:
I wrote one in C a long time ago, and had some utilities based on it. But the format has changed, and I never updated it.
Oct 1, 2016 11:42 PM # 
rm:
Ditto, except maybe a different language, I don't remember. But why OCAD, and not OOM?
Oct 2, 2016 12:14 AM # 
Juffy:
Because, as with everything, if you make it hard then people just won't do it. :)
Oct 2, 2016 3:15 AM # 
tRicky:
I've used OCAD many times.

This discussion thread is closed.