[postgis-users] Antwort: Re: Projection(s) for global point-and-radius searches

Paul Ramsey pramsey at opengeo.org
Thu Jul 8 06:25:13 PDT 2010


There is no spoon.

Why do you need ST_Expand()? If you're doing a distance query,
ST_DWIthin(thisgeog, thatgeog, radiusdouble) will create a fully
indexed query for you and return the right answers. You can look at
its definition under the covers to see what it's up to.

http://trac.osgeo.org/postgis/browser/trunk/postgis/geography.sql.in.c#L612

If you're working with geometry in 4326, well then, you're in a tough
spot, yes? That's why geography was invented. There's some hacks
available for you here:

http://trac.osgeo.org/postgis/wiki/UsersWikiExamplesFindNearbyLatLon

P.

On Wed, Jul 7, 2010 at 11:51 PM, Stefan Priess <Stefan.Priess at iav.de> wrote:
>
> Hey Paul,
>
> i need the ST_Expand() function with a radius/expand of 10 Meters, how i will do that?
> The Point to expand is in SRID 4326 .
>
> Thanks
>
> Stefan
>
>
>
> Paul Ramsey <pramsey at opengeo.org>
> Gesendet von: postgis-users-bounces at postgis.refractions.net
>
> 07.07.2010 23:13
>
> Bitte antworten an
> PostGIS Users Discussion <postgis-users at postgis.refractions.net>
> An
> PostGIS Users Discussion <postgis-users at postgis.refractions.net>
> Kopie
> Thema
> Re: [postgis-users] Projection(s) for global point-and-radius        searches
>
>
>
>
> No, because the functions on Geometry(4326) don't return metric answers.
>
> SELECT
>  ST_Distance('SRID=4326;POINT(0 0)'::geometry, 'SRID=4326;POINT(1
> 1)'::geometry) as geom,
>  ST_Distance('POINT(0 0)'::geography, 'POINT(1 1)'::geography) as geog;
>
> Geography understands that it's on a sphere and does the Right Thing.
> Geometry(4326) still operates on a cartesian plane, it just has
> "units" of degrees (which is pretty nonsensical for any kind of
> measurement calculation).
>
> P
>
> On Wed, Jul 7, 2010 at 2:03 PM, David Jantzen <djantzen at ql2.com> wrote:
> > Ok, interesting.  Is it equivalent then to using a GEOMETRY type with SRID 4326?
> >
> > On Jul 7, 2010, at 12:25 PM, Paul Ramsey wrote:
> >
> >> On Wed, Jul 7, 2010 at 12:25 PM, Paul Ramsey <pramsey at opengeo.org> wrote:
> >>> ST_Buffer(geography, float8) returns geography
> >>> ST_Intersection(geography, geography) returns geography
> >>
> >> These last two actually *do* carry out projections under the covers,
> >> so watch out.
> >>
> >> P
> >> _______________________________________________
> >> 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
>



More information about the postgis-users mailing list