Re: [postgis-users] k-nearest Polygons

2012-10-27 Thread Skye Book
http://postgis.refractions.net/docs/geometry_distance_box.html
http://postgis.refractions.net/docs/geometry_distance_centroid.html

Both operators are insanely handy and very simple to use :)

Skye Book
http://skyebook.net -- @sbook <https://twitter.com/sbook>

On Oct 27, 2012, at 8:34 AM, Ed Linde  wrote:

Could you please link me to the postgis 2.0 section in the docs that talks
about
using <#> and <-> ? Those operators look quite handy to me :)

On Sat, Oct 27, 2012 at 3:32 PM, Sandro Santilli  wrote:

> On Sat, Oct 27, 2012 at 03:27:13PM +0200, Ed Linde wrote:
> > Thanks. Just to clear things up, :point_or_poly bind variable needs a
> > "geometry"
> > type passed in to it, right?
>
> Yes
>
> --strk;
>
> >
> > Thanks,
> > Ed
> >
> > On Sat, Oct 27, 2012 at 1:57 PM, Sandro Santilli 
> wrote:
> >
> > > On Sat, Oct 27, 2012 at 01:37:05PM +0200, Ed Linde wrote:
> > >
> > > > Is there a way to know for a user defined "k" what the k-nearest
> polygons
> > > > to a given polygon or point are in postgis?
> > >
> > > -- Simple answer:
> > > SELECT gid from polygons
> > >  ORDER BY ST_Distance(the_geom, :point_or_poly)
> > >  LIMIT :k;
> > >
> > > More complex: if you have PostGIS-2.0 and need
> > > more speed the following versions do use a spatial
> > > index, if defined on "polygons":
> > >
> > > -- k nearest to bounding box of polygons:
> > > SELECT gid FROM polygons
> > >  ORDER BY the_geom <#> :point_or_poly
> > >  LIMIT :k;
> > >
> > > -- k nearest to polygon center:
> > > SELECT gid FROM polygons
> > >  ORDER BY the_geom <-> :point_or_poly
> > >  LIMIT :k;
> > >
> > > -- k nearest to polygon shape:
> > > -- NOTE: assumes the k closest objects
> > > --   are among the k*10 objects
> > > --   closer to boundingbox
> > > --
> > > WITH k_times_10_closer AS (
> > >   SELECT gid, the_geom FROM polygons
> > >ORDER BY the_geom <#> :point_or_poly
> > >LIMIT :k*10
> > > )
> > > SELECT gid from k_times_10_closer
> > >  ORDER BY ST_Distance(the_geom, :point_or_poly)
> > >  LIMIT :k;
> > >
> > > --strk;
> > >
> > >  http://www.cartodb.com - Map, analyze and build applications with
> your
> > > data
> > >
> > >~~ http://strk.keybit.net
> > >
> > > ___
> > > postgis-users mailing list
> > > postgis-users@postgis.refractions.net
> > > http://postgis.refractions.net/mailman/listinfo/postgis-users
> > >
>
> > ___
> > postgis-users mailing list
> > postgis-users@postgis.refractions.net
> > http://postgis.refractions.net/mailman/listinfo/postgis-users
>
>
> --
>
>  http://www.cartodb.com - Map, analyze and build applications with your
> data
>
>~~ http://strk.keybit.net
>
> ___
> postgis-users mailing list
> postgis-users@postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>

___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] PostGIS 2.0 connection to Java

2012-04-30 Thread Skye Book
I've been building the driver from SVN, it's worked out fine for me.
On Apr 30, 2012 11:10 AM, "Brian Sanjeewa Rupasinghe" 
wrote:

> Hi,
>
> Where can i find postgis 2.0.jar file to connect postGIS with Java. Link
> in the PostGIS site is broken.
>
> Brian.
>
> ___
> postgis-users mailing list
> postgis-users@postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
>
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] PostGIS 2.0.0 Released

2012-04-03 Thread Skye Book
Congrats, it's been well worth the wait indeed :)
On Apr 3, 2012 5:08 PM, "Javier de la Torre"  wrote:

