[postgis-devel] GUI Time

Mark Cave-Ayland mark.cave-ayland at siriusit.co.uk
Mon Jan 5 02:18:19 PST 2009


Paul Ramsey wrote:

> Hi folks,
> 
> My Christmas present to myself was trying to do a GUI for shape 
> importing (and eventually exporting). It turned out the GUI wasn't too 
> hard... unfortunately when it came time to bolt in the actual guts, the 
> crufty legacy code got in the way... the assumption of emitting to 
> stdout is pretty backed in. So getting this working is going to take a 
> pretty radical re-work. I'll work off to the side of the existing code, 
> and create three new bits:
> 
> shp2pgsql-core.c  - where the work gets done
> shp2pgsql-gui.c  - the gui frontend
> shp2pgsql-cli.c  - the commandline frontend
> 
> Best,
> 
> P.

Yup indeed. I did some testing on liblwgeom over Christmas (see email to 
follow over the next few days) and realised that the existing dual 
memory model is just plain bad.

My feeling is that we need to get liblwgeom to the point where we can 
rip out the lwgeom_init_allocators() callback and handle the memory 
management/errors ourselves, so this would be one less thing for you to 
worry about.

But yeah, the loaders aren't the best example of C coding around and so 
I wouldn't be averse to them being reworked. Perhaps similar to 
liblwgeom you could make shp2pgsql-core.c a static library which gets 
linked into both the CLI and GUI versions? I'd suggest if this is major 
work then it should go into a separate branch so that trunk will work as 
is, and then import the code into trunk when you have something tested 
that works.


ATB,

Mark.

-- 
Mark Cave-Ayland
Sirius Corporation - The Open Source Experts
http://www.siriusit.co.uk
T: +44 870 608 0063



More information about the postgis-devel mailing list