[postgis] compiling postgis in cygwin

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

[postgis] compiling postgis in cygwin

Peep Krusberg
Hi,
I'm trying to compile postgis in cygwin (1.1.7.1) environment. It's probably
more
postgres (7.1) problem, but make fails:
- compiler gives one warning (postgis.c:1319, 'result' might be used
uninitialized in this function)
- dlltool doesn't complain
- dllwrap fails by giving bunch of undefined reference errors (elog, pfree,
etc).
By my knowledge I did maximum in installing postgres but it seems something
is still missing from that side. Any ideas?
Regards,
Peep


To unsubscribe from this group, send an email to:
[hidden email]

 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 



Reply | Threaded
Open this post in threaded view
|

Re: [postgis] compiling postgis in cygwin

Paul Ramsey-2
That is a fairly old cygwin I think (IANAE)... see if using a later one
(directions on building pgsql for win32 are at
http://people.freebsd.org/~kevlo/postgres/portNT.html) makes things
better. According to that page, the latest version is 1.3.2
Paul

Peep Krusberg wrote:

>
> Hi,
> I'm trying to compile postgis in cygwin (1.1.7.1) environment. It's probably
> more
> postgres (7.1) problem, but make fails:
> - compiler gives one warning (postgis.c:1319, 'result' might be used
> uninitialized in this function)
> - dlltool doesn't complain
> - dllwrap fails by giving bunch of undefined reference errors (elog, pfree,
> etc).
> By my knowledge I did maximum in installing postgres but it seems something
> is still missing from that side. Any ideas?
> Regards,
> Peep
>

To unsubscribe from this group, send an email to:
[hidden email]

 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 



Reply | Threaded
Open this post in threaded view
|

[postgis] Spatial Query

Doug Nebert-2
I would like to know the syntax or references to such examples
that would facilitate a query of a point dataset with a circle (point
and radius) area of interest. Basically I want to quickly clip out
all points falling in a circle and then use the result to sum one of
the columns for the selected region.

Where, if anywhere, might there be a reference set of example
spatial operators (encloses, overlaps, touches, etc) and primitives
for PostgreSQL?  Does it truly follow the Simple Features SQL
specification from OpenGIS?

Doug.


To unsubscribe from this group, send an email to:
[hidden email]

 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 


dn.vcf (191 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [postgis] Spatial Query

Paul Ramsey-2

Doug Nebert wrote:

>
> I would like to know the syntax or references to such examples
> that would facilitate a query of a point dataset with a circle (point
> and radius) area of interest. Basically I want to quickly clip out
> all points falling in a circle and then use the result to sum one of
> the columns for the selected region.
>
> Where, if anywhere, might there be a reference set of example
> spatial operators (encloses, overlaps, touches, etc) and primitives
> for PostgreSQL?  Does it truly follow the Simple Features SQL
> specification from OpenGIS?

The postgreSQL users manual gives all the spatial operators. The only
one which is truly germain to PostGIS right now is '&&' which is
'overlaps', and it is only processed in the naive sense of
'boundingbox(a) overlaps boundingbox(b)'.

With respect to the simple features spec, PostGIS tries to follow the
input/output API: the text representation is the OGIS one (and Dave just
finished off well-known binary representation! have I mentioned that
Dave rocks?).

The full SFSpec has scads of really hard operators. It's possible we'll
do them in the future, but it is not a top-of-the-foodchain requirement
yet.

To solve your specific problem with PostGIS quickly on a large dataset
you'll have to note firstly that we don't have a 'circle' object. We
have the SF objects, so if you want a circle, you'll have to construct
one vertex-by-vertex (or construct a similar sized box). Secondly, you
can query your (presumably large) table of points against your query
feature with the && operator. Then, sadly, you'll have to write the
'within distance X of my center point' routine on the client side to
scroll through the small set of query results and discard the ones you
don't want.

At the moment, we're just trying to make storage & retrieval work as
well as possible. GIS-style functionality like the buffer query,
'within-X-yards-of', 'clipped-to-X', etc, is farther down the priority
chain at the moment.

--
      __
     /
     | Paul Ramsey
     | Refractions Research
     | Email: [hidden email]
     | Phone: (250) 885-0632
     \_

To unsubscribe from this group, send an email to:
[hidden email]

 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 



Reply | Threaded
Open this post in threaded view
|

RE: [postgis] compiling postgis in cygwin

Norman Vine
In reply to this post by Paul Ramsey-2
Paul Ramsey writes:
>
>That is a fairly old cygwin I think (IANAE)... see if using a later one
>(directions on building pgsql for win32 are at
>http://people.freebsd.org/~kevlo/postgres/portNT.html) makes things
>better. According to that page, the latest version is 1.3.2

>Peep Krusberg wrote:
>>
>> I'm trying to compile postgis in cygwin (1.1.7.1)
>> environment. It's probably  more
>> postgres (7.1) problem, but make fails:

attached find a modified Makefile that built the dll under Cygwin for me

This is with a current Cygwin installation as installed by clicking
on the "Install Cygwin Now" icon at http://www.cygwin.com.

I haven't managed to get make test to not complain yet but
then again I have never used Postgres before so I have some
learning to do.

Cheers

Norman Vine

To unsubscribe from this group, send an email to:
[hidden email]

 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 


Makefile (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [postgis] compiling postgis in cygwin

Paul Ramsey-2
Thanks Norman!
I merged the changes into our Unix makefile, and it didn't cause that
one to cack, so things look good :)
Paul

Norman Vine wrote:

>
> Paul Ramsey writes:
> >
> >That is a fairly old cygwin I think (IANAE)... see if using a later one
> >(directions on building pgsql for win32 are at
> >http://people.freebsd.org/~kevlo/postgres/portNT.html) makes things
> >better. According to that page, the latest version is 1.3.2
>
> >Peep Krusberg wrote:
> >>
> >> I'm trying to compile postgis in cygwin (1.1.7.1)
> >> environment. It's probably  more
> >> postgres (7.1) problem, but make fails:
>
> attached find a modified Makefile that built the dll under Cygwin for me
>
> This is with a current Cygwin installation as installed by clicking
> on the "Install Cygwin Now" icon at http://www.cygwin.com.
>
> I haven't managed to get make test to not complain yet but
> then again I have never used Postgres before so I have some
> learning to do.
>
> Cheers
>
> Norman Vine
>
> To unsubscribe from this group, send an email to:
> [hidden email]
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>   ------------------------------------------------------------------------
>                Name: Makefile
>    Makefile    Type: unspecified type (application/octet-stream)
>            Encoding: quoted-printable

To unsubscribe from this group, send an email to:
[hidden email]

 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 



Reply | Threaded
Open this post in threaded view
|

Re: [postgis] compiling postgis in cygwin

Doug Nebert-2
In reply to this post by Norman Vine
I was also unable to compile Postgres in Win2K with features in cygwin
but noticed that a pared down version pgsql came with cygwin
but had no source or contrib with it. So I followed the directions and
installed the Postgres source as described and the IPC stuff too. When
I attempt the ./configure I get the error:

"The procedure entry point getrlimit could not be located in the dynamic
link library cygwin1.dll"

even before I tried adding the postgis features.

This is a very fresh version of cygwin which I installed twice.
What's up?

Doug.

To unsubscribe from this group, send an email to:
[hidden email]

 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 


dn.vcf (191 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

RE: [postgis] compiling postgis in cygwin

Norman Vine
 Doug Nebert writes:

>
>I was also unable to compile Postgres in Win2K with features in cygwin
>but noticed that a pared down version pgsql came with cygwin
>but had no source or contrib with it. So I followed the directions and
>installed the Postgres source as described and the IPC stuff too. When
>I attempt the ./configure I get the error:
>
>"The procedure entry point getrlimit could not be located in
>the dynamic
>link library cygwin1.dll"
>
>even before I tried adding the postgis features.
>
>This is a very fresh version of cygwin which I installed twice.
>What's up?

Doug

The way I did this was

1) Use the Cygwin setup tool to get the Cygwin PostGres source
    this will install itself into /usr/src/postgres-xxx
2) un tar postgis into contrib
3) used these configure args to setup the postgres master makefile correctly
./configure --enable-multibyte --with-CXX --prefix=/usr --sysconfdir=/etc --
docdir=/usr/doc/postgresql-$version
make
Do not do make install as the supplied Cygwin binary has java support
builtin
which requires a LOT of work
4) cd to contrib/postgis and make and install postgis ala instrucrions in
readme

FWIW
I have temporarily placed at
http://www.vso.cape.com/~nhv/files/cygwin/cygwin_postgis.tgz

This was built against a Cygwin Installation built from todays Cygwin CVS
files
but I think that the above method should work just fine with the 1.3.2
distribution

Holler again if this doesn't work for you.

Cheers

Norman Vine


To unsubscribe from this group, send an email to:
[hidden email]

 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 



Reply | Threaded
Open this post in threaded view
|

Re: [postgis] compiling postgis in cygwin

Doug Nebert-2
Norman Vine wrote:

>  Doug Nebert writes:
> >

Turns out I had somehow an old cygwin1.dll file in my windows system
directory from an old install. I got directions to remove it and the compile
is well.

> The way I did this was
>
> 1) Use the Cygwin setup tool to get the Cygwin PostGres source
>     this will install itself into /usr/src/postgres-xxx

