responsibility of main sorurce files

View: New views
7 Messages — Rating Filter:   Alert me  

responsibility of main sorurce files

by jiong :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I'm new fan of PostGIS. Could you help me for my starting?

May be due to the C language characteristics, the code isn't clear enough as C++. I'm puzzled with the function responsibilities of main sorurce files, such as lwgeom.c/legeom_api.c/lwgeom_functions_basic.c/lwgeom_functions_analytic.c and every LW*.c like lwline.c.   Are they have clearly responsibilities for everyone? Then i will know, a new funtion should put where.

Thanks!

Re: responsibility of main sorurce files

by Paul Ramsey-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

A new function should be put where it belongs... what kind of new
function are you envisioning?

P

On Wed, Apr 2, 2008 at 12:15 AM, jiong <xie_jiong@...> wrote:

>
>  I'm new fan of PostGIS. Could you help me for my starting?
>
>  May be due to the C language characteristics, the code isn't clear enough as
>  C++. I'm puzzled with the function responsibilities of main sorurce files,
>  such as
>  lwgeom.c/legeom_api.c/lwgeom_functions_basic.c/lwgeom_functions_analytic.c
>  and every LW*.c like lwline.c.   Are they have clearly responsibilities for
>  everyone? Then i will know, a new funtion should put where.
>
>  Thanks!
>
>  --
>  View this message in context: http://www.nabble.com/responsibility-of-main-sorurce-files-tp16443789p16443789.html
>  Sent from the PostGIS - Dev mailing list archive at Nabble.com.
>
>  _______________________________________________
>  postgis-devel mailing list
>  postgis-devel@...
>  http://postgis.refractions.net/mailman/listinfo/postgis-devel
>
_______________________________________________
postgis-devel mailing list
postgis-devel@...
http://postgis.refractions.net/mailman/listinfo/postgis-devel

Re: responsibility of main sorurce files

by jiong :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Paul:

    I am just reading the code and so has above puzzles, more such as what's the difference of liblwgeom.h and lwgeom.h?

    Are there any explain or specifiactions for the code? maybe just about functions of every source file. thanks!

Jiong


Paul Ramsey-3 wrote:
A new function should be put where it belongs... what kind of new
function are you envisioning?

P

On Wed, Apr 2, 2008 at 12:15 AM, jiong <xie_jiong@163.com> wrote:
>
>  I'm new fan of PostGIS. Could you help me for my starting?
>
>  May be due to the C language characteristics, the code isn't clear enough as
>  C++. I'm puzzled with the function responsibilities of main sorurce files,
>  such as
>  lwgeom.c/legeom_api.c/lwgeom_functions_basic.c/lwgeom_functions_analytic.c
>  and every LW*.c like lwline.c.   Are they have clearly responsibilities for
>  everyone? Then i will know, a new funtion should put where.
>
>  Thanks!
>
>  --
>  View this message in context: http://www.nabble.com/responsibility-of-main-sorurce-files-tp16443789p16443789.html
>  Sent from the PostGIS - Dev mailing list archive at Nabble.com.
>
>  _______________________________________________
>  postgis-devel mailing list
>  postgis-devel@postgis.refractions.net
>  http://postgis.refractions.net/mailman/listinfo/postgis-devel
>
_______________________________________________
postgis-devel mailing list
postgis-devel@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-devel

Re: responsibility of main sorurce files

by Paul Ramsey-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Sorry, no, there isn't a developer's guide, it's learn-by-reading.

Good catch, it appears that lwgeom.h is an orphan and all the
declarative work is done in liblwgeom.h

That's what grep tells me, anyways:

grep "lwgeom\.h" *.h *.c | grep -v lib

P

On Fri, Apr 4, 2008 at 11:54 PM, jiong <xie_jiong@...> wrote:

