[postgis-users] Re: Lat/lon bounding box to area?

Mark Thomas spatialguru.net at gmail.com
Fri Feb 2 11:24:56 PST 2007


Sure, use GeomFromText or GeomFromEWKT and pass in WKT for a polygon defined
by the bbox

On 2/2/07, postgis-users-request at postgis.refractions.net <
postgis-users-request at postgis.refractions.net> wrote:
>
> Send postgis-users mailing list submissions to
>         postgis-users at postgis.refractions.net
>
> To subscribe or unsubscribe via the World Wide Web, visit
>         http://postgis.refractions.net/mailman/listinfo/postgis-users
> or, via email, send a message with subject or body 'help' to
>         postgis-users-request at postgis.refractions.net
>
> You can reach the person managing the list at
>         postgis-users-owner at postgis.refractions.net
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of postgis-users digest..."
>
>
> Today's Topics:
>
>    1. How best to do this? (Stephen Woodbridge)
>    2. Re: How best to do this? (Stephen Woodbridge)
>    3. Re: How best to do this? (Paul Ramsey)
>    4. Re: pg_restore problem - linked to different versions?
>       (Mark Cave-Ayland)
>    5. Errors in jdbc rpm build on Fedora Core 6 (Dido)
>    6. Re: pg_restore problem - linked to different versions?
>       (Stefan Schwarzer)
>    7. Re: How best to do this? (Stephen Woodbridge)
>    8. Re: How best to do this? (Paul Ramsey)
>    9. Lat/lon bounding box to area? (Steve Benzo)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Thu, 01 Feb 2007 22:34:38 -0500
> From: Stephen Woodbridge <woodbri at swoodbridge.com>
> Subject: [postgis-users] How best to do this?
> To: PostGIS Users Discussion <postgis-users at postgis.refractions.net>
> Message-ID: <45C2B14E.2070904 at swoodbridge.com>
> Content-Type: text/plain; charset=UTF-8; format=flowed
>
> Hi all,
>
> Sorry the subject line is not more useful, but let me explain.
>
> 1) I have a set of polgons A and another set of polygon B
> 2) I need to a new set of polygons C that are the union of
>     A intersect B and A difference B
>
> So basically B partially covers A and I want to split polygons in a into
> the covered piece(s) and that that is not covered.
>
> On the surface this is very straight forward, but it isn't ...
>
> insert into newtable (....)
>     select ..., intersection(A.the_geom, B.the_geom) as the_geom
>       from A, B
>       where A.the_geom && B.the_geom and
>         intersects(A.the_geom, B.the_geom);
>
> This works, but I get a bunch of GEOMETRYCOLLECTION objects in the
> results and out of 1022 collection I have 2780 additional POLYGONs.
>
> So I could do something like:
>
> insert into newtable (....)
>      select * from
>        (select ..., (dump(the_geom)).geom as the_geom from newtable
>           where geometrytype(the_geom)='GEOMETRYCOLLECTION' ) as foo
>      where geometrytype(the_geom)='POLYGON';
>
> delete from newtable where geometrytype(the_geom)='GEOMETRYCOLLECTION';
>
> So now comes the tricky part how do you do the difference? I was
> thinking I could take A difference newtable but because I have multiple
> little pieces instead of a single piece, I think I am getting:
>    (A - Part1), (A - Part2), (A - Part3) instead of
>    (A - Part1 - Part2 - Part3)
>
> So I think I need to union the polygon pieces from each row that is
> dumped above. Is that as simple as tossing part of the dump into a
> geomunion()? How would that look?
>
> -Steve W
>
>
> ------------------------------
>
> Message: 2
> Date: Fri, 02 Feb 2007 00:01:39 -0500
> From: Stephen Woodbridge <woodbri at swoodbridge.com>
> Subject: Re: [postgis-users] How best to do this?
> To: PostGIS Users Discussion <postgis-users at postgis.refractions.net>
> Message-ID: <45C2C5B3.2020709 at swoodbridge.com>
> Content-Type: text/plain; charset=UTF-8; format=flowed
>
> OK, one step forward and two steps backward ...
>
> I was about to get rid of my gemetrycollections with:
>
> update newtable set the_geom =
>   (select geomunion(geom1) from
>     (select (dump(the_geom)).geom as geom1) as foo
>      where geometrytype(geom1)='POLYGON'
>   )
>   where geometrytype(the_geom)='GEOMETRYCOLLECTION';
>
> This worked very nicely once I figured out that this was the way to
> solve the problem. So now each geometry collection is converted into a
> polygon or multipolygon and all the linestring and point artifacts of
> the intersection are removed.
>
> select distinct geometrytype(the_geom) from soils2;
> POLYGON
> MULTIPOLYGON
>
> select * from soils where not isvalid(the_geom);
> reports 0 rows
>
> insert into newtable (..., the_geom)
>    select A....,
>           difference(A.the_geom, B.the_geom) as the_geom
>    from A, B
>    where A.the_geom && B.the_geom and overlaps(A.the_geom, B.the_geom);
>
> NOTICE:  TopologyException: no outgoing dirEdge found
> (287030,892621,892621)
>
> ERROR:  GEOS difference() threw an error!
>
> Now what do I do??? If I have to upgrade it might be easiest to upgrade
> my WinXP laptop if there is an easy way to do that, then dump and load
> the data to that.
>
> select postgis_full_version();
> "POSTGIS="1.1.5" GEOS="2.2.3-CAPI-1.1.1" PROJ="Rel. 4.4.9, 29 Oct 2004"
> USE_STATS (procs from 1.1.1 need upgrade)"
>
> select version();
> "PostgreSQL 8.0.8 on i386-portbld-freebsd5.3, compiled by GCC cc (GCC)
> 3.4.2 [FreeBSD] 20040728"
>
> -Steve
>
> Stephen Woodbridge wrote:
> > Hi all,
> >
> > Sorry the subject line is not more useful, but let me explain.
> >
> > 1) I have a set of polgons A and another set of polygon B
> > 2) I need to a new set of polygons C that are the union of
> >    A intersect B and A difference B
> >
> > So basically B partially covers A and I want to split polygons in a into
> > the covered piece(s) and that that is not covered.
> >
> > On the surface this is very straight forward, but it isn't ...
> >
> > insert into newtable (....)
> >    select ..., intersection(A.the_geom, B.the_geom) as the_geom
> >      from A, B
> >      where A.the_geom && B.the_geom and
> >        intersects(A.the_geom, B.the_geom);
> >
> > This works, but I get a bunch of GEOMETRYCOLLECTION objects in the
> > results and out of 1022 collection I have 2780 additional POLYGONs.
> >
> > So I could do something like:
> >
> > insert into newtable (....)
> >     select * from
> >       (select ..., (dump(the_geom)).geom as the_geom from newtable
> >          where geometrytype(the_geom)='GEOMETRYCOLLECTION' ) as foo
> >     where geometrytype(the_geom)='POLYGON';
> >
> > delete from newtable where geometrytype(the_geom)='GEOMETRYCOLLECTION';
> >
> > So now comes the tricky part how do you do the difference? I was
> > thinking I could take A difference newtable but because I have multiple
> > little pieces instead of a single piece, I think I am getting:
> >   (A - Part1), (A - Part2), (A - Part3) instead of
> >   (A - Part1 - Part2 - Part3)
> >
> > So I think I need to union the polygon pieces from each row that is
> > dumped above. Is that as simple as tossing part of the dump into a
> > geomunion()? How would that look?
> >
> > -Steve W
> > _______________________________________________
> > postgis-users mailing list
> > postgis-users at postgis.refractions.net
> > http://postgis.refractions.net/mailman/listinfo/postgis-users
>
>
>
> ------------------------------
>
> Message: 3
> Date: Thu, 1 Feb 2007 21:14:22 -0800
> From: Paul Ramsey <pramsey at refractions.net>
> Subject: Re: [postgis-users] How best to do this?
> To: PostGIS Users Discussion <postgis-users at postgis.refractions.net>
> Message-ID: <D2E872F9-F43D-41DE-868C-F936776CECAD at refractions.net>
> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed
>
> GEOS 3 does include a number of fixes that will help difference and
> union.
>
> P
>
> On 1-Feb-07, at 9:01 PM, Stephen Woodbridge wrote:
>
> > OK, one step forward and two steps backward ...
> >
> > I was about to get rid of my gemetrycollections with:
> >
> > update newtable set the_geom =
> >  (select geomunion(geom1) from
> >    (select (dump(the_geom)).geom as geom1) as foo
> >     where geometrytype(geom1)='POLYGON'
> >  )
> >  where geometrytype(the_geom)='GEOMETRYCOLLECTION';
> >
> > This worked very nicely once I figured out that this was the way to
> > solve the problem. So now each geometry collection is converted
> > into a polygon or multipolygon and all the linestring and point
> > artifacts of the intersection are removed.
> >
> > select distinct geometrytype(the_geom) from soils2;
> > POLYGON
> > MULTIPOLYGON
> >
> > select * from soils where not isvalid(the_geom);
> > reports 0 rows
> >
> > insert into newtable (..., the_geom)
> >   select A....,
> >          difference(A.the_geom, B.the_geom) as the_geom
> >   from A, B
> >   where A.the_geom && B.the_geom and overlaps(A.the_geom, B.the_geom);
> >
> > NOTICE:  TopologyException: no outgoing dirEdge found
> > (287030,892621,892621)
> >
> > ERROR:  GEOS difference() threw an error!
> >
> > Now what do I do??? If I have to upgrade it might be easiest to
> > upgrade my WinXP laptop if there is an easy way to do that, then
> > dump and load the data to that.
> >
> > select postgis_full_version();
> > "POSTGIS="1.1.5" GEOS="2.2.3-CAPI-1.1.1" PROJ="Rel. 4.4.9, 29 Oct
> > 2004" USE_STATS (procs from 1.1.1 need upgrade)"
> >
> > select version();
> > "PostgreSQL 8.0.8 on i386-portbld-freebsd5.3, compiled by GCC cc
> > (GCC) 3.4.2 [FreeBSD] 20040728"
> >
> > -Steve
> >
> > Stephen Woodbridge wrote:
> >> Hi all,
> >> Sorry the subject line is not more useful, but let me explain.
> >> 1) I have a set of polgons A and another set of polygon B
> >> 2) I need to a new set of polygons C that are the union of
> >>    A intersect B and A difference B
> >> So basically B partially covers A and I want to split polygons in
> >> a into the covered piece(s) and that that is not covered.
> >> On the surface this is very straight forward, but it isn't ...
> >> insert into newtable (....)
> >>    select ..., intersection(A.the_geom, B.the_geom) as the_geom
> >>      from A, B
> >>      where A.the_geom && B.the_geom and
> >>        intersects(A.the_geom, B.the_geom);
> >> This works, but I get a bunch of GEOMETRYCOLLECTION objects in the
> >> results and out of 1022 collection I have 2780 additional POLYGONs.
> >> So I could do something like:
> >> insert into newtable (....)
> >>     select * from
> >>       (select ..., (dump(the_geom)).geom as the_geom from newtable
> >>          where geometrytype(the_geom)='GEOMETRYCOLLECTION' ) as foo
> >>     where geometrytype(the_geom)='POLYGON';
> >> delete from newtable where geometrytype(the_geom)
> >> ='GEOMETRYCOLLECTION';
> >> So now comes the tricky part how do you do the difference? I was
> >> thinking I could take A difference newtable but because I have
> >> multiple little pieces instead of a single piece, I think I am
> >> getting:
> >>   (A - Part1), (A - Part2), (A - Part3) instead of
> >>   (A - Part1 - Part2 - Part3)
> >> So I think I need to union the polygon pieces from each row that
> >> is dumped above. Is that as simple as tossing part of the dump
> >> into a geomunion()? How would that look?
> >> -Steve W
> >> _______________________________________________
> >> postgis-users mailing list
> >> postgis-users at postgis.refractions.net
> >> http://postgis.refractions.net/mailman/listinfo/postgis-users
> >
> > _______________________________________________
> > postgis-users mailing list
> > postgis-users at postgis.refractions.net
> > http://postgis.refractions.net/mailman/listinfo/postgis-users
>
>
>
> ------------------------------
>
> Message: 4
> Date: Fri, 02 Feb 2007 12:25:19 +0000
> From: Mark Cave-Ayland <mark.cave-ayland at ilande.co.uk>
> Subject: Re: [postgis-users] pg_restore problem - linked to different
>         versions?
> To: PostGIS Users Discussion <postgis-users at postgis.refractions.net>
> Message-ID: <1170419119.6358.10.camel at mca-desktop>
> Content-Type: text/plain
>
> On Thu, 2007-02-01 at 14:40 +0100, Stefan Schwarzer wrote:
> > Hi,
> >
> > I dumped my locally newly created database and wanted to restore on
> > the server. But I got this message.
> >
> > pg_restore: [archiver] unsupported version (1.10) in file header
> > pg_restore: [archiver] unsupported version (1.10) in file header
> > pg_restore call failed
> >
> > I guess the problem comes from the fact that:
> >
> >    the server runs with     PostGres 8.1.0 and PostGIS 1.1.2
> >    my local machine with PostGres 8.1.2 and PostGIS 1.1.1
> >
> > Could that be? And what can I do to solve the problem? In the moment
> > we won't touch our server, as it runs smoothly. And on my local
> > machine, a Mac, the different packages have been installed via the
> > prebuild packages from KyngChaos. I am no compiler.... So, not too
> > keen to re-compile Postgres and Postgis.... But I guess it's what I
> > have to do, right?
> >
> > Thanks for any hints...
>
>
> Hi Stefan,
>
> Could it be that you have multiple versions of pg_restore on your
> server? Looking at the PostgreSQL source code, version 1.10 headers were
> introduced with the advent of tablespaces (PostgreSQL 8.0) and so you
> are attempting to restore your pg_dump with a pg_restore for PostgreSQL
> < 8.0.
>
> So you need to check your paths and make sure you are using the
> pg_restore from your PostgreSQL 8.1 installation. Perhaps if you
> installed PostgreSQL 8.1 yourself, you need to be using the version
> in /usr/local/bin rather than the version in /usr/bin which originally
> came with your distro?
>
>
> Kind regards,
>
> Mark.
>
>
>
>
> ------------------------------
>
> Message: 5
> Date: Fri, 02 Feb 2007 16:04:01 +0200
> From: Dido <dido+postgis at sarge.mine.nu>
> Subject: [postgis-users] Errors in jdbc rpm build on Fedora Core 6
> To: PostGIS Users Discussion <postgis-users at postgis.refractions.net>
> Message-ID: <20070202160401.03ovwnsug400s8og at mx2.sofita.com>
> Content-Type: text/plain;
> charset=UTF-8;  DelSp="Yes";    format="flowed"
>
> Hi @,
> I'm trying to make postgis 1.2.1 Fedora Core 6 rpm package, but I have
> some errors.
> Also I would like to make postgis rpm against postgresql 8.2.1 , did
> someone have feedback ?
>
> Here is list of postgres and java packages:
> [root at fc-test ~]# rpm -qa | grep postgres
> postgresql-server-8.1.6-1.fc6
> postgresql-docs-8.1.6-1.fc6
> postgresql-8.1.6-1.fc6
> postgresql-devel-8.1.6-1.fc6
> postgresql-libs-8.1.6-1.fc6
> postgresql-contrib-8.1.6-1.fc6
> postgresql-jdbc-8.1.407-1jpp.4
> [root at fc-test ~]# rpm -qa | grep java
> java-1.4.2-gcj-compat-1.4.2.0-40jpp.110
> gcc-java-4.1.1-51.fc6
> java-1.4.2-gcj-compat-devel-1.4.2.0-40jpp.110
>
> I'm using following SPEC file from 1.2.0, with version change
>
> [root at fc-test ~]# cat /usr/src/redhat/SPECS/postgis.spec
> %{!?javabuild:%define   javabuild 1}
> %{!?utils:%define       utils 1}
> %{!?gcj_support:%define gcj_support 1}
>
> Summary:        Geographic Information Systems Extensions to PostgreSQL
> Name:           postgis
> Version:        1.2.1
> Release:        2%{?dist}
> License:        GPL
> Group:          Applications/Databases
> Source0:
> http://postgis.refractions.net/download/%{name}-%{version}.tar.gz
> Source4:        filter-requires-perl-Pg.sh
> #Patch1:                postgis-configure.patch
> Patch2:         postgis-javamakefile.patch
> URL:            http://postgis.refractions.net/
> BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u}
> -n)
>
> BuildRequires:  postgresql-devel, proj-devel, geos-devel, byacc,
> proj-devel, flex, postgresql-jdbc
> Requires:       postgresql, geos, proj
>
> %description
> PostGIS adds support for geographic objects to the PostgreSQL
> object-relational
> database. In effect, PostGIS "spatially enables" the PostgreSQL server,
> allowing it to be used as a backend spatial database for geographic
> information
> systems (GIS), much like ESRI's SDE or Oracle's Spatial extension. PostGIS
> follows the OpenGIS "Simple Features Specification for SQL" and has been
> certified as compliant with the "Types and Functions" profile.
>
> %if %javabuild
> %package jdbc
> Summary:        The JDBC driver for PostGIS
> Group:          Applications/Databases
> License:        LGPL
> Requires:       postgis
> BuildRequires:  ant >= 0:1.6.2, junit >= 0:3.7
>
> %if %{gcj_support}
> BuildRequires:          gcc-java
> Requires(post):         java-1.4.2-gcj-compat
> Requires(postun):       java-1.4.2-gcj-compat
> %endif
>
> %description jdbc
> The postgis-jdbc package provides the essential jdbc driver for PostGIS.
> %endif
>
> %if %utils
> %package utils
> Summary:        The utils for PostGIS
> Group:          Applications/Databases
> Requires:       postgis, perl-DBD-Pg
>
> %description utils
> The postgis-utils package provides the utilities for PostGIS.
> %endif
>
> %define __perl_requires %{SOURCE4}
>
> %prep
> %setup -q
> #%patch1 -p0
> %patch2 -p0
>
> %build
> %configure
> make %{?_smp_mflags} LPATH=`pg_config --pkglibdir` shlib="%{name}.so"
>
> %if %javabuild
> export MAKEFILE_DIR=%{_builddir}/%{name}-%{version}/java/jdbc
> JDBC_VERSION_RPM=`rpm -ql postgresql-jdbc| grep 'jdbc.jar$'|awk -F '/'
> '{print $5}'`
> sed 's/postgresql.jar/'${JDBC_VERSION_RPM}'/g' $MAKEFILE_DIR/Makefile
> > $MAKEFILE_DIR/Makefile.new
> mv -f $MAKEFILE_DIR/Makefile.new $MAKEFILE_DIR/Makefile
> make -C java/jdbc
> %endif
>
> %if %utils
>   make -C utils
> %endif
>
> %install
> rm -rf %{buildroot}
> make install DESTDIR=%{buildroot}
> install -d %{buildroot}%{_libdir}/pgsql/
> install lwgeom/liblwgeom.so* %{buildroot}%{_libdir}/pgsql/
> install -d  %{buildroot}%{_datadir}/pgsql/contrib/
> install -m 644 *.sql %{buildroot}%{_datadir}/pgsql/contrib/
> rm -f  %{buildroot}%{_libdir}/liblwgeom.so*
> rm -f  %{buildroot}%{_datadir}/*.sql
>
> %if %javabuild
> install -d %{buildroot}%{_javadir}
> install -m 755 java/jdbc/%{name}_%{version}.jar %{buildroot}%{_javadir}
> %if %{gcj_support}
> aot-compile-rpm
> %endif
> %endif
>
> strip %{buildroot}/%{_libdir}/gcj/%{name}/*.jar.so
>
> %if %utils
> install -d %{buildroot}%{_datadir}/%{name}
> install -m 644 utils/*.pl %{buildroot}%{_datadir}/%{name}
> %endif
>
> %clean
> rm -rf %{buildroot}
>
> %post -p %{_bindir}/rebuild-gcj-db
>
> %postun -p %{_bindir}/rebuild-gcj-db
>
> %files
> %defattr(-,root,root)
> %doc COPYING CREDITS NEWS TODO README.%{name} TODO doc/html
> loader/README.* doc/%{name}.xml  doc/ZMSgeoms.txt
> %attr(755,root,root) %{_bindir}/*
> %attr(755,root,root) %{_libdir}/pgsql/liblwgeom.so*
> %{_datadir}/pgsql/contrib/*.sql
>
> %if %javabuild
> %files jdbc
> %defattr(-,root,root)
> %doc java/jdbc/COPYING_LGPL java/jdbc/README
> %attr(755,root,root) %{_javadir}/%{name}_%{version}.jar
> %if %{gcj_support}
> %dir %{_libdir}/gcj/%{name}
> %{_libdir}/gcj/%{name}/*.jar.so
> %{_libdir}/gcj/%{name}/*.jar.db
> %endif
> %endif
>
> %if %utils
> %files utils
> %defattr(-,root,root)
> %doc utils/README
> %attr(755,root,root) %{_datadir}/%{name}/test_estimation.pl
> %attr(755,root,root) %{_datadir}/%{name}/profile_intersects.pl
> %attr(755,root,root) %{_datadir}/%{name}/test_joinestimation.pl
> %attr(644,root,root) %{_datadir}/%{name}/create_undef.pl
> %attr(644,root,root) %{_datadir}/%{name}/%{name}_proc_upgrade.pl
> %attr(644,root,root) %{_datadir}/%{name}/%{name}_restore.pl
> %endif
>
> %changelog
> * Mon Dec 26 2006 - Devrim GUNDUZ <devrim at commandprompt.com> 1.2.0-2
> - More spec file fixes per bugzilla review #220743
>
> ----------------------------------------------------- errors log here:
> -----------
>
> + make -C java/jdbc
> ----------
> 1. ERROR in ./src/org/postgis/ComposedGeom.java (at line 29)
>          import org.postgresql.util.PGtokenizer;
>                 ^^^^^^^^^^^^^^^^^^^
> The import org.postgresql.util cannot be resolved
> ----------
> 2. ERROR in ./src/org/postgis/ComposedGeom.java (at line 104)
>          PGtokenizer t = new PGtokenizer(PGtokenizer.removePara(value),
> ',');
>          ^^^^^^^^^^^
> PGtokenizer cannot be resolved to a type
> ----------
> 3. ERROR in ./src/org/postgis/ComposedGeom.java (at line 104)
>          PGtokenizer t = new PGtokenizer(PGtokenizer.removePara(value),
> ',');
>                              ^^^^^^^^^^^
> PGtokenizer cannot be resolved to a type
> ----------
> 4. ERROR in ./src/org/postgis/ComposedGeom.java (at line 104)
>          PGtokenizer t = new PGtokenizer(PGtokenizer.removePara(value),
> ',');
>                                          ^^^^^^^^^^^
> PGtokenizer cannot be resolved
> ----------
> ----------
> 5. ERROR in ./src/org/postgis/DriverWrapper.java (at line 72)
>          public class DriverWrapper extends Driver {
>                                             ^^^^^^
> Driver cannot be resolved to a type
> ----------
> ----------
> 6. ERROR in ./src/org/postgis/DriverWrapperAutoprobe.java (at line 54)
>          public class DriverWrapperAutoprobe extends DriverWrapper {
>                       ^^^^^^^^^^^^^^^^^^^^^^
> The hierarchy of the type DriverWrapperAutoprobe is inconsistent
> ----------
> ----------
> 7. ERROR in ./src/org/postgis/DriverWrapperLW.java (at line 49)
>          public class DriverWrapperLW extends DriverWrapper {
>                       ^^^^^^^^^^^^^^^
> The hierarchy of the type DriverWrapperLW is inconsistent
> ----------
> ----------
> 8. ERROR in ./src/org/postgis/PGbox2d.java (at line 31)
>          public class PGbox2d extends PGboxbase {
>                       ^^^^^^^
> The hierarchy of the type PGbox2d is inconsistent
> ----------
> ----------
> 9. ERROR in ./src/org/postgis/PGbox3d.java (at line 32)
>          public class PGbox3d extends PGboxbase {
>                       ^^^^^^^
> The hierarchy of the type PGbox3d is inconsistent
> ----------
> ----------
> 10. ERROR in ./src/org/postgis/PGboxbase.java (at line 40)
>          public abstract class PGboxbase extends PGobject {
>                                                  ^^^^^^^^
> PGobject cannot be resolved to a type
> ----------
> ----------
> 11. ERROR in ./src/org/postgis/PGgeometry.java (at line 34)
>          public class PGgeometry extends PGobject {
>                                          ^^^^^^^^
> PGobject cannot be resolved to a type
> ----------
> ----------
> 12. ERROR in ./src/org/postgis/PGgeometryLW.java (at line 37)
>          public class PGgeometryLW extends PGgeometry {
>                       ^^^^^^^^^^^^
> The hierarchy of the type PGgeometryLW is inconsistent
> ----------
> ----------
> 13. ERROR in ./src/org/postgis/java2d/Java2DWrapper.java (at line 50)
>          public class Java2DWrapper extends Driver {
>                                             ^^^^^^
> Driver cannot be resolved to a type
> ----------
> ----------
> 14. ERROR in ./src/org/postgis/java2d/PGShapeGeometry.java (at line 63)
>          public class PGShapeGeometry extends PGobject implements Shape {
>                                               ^^^^^^^^
> PGobject cannot be resolved to a type
> ----------
> 14 problems (14 errors)make: *** [compile] Error 255
> error: Bad exit status from /var/tmp/rpm-tmp.18862 (%build)
>
> How I can tackle with this situation ?
>
> Best regards,
> Dido
>
>
>
> ------------------------------
>
> Message: 6
> Date: Fri, 2 Feb 2007 15:27:33 +0100
> From: Stefan Schwarzer <stefan.schwarzer at grid.unep.ch>
> Subject: Re: [postgis-users] pg_restore problem - linked to different
>         versions?
> To: PostGIS Users Discussion <postgis-users at postgis.refractions.net>
> Message-ID: <85D74A20-1E59-4D92-A4D4-57DD74CAF1B1 at grid.unep.ch>
> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed
>
> >> I dumped my locally newly created database and wanted to restore on
> >> the server. But I got this message.
> >>
> >> pg_restore: [archiver] unsupported version (1.10) in file header
> >> pg_restore: [archiver] unsupported version (1.10) in file header
> >> pg_restore call failed
> >>
> >> I guess the problem comes from the fact that:
> >>
> >>    the server runs with     PostGres 8.1.0 and PostGIS 1.1.2
> >>    my local machine with PostGres 8.1.2 and PostGIS 1.1.1
> >>
> >> Could that be? And what can I do to solve the problem? In the moment
> >> we won't touch our server, as it runs smoothly. And on my local
> >> machine, a Mac, the different packages have been installed via the
> >> prebuild packages from KyngChaos. I am no compiler.... So, not too
> >> keen to re-compile Postgres and Postgis.... But I guess it's what I
> >> have to do, right?
> >>
> >> Thanks for any hints...
> >
> >
> > Hi Stefan,
> >
> > Could it be that you have multiple versions of pg_restore on your
> > server? Looking at the PostgreSQL source code, version 1.10 headers
> > were
> > introduced with the advent of tablespaces (PostgreSQL 8.0) and so you
> > are attempting to restore your pg_dump with a pg_restore for
> > PostgreSQL
> > < 8.0.
> >
> > So you need to check your paths and make sure you are using the
> > pg_restore from your PostgreSQL 8.1 installation. Perhaps if you
> > installed PostgreSQL 8.1 yourself, you need to be using the version
> > in /usr/local/bin rather than the version in /usr/bin which originally
> > came with your distro?
>
> Great Mark,
>
> you were absolutely right! There were two or three references to
> pg_restore; only one of them version 8, and not the default one.
>
> Thanks a lot!!!
>
>
>
> ------------------------------
>
> Message: 7
> Date: Fri, 02 Feb 2007 12:03:37 -0500
> From: Stephen Woodbridge <woodbri at swoodbridge.com>
> Subject: Re: [postgis-users] How best to do this?
> To: PostGIS Users Discussion <postgis-users at postgis.refractions.net>
> Message-ID: <45C36EE9.6050403 at swoodbridge.com>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> Paul, et al,
>
> Any chance that someone would have GEOS 3  built for WinXP that I could
> drop into a system currently running:
>
> "POSTGIS="1.1.3" GEOS="2.2.2-CAPI-1.1.0" PROJ="Rel. 4.4.9, 29 Oct 2004"
> USE_STATS"
>
> "PostgreSQL 8.1.4 on i686-pc-mingw32, compiled by GCC gcc.exe (GCC)
> 3.4.2 (mingw-special)"
>
> So I could give this a try.
>
> In the past, I seem to remember people dealing with these problems using
> snaptogrid() - would this potentially help here and how would I change
> my query to use that?
>
> -Steve
>
> Paul Ramsey wrote:
> > GEOS 3 does include a number of fixes that will help difference and
> union.
> >
> > P
> >
> > On 1-Feb-07, at 9:01 PM, Stephen Woodbridge wrote:
> >
> >> OK, one step forward and two steps backward ...
> >>
> >> I was about to get rid of my gemetrycollections with:
> >>
> >> update newtable set the_geom =
> >>  (select geomunion(geom1) from
> >>    (select (dump(the_geom)).geom as geom1) as foo
> >>     where geometrytype(geom1)='POLYGON'
> >>  )
> >>  where geometrytype(the_geom)='GEOMETRYCOLLECTION';
> >>
> >> This worked very nicely once I figured out that this was the way to
> >> solve the problem. So now each geometry collection is converted into a
> >> polygon or multipolygon and all the linestring and point artifacts of
> >> the intersection are removed.
> >>
> >> select distinct geometrytype(the_geom) from soils2;
> >> POLYGON
> >> MULTIPOLYGON
> >>
> >> select * from soils where not isvalid(the_geom);
> >> reports 0 rows
> >>
> >> insert into newtable (..., the_geom)
> >>   select A....,
> >>          difference(A.the_geom, B.the_geom) as the_geom
> >>   from A, B
> >>   where A.the_geom && B.the_geom and overlaps(A.the_geom, B.the_geom);
> >>
> >> NOTICE:  TopologyException: no outgoing dirEdge found
> >> (287030,892621,892621)
> >>
> >> ERROR:  GEOS difference() threw an error!
> >>
> >> Now what do I do??? If I have to upgrade it might be easiest to
> >> upgrade my WinXP laptop if there is an easy way to do that, then dump
> >> and load the data to that.
> >>
> >> select postgis_full_version();
> >> "POSTGIS="1.1.5" GEOS="2.2.3-CAPI-1.1.1" PROJ="Rel. 4.4.9, 29 Oct
> >> 2004" USE_STATS (procs from 1.1.1 need upgrade)"
> >>
> >> select version();
> >> "PostgreSQL 8.0.8 on i386-portbld-freebsd5.3, compiled by GCC cc (GCC)
> >> 3.4.2 [FreeBSD] 20040728"
> >>
> >> -Steve
> >>
> >> Stephen Woodbridge wrote:
> >>> Hi all,
> >>> Sorry the subject line is not more useful, but let me explain.
> >>> 1) I have a set of polgons A and another set of polygon B
> >>> 2) I need to a new set of polygons C that are the union of
> >>>    A intersect B and A difference B
> >>> So basically B partially covers A and I want to split polygons in a
> >>> into the covered piece(s) and that that is not covered.
> >>> On the surface this is very straight forward, but it isn't ...
> >>> insert into newtable (....)
> >>>    select ..., intersection(A.the_geom, B.the_geom) as the_geom
> >>>      from A, B
> >>>      where A.the_geom && B.the_geom and
> >>>        intersects(A.the_geom, B.the_geom);
> >>> This works, but I get a bunch of GEOMETRYCOLLECTION objects in the
> >>> results and out of 1022 collection I have 2780 additional POLYGONs.
> >>> So I could do something like:
> >>> insert into newtable (....)
> >>>     select * from
> >>>       (select ..., (dump(the_geom)).geom as the_geom from newtable
> >>>          where geometrytype(the_geom)='GEOMETRYCOLLECTION' ) as foo
> >>>     where geometrytype(the_geom)='POLYGON';
> >>> delete from newtable where
> geometrytype(the_geom)='GEOMETRYCOLLECTION';
> >>> So now comes the tricky part how do you do the difference? I was
> >>> thinking I could take A difference newtable but because I have
> >>> multiple little pieces instead of a single piece, I think I am
> getting:
> >>>   (A - Part1), (A - Part2), (A - Part3) instead of
> >>>   (A - Part1 - Part2 - Part3)
> >>> So I think I need to union the polygon pieces from each row that is
> >>> dumped above. Is that as simple as tossing part of the dump into a
> >>> geomunion()? How would that look?
> >>> -Steve W
> >>> _______________________________________________
> >>> postgis-users mailing list
> >>> postgis-users at postgis.refractions.net
> >>> http://postgis.refractions.net/mailman/listinfo/postgis-users
> >>
> >> _______________________________________________
> >> postgis-users mailing list
> >> postgis-users at postgis.refractions.net
> >> http://postgis.refractions.net/mailman/listinfo/postgis-users
> >
> > _______________________________________________
> > postgis-users mailing list
> > postgis-users at postgis.refractions.net
> > http://postgis.refractions.net/mailman/listinfo/postgis-users
>
>
>
> ------------------------------
>
> Message: 8
> Date: Fri, 02 Feb 2007 09:25:43 -0800
> From: Paul Ramsey <pramsey at refractions.net>
> Subject: Re: [postgis-users] How best to do this?
> To: PostGIS Users Discussion <postgis-users at postgis.refractions.net>
> Message-ID: <45C37417.4070607 at refractions.net>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> snaptogrid might help, it is a crude hammer similar in many ways to the
> more subtle approaches in GEOS3.
>
> Because the C API didn't change between versions, you may be able to
> simply copy a suitably compiled geos DLL into place, perhaps by
> stripping one out of the windows downloads. I don't actually know if our
> windows downloads are using GEOS3 though... hrm. Mark CA?
>
> P
>
> Stephen Woodbridge wrote:
> > Paul, et al,
> >
> > Any chance that someone would have GEOS 3  built for WinXP that I could
> > drop into a system currently running:
> >
> > "POSTGIS="1.1.3" GEOS="2.2.2-CAPI-1.1.0" PROJ="Rel. 4.4.9, 29 Oct 2004"
> > USE_STATS"
> >
> > "PostgreSQL 8.1.4 on i686-pc-mingw32, compiled by GCC gcc.exe (GCC)
> > 3.4.2 (mingw-special)"
> >
> > So I could give this a try.
> >
> > In the past, I seem to remember people dealing with these problems using
> > snaptogrid() - would this potentially help here and how would I change
> > my query to use that?
> >
> > -Steve
> >
> > Paul Ramsey wrote:
> >> GEOS 3 does include a number of fixes that will help difference and
> >> union.
> >>
> >> P
> >>
> >> On 1-Feb-07, at 9:01 PM, Stephen Woodbridge wrote:
> >>
> >>> OK, one step forward and two steps backward ...
> >>>
> >>> I was about to get rid of my gemetrycollections with:
> >>>
> >>> update newtable set the_geom =
> >>>  (select geomunion(geom1) from
> >>>    (select (dump(the_geom)).geom as geom1) as foo
> >>>     where geometrytype(geom1)='POLYGON'
> >>>  )
> >>>  where geometrytype(the_geom)='GEOMETRYCOLLECTION';
> >>>
> >>> This worked very nicely once I figured out that this was the way to
> >>> solve the problem. So now each geometry collection is converted into
> >>> a polygon or multipolygon and all the linestring and point artifacts
> >>> of the intersection are removed.
> >>>
> >>> select distinct geometrytype(the_geom) from soils2;
> >>> POLYGON
> >>> MULTIPOLYGON
> >>>
> >>> select * from soils where not isvalid(the_geom);
> >>> reports 0 rows
> >>>
> >>> insert into newtable (..., the_geom)
> >>>   select A....,
> >>>          difference(A.the_geom, B.the_geom) as the_geom
> >>>   from A, B
> >>>   where A.the_geom && B.the_geom and overlaps(A.the_geom, B.the_geom);
> >>>
> >>> NOTICE:  TopologyException: no outgoing dirEdge found
> >>> (287030,892621,892621)
> >>>
> >>> ERROR:  GEOS difference() threw an error!
> >>>
> >>> Now what do I do??? If I have to upgrade it might be easiest to
> >>> upgrade my WinXP laptop if there is an easy way to do that, then dump
> >>> and load the data to that.
> >>>
> >>> select postgis_full_version();
> >>> "POSTGIS="1.1.5" GEOS="2.2.3-CAPI-1.1.1" PROJ="Rel. 4.4.9, 29 Oct
> >>> 2004" USE_STATS (procs from 1.1.1 need upgrade)"
> >>>
> >>> select version();
> >>> "PostgreSQL 8.0.8 on i386-portbld-freebsd5.3, compiled by GCC cc
> >>> (GCC) 3.4.2 [FreeBSD] 20040728"
> >>>
> >>> -Steve
> >>>
> >>> Stephen Woodbridge wrote:
> >>>> Hi all,
> >>>> Sorry the subject line is not more useful, but let me explain.
> >>>> 1) I have a set of polgons A and another set of polygon B
> >>>> 2) I need to a new set of polygons C that are the union of
> >>>>    A intersect B and A difference B
> >>>> So basically B partially covers A and I want to split polygons in a
> >>>> into the covered piece(s) and that that is not covered.
> >>>> On the surface this is very straight forward, but it isn't ...
> >>>> insert into newtable (....)
> >>>>    select ..., intersection(A.the_geom, B.the_geom) as the_geom
> >>>>      from A, B
> >>>>      where A.the_geom && B.the_geom and
> >>>>        intersects(A.the_geom, B.the_geom);
> >>>> This works, but I get a bunch of GEOMETRYCOLLECTION objects in the
> >>>> results and out of 1022 collection I have 2780 additional POLYGONs.
> >>>> So I could do something like:
> >>>> insert into newtable (....)
> >>>>     select * from
> >>>>       (select ..., (dump(the_geom)).geom as the_geom from newtable
> >>>>          where geometrytype(the_geom)='GEOMETRYCOLLECTION' ) as foo
> >>>>     where geometrytype(the_geom)='POLYGON';
> >>>> delete from newtable where
> geometrytype(the_geom)='GEOMETRYCOLLECTION';
> >>>> So now comes the tricky part how do you do the difference? I was
> >>>> thinking I could take A difference newtable but because I have
> >>>> multiple little pieces instead of a single piece, I think I am
> getting:
> >>>>   (A - Part1), (A - Part2), (A - Part3) instead of
> >>>>   (A - Part1 - Part2 - Part3)
> >>>> So I think I need to union the polygon pieces from each row that is
> >>>> dumped above. Is that as simple as tossing part of the dump into a
> >>>> geomunion()? How would that look?
> >>>> -Steve W
> >>>> _______________________________________________
> >>>> postgis-users mailing list
> >>>> postgis-users at postgis.refractions.net
> >>>> http://postgis.refractions.net/mailman/listinfo/postgis-users
> >>>
> >>> _______________________________________________
> >>> postgis-users mailing list
> >>> postgis-users at postgis.refractions.net
> >>> http://postgis.refractions.net/mailman/listinfo/postgis-users
> >>
> >> _______________________________________________
> >> postgis-users mailing list
> >> postgis-users at postgis.refractions.net
> >> http://postgis.refractions.net/mailman/listinfo/postgis-users
> >
> > _______________________________________________
> > postgis-users mailing list
> > postgis-users at postgis.refractions.net
> > http://postgis.refractions.net/mailman/listinfo/postgis-users
>
>
> --
>
>    Paul Ramsey
>    Refractions Research
>    http://www.refractions.net
>    pramsey at refractions.net
>    Phone: 250-383-3022
>    Cell: 250-885-0632
>
>
> ------------------------------
>
> Message: 9
> Date: Fri, 2 Feb 2007 10:40:36 -0800 (PST)
> From: Steve Benzo <steve_benzo at yahoo.com>
> Subject: [postgis-users] Lat/lon bounding box to area?
> To: postgis-users at postgis.refractions.net
> Message-ID: <404830.54155.qm at web56205.mail.re3.yahoo.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Hi,
>
> This might be a stupid question, but is there a way using PostGIS that I
> can take a bounding box (polyline) supplied by a user (they're drawing a box
> on the map, from which I get the xmin/ymin/etc from), which I'd like to use
> to get an area from (utlimately acres). My first step will be to get that
> polyline into PostGIS (struggling, but should be able to figure it out) and
> then apply a trigger which populates an area field from that. Thanks in
> advance.
>
> SB
>
>
> ---------------------------------
> Check out the all-new Yahoo! Mail beta - Fire up a more powerful email and
> get things done faster.
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> http://lists.refractions.net/pipermail/postgis-users/attachments/20070202/13939878/attachment-0001.html
>
> ------------------------------
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
>
> End of postgis-users Digest, Vol 52, Issue 2
> ********************************************
>



-- 
Regards,

Mark Thomas
spatialguru.net at gmail.com
205.529.9013

"Commit to the Lord whatever you do,
    and your plans will succeed." - Proverbs 16:3
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20070202/426bc9a4/attachment.html>


More information about the postgis-users mailing list