> Congrats to everybody,
>
> Today is a beautiful day.
>
> Sent from my iPad
>
> On Apr 3, 2012, at 5:04 PM, Paul Ramsey  wrote:
>
> > The PostGIS development team is super excited,
> > can hardly believe that they are actually doing this,
> > aren't maybe even sure that they are ready to make
> > this kind of commitment, not so young, and not when
> > we have so much more living to do, but:
> >
> > PostGIS 2.0.0 is complete and available for download.
> >
> >  http://postgis.org/download/postgis-2.0.0.tar.gz
> >
> > The development process for 2.0 has been very long,
> > but has resulted in a release with a number of exciting
> > new features.
> >
> > * Raster data and raster/vector analysis in the database
> > * Topological models to handle objects with shared boundaries
> > * PostgreSQL typmod integration, for an automagical
> >   geometry_columns table
> > * 3D and 4D indexing
> > * Index-based high performance nearest-neighbour searching
> > * Many more vector functions including
> >   * ST_Split
> >   * ST_Node
> >   * ST_MakeValid
> >   * ST_OffsetCurve
> >   * ST_ConcaveHull
> >   * ST_AsX3D
> >   * ST_GeomFromGeoJSON
> >   * ST_3DDistance
> > * Integration with the PostgreSQL 9.1 extension system
> > * Improved commandline shapefile loader/dumper
> > * Multi-file import support in the shapefile GUI
> > * Multi-table export support in the shapefile GUI
> > * A geo-coder optimized for free US Census
> >   TIGER (2010) data
> >
> > We are greatly indebted to our large community of beta testers
> > who valiantly tested PostGIS 2.0.0 and reported bugs so we could
> > squash them before release time.
> >
> > And also we want to thank our parents for making PostGIS possible.
> >
> > Yours,
> >
> > The PostGIS development team
> > ___
> > postgis-users mailing list
> > postgis-users@postgis.refractions.net
> > http://postgis.refractions.net/mailman/listinfo/postgis-users
> ___
> postgis-users mailing list
> postgis-users@postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] Are there any Ubuntu PPAs that serve PostGIS 2.0 beta releases?

2012-03-15 Thread Skye Book
Looks awesome, Charlie.  I'll definitely be giving this a shot today :)

-Skye

On Mar 15, 2012, at 1:40 PM, Charlie Sharpsteen wrote:

> On Wednesday, March 14, 2012 8:18:35 AM UTC-7, Charlie Sharpsteen wrote:
> On Wednesday, March 14, 2012 12:02:24 AM UTC-7, Sandro Santilli wrote:
> On Tue, Mar 13, 2012 at 07:50:32PM -0700, Charlie Sharpsteen wrote:
> > I was wondering if anyone has a Personal Package Archive for Ubuntu that is 
> > tracking the 2.0 beta releases. I looked at the UbuntuGIS and Postgis 
> > project pages on Launchpad, but the only releases listed there were for 
> > 1.5.x. Even the unstable repostory of UbuntuGIS was still tracking 1.5.x.
> 
> I'm not aware of any. It'd be very welcome if you want to setup one.
> 
> --strk;
> 
> 
> Allright, I'll take a shot at it. Looks like there is a Launchpad repository 
> that is synching with PostGIS SVN every 6 hours or so---perhaps I can get a 
> nightly build set up.
> 
> -Charlie
> 
> 
> Ok, I now have a nightly build set up that is tracking the PostGIS trunk. 
> Binaries are being built for Oneric (11.11) and Precise (12.04-dev) and can 
> be installed thusly:
> 
> sudo apt-add-repository ppa:sharpie/postgis-nightly
> sudo apt-get update
> sudo apt-get install postgresql-9.1-postgis
> 
> 
> Caveats:
> No build of `postgis` or `libpostgis-java`, the only package provided is 
> `postgresql-9.1-postgis` which contains the PostGIS plugins, extensions and 
> command line tools.
> Builds against GEOS 3.2.2, supplied by the standard Ubuntu repositories, thus 
> the topology extension is unavailable.
> Builds against GDAL 1.7.0, supplied by the standard Ubuntu repositories, thus 
> some raster functionalities are unavailable.
> 
> The raw materials that went into creating this build were the PostGIS 
> repository on Launchpad which synchs with the upstream SVN trunk ~every 6 
> hours:
> 
>   https://code.launchpad.net/~registry/postgis/trunk
> 
> This repostory can be cloned using bazaar via `bzr branch lp:postgis`. The 
> other component is the official Ubuntu PostGIS repository that contains the 
> debian packaging materials:
> 
>   https://code.launchpad.net/~ubuntu-branches/ubuntu/precise/postgis/precise
> 
> This repository can be cloned using `bzr branch lp:ubuntu/postgis`. My 
> strategy was to fork `lp:ubuntu/postgis`, edit the contents of the debian 
> subdirectory to make it compatible with 2.0-dev and then publish the edited 
> fork to Launchpad under my `+junk` section. After this was done, I set up a 
> `bzr-builder` recipe that fuses `lp:postigs`, which tracks the upstream 
> PostGIS repo, with the debian subdirectory contained in 
> `lp:~sharpie/+junk/postgis`, which contains my edited packaging info, to 
> create a nightly build:
> 
> # bzr-builder format 0.3 deb-version 
> {debupstream}~r{revno}~ppa{revno:packaging}
> lp:postgis
> nest-part packaging lp:~sharpie/+junk/postgis debian debian
> 
> Pretty slick. I will ponder upgrading GEOS and GDAL and setting up a stable 
> build for the most recent beta releases.
> 
> 
> -Charlie
> ___
> postgis-users mailing list
> postgis-users@postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users