>
>  Hi Paul:
>
>     I am just reading the code and so has above puzzles, more such as what's
>  the difference of liblwgeom.h and lwgeom.h?
>
>     Are there any explain or specifiactions for the code? maybe just about
>  functions of every source file. thanks!
>
>  Jiong
>
>
>
>
>
>  Paul Ramsey-3 wrote:
>  >
>  > A new function should be put where it belongs... what kind of new
>  > function are you envisioning?
>  >
>  > P
>  >
>  > On Wed, Apr 2, 2008 at 12:15 AM, jiong <xie_jiong@...> wrote:
>  >>
>  >>  I'm new fan of PostGIS. Could you help me for my starting?
>  >>
>  >>  May be due to the C language characteristics, the code isn't clear
>  >> enough as
>  >>  C++. I'm puzzled with the function responsibilities of main sorurce
>  >> files,
>  >>  such as
>  >>
>  >> lwgeom.c/legeom_api.c/lwgeom_functions_basic.c/lwgeom_functions_analytic.c
>  >>  and every LW*.c like lwline.c.   Are they have clearly responsibilities
>  >> for
>  >>  everyone? Then i will know, a new funtion should put where.
>  >>
>  >>  Thanks!
>  >>
>  >>  --
>  >>  View this message in context:
>  >> http://www.nabble.com/responsibility-of-main-sorurce-files-tp16443789p16443789.html
>  >>  Sent from the PostGIS - Dev mailing list archive at Nabble.com.
>  >>
>  >>  _______________________________________________
>  >>  postgis-devel mailing list
>  >>  postgis-devel@...
>  >>  http://postgis.refractions.net/mailman/listinfo/postgis-devel
>  >>
>  > _______________________________________________
>  > postgis-devel mailing list
>  > postgis-devel@...
>  > http://postgis.refractions.net/mailman/listinfo/postgis-devel
>  >
>  >
>
>  --
>  View this message in context: http://www.nabble.com/responsibility-of-main-sorurce-files-tp16443789p16510195.html
>
>
> Sent from the PostGIS - Dev mailing list archive at Nabble.com.
>
>  _______________________________________________
>  postgis-devel mailing list
>  postgis-devel@...
>  http://postgis.refractions.net/mailman/listinfo/postgis-devel
>
_______________________________________________
postgis-devel mailing list
postgis-devel@...
http://postgis.refractions.net/mailman/listinfo/postgis-devel

Re: responsibility of main sorurce files

by Mark Cave-Ayland-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Saturday 05 April 2008 15:47:37 Paul Ramsey wrote:

> Sorry, no, there isn't a developer's guide, it's learn-by-reading.
>
> Good catch, it appears that lwgeom.h is an orphan and all the
> declarative work is done in liblwgeom.h
>
> That's what grep tells me, anyways:
>
> grep "lwgeom\.h" *.h *.c | grep -v lib
>
> P

I think this goes back to when strk built a clear level of abstraction between
the geometry-handling functions and the PostgreSQL wrappers. The idea was
that other applications could link to the lwgeom library separately to access
some PostGIS functionality even if they didn't want to use the
PostgreSQL-specific parts.

To the best of my knowledge, there were no applications written to make use of
the library (and I suspect that there may be some blurring between the
lines), but is this something we would like to maintain?


ATB,

Mark.

--
Mark Cave-Ayland
Sirius Corporation - The Open Source Experts
http://www.siriusit.co.uk
T: +44 870 608 0063
_______________________________________________
postgis-devel mailing list
postgis-devel@...
http://postgis.refractions.net/mailman/listinfo/postgis-devel

Re: responsibility of main sorurce files

by jiong :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

There are also many to and from ewkt and ewkb funs spread in differnet source files, i dont understand why do so? such as

LWGEOM_to_bytea in lwgeom_inout.c   -> PG_LWGEOM to ewkb
pglwgeom_to_ewkb in lwgeom_pg.c      -> PG_LWGEOM to ewkb

LWGEOM_asEWKT in lwgeom_basic.c    -> PG_LWGEOM to ewkt
LWGEOM_to_text in lwgeom_inout.c     -> PG_LWGEOM to ewkt

Re: responsibility of main sorurce files

by Mark Cave-Ayland-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Monday 07 April 2008 13:41:33 jiong wrote:
> There are also many to and from ewkt and ewkb funs spread in differnet
> source files, i dont understand why do so? such as
>
> LWGEOM_to_bytea in lwgeom_inout.c   -> PG_LWGEOM to ewkb
> pglwgeom_to_ewkb in lwgeom_pg.c      -> PG_LWGEOM to ewkb
>
> LWGEOM_asEWKT in lwgeom_basic.c    -> PG_LWGEOM to ewkt
> LWGEOM_to_text in lwgeom_inout.c     -> PG_LWGEOM to ewkt

Good question. I remember looking at the input/output functions whilst delving
into the parser a while back and noticing that there was a lot of overlap.
Unfortunately I wasn't really involved with writing them so can't comment
much further :(


ATB,

Mark.

--
Mark Cave-Ayland
Sirius Corporation - The Open Source Experts
http://www.siriusit.co.uk
T: +44 870 608 0063
_______________________________________________
postgis-devel mailing list
postgis-devel@...
http://postgis.refractions.net/mailman/listinfo/postgis-devel