When I got the cygwin postgres source it places it under /contrib
instead. Is this a problem? Or should I move it to /usr/src?

Doug.

To unsubscribe from this group, send an email to:
[hidden email]

 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 


dn.vcf (191 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

RE: [postgis] compiling postgis in cygwin

Peep Krusberg
In reply to this post by Peep Krusberg
My way:
all these dllwrap undefine reference errors occurs because
make didn't find postgres libraries. So
- I did 'make --recon > m' and got a list of commands make
generated in the file 'm';
- added manually paths to libpostgres.a library to dllwrap lines
in the file 'm', and then run it; my example:

gcc -O2 -Wall -Wmissing-prototypes -Wmissing-declarations  -I.
-I../../src/include -I/usr/local/include  -c -o postgis.o postgis.c
dlltool --export-all --output-def postgis.def postgis.o
dllwrap -o postgis.dll --dllname postgis.dll --def postgis.def postgis.o
../../src/utils/dllinit.o /usr/local/pgsql/lib/libpostgres.a  -lcygipc
-lcrypt
dlltool --dllname postgis.dll --def postgis.def --output-lib libpostgis.a
dlltool --export-all --output-def postgis.def postgis.o
dllwrap -o postgis.dll --dllname postgis.dll --def postgis.def postgis.o
../../src/utils/dllinit.o /usr/local/pgsql/lib/libpostgres.a  -lcygipc
-lcrypt
dlltool --dllname postgis.dll --def postgis.def --output-lib libpostgis.a

Peep

> > I'm trying to compile postgis in cygwin (1.1.7.1) environment.
> > It's probably more postgres (7.1) problem, but make fails:

To unsubscribe from this group, send an email to:
[hidden email]

 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/