Skye Book
(516) 816-4762

___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] Are there any Ubuntu PPAs that serve PostGIS 2.0 beta releases?

2012-03-14 Thread Skye Book
Yeah, this is what was fixed in r9499 by using the autoconf lib search or 
whatever the command is..

It indeed builds, but the regression tests fail..

-Skye

On Mar 14, 2012, at 4:11 PM, Charlie Sharpsteen wrote:

> On Wednesday, March 14, 2012 1:00:37 PM UTC-7, Charlie Sharpsteen wrote:
>   - 2.0.0beta2 can compile against the dependencies supplied for PostGIS 
> 1.5.x via `apt-get build-dep postgis` with the addition of GDAL 1.7.0 via 
> `apt-get install libgdal1-dev`. However, 2.0.0beta3, released today, and the 
> current SVN head fail during configure:
> 
> 
> RASTER: Raster support requested
> checking for GDAL >= 1.6.0... found
> checking gdal.h usability... yes
> checking gdal.h presence... yes
> checking for gdal.h... yes
> checking ogr_api.h usability... yes
> checking ogr_api.h presence... yes
> checking for ogr_api.h... yes
> checking cpl_conv.h usability... yes
> checking cpl_conv.h presence... yes
> checking for cpl_conv.h... yes
> checking for GDALAllRegister in -lgdal... no
> configure: error: could not find gdal
> 
> 
> This is odd, because running nm against the libraries shows that the symbol 
> is there:
> 
> vagrant@vagrant-64:~/postgis-2.0.0beta3$ nm --dynamic 
> /usr/lib/libgdal1.7.0.so | grep GDALAllRegister
> 0021a820 T GDALAllRegister
> 
> 
> Don't know if this is a bug in the latest beta, or a problem with Ubuntu's 
> GDAL 1.7.0 libraries. Any advice would be appreciated.
> 
> 
> -Charlie
> 
> Found the problem in config.log:
> 
> 
> configure:19617: gcc -o conftest  -I/usr/include/gdal  conftest.c -lgdal  
> -L/usr/lib -lgdal1.7.0 >&5
> /usr/bin/ld: cannot find -lgdal
> 
> 
> The configure script is trying to link against both libgdal and libgdal1.7.0, 
> but libgdal.so does not exist, only libgdal1.7.0.so. According to config.log, 
> this has been identified and stored in LIBGDAL_LDFLAGS:
> 
> 
> LIBGDAL_LDFLAGS='-L/usr/lib -lgdal1.7.0'
> 
> 
> But the test scripts are still trying to pass `-lgdal`. Looks like a bug in 
> the PostGIS configure script.
> 
> 
> -Charlie
> ___
> postgis-users mailing list
> postgis-users@postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users


Skye Book
(516) 816-4762

___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] Are there any Ubuntu PPAs that serve PostGIS 2.0 beta releases?

2012-03-14 Thread Skye Book
As of some time during the alpha releases, it started wanting Geos 3.3..  Not 
sure what functionality is touching the dependency thiough

-Skye

On Mar 14, 2012, at 11:29 AM, Charlie Sharpsteen wrote:

> On Wednesday, March 14, 2012 8:21:48 AM UTC-7, Denis Rouzaud wrote:
> That would be amazing.
> But, there is no ppa for geos 3.3 either and I am not sure about gdal 1.9...
> It might be a little early to have a ppa repo and dependencies with 
> unavailable packages
> 
> My 2 cents.
>  
> Pretty sure I built PostGIS from source against GDAL 1.7 and GEOS 3.2.2 from 
> the Oneiric standard repository.
> 
> Are there any critical functions that are inactive without the latest and 
> greatest versions of these libraries?
> 
> -Charlie 
> ___
> postgis-users mailing list
> postgis-users@postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users


___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users