[postgis-users] 2 Simple Questions

Dylan Lorimer edylan at google.com
Thu Oct 5 15:36:10 PDT 2006


Hi,

Many thanks. That pretty much worked for getting that 3rd coordinate.
Any idea if it is possible to get the results as a comma delimited
values rather than the EWKT?

As for 'better', I thought I could pull this off using a join but
couldn't figure it out. Is that possible?
cheers,
dylan

On 10/5/06, Markus Schaber <schabi at logix-tt.com> wrote:
> Hi, Dylan,
>
> Dylan Lorimer wrote:
>
> > 1) Given a 2 dimensional point geometry, is there a way to get the
> > AsText version of it but with a 0 inserted for the z value? To expound
> > slightly, I've created a geom column to store city coordinates. I'd
> > like to run typical spatial queries against the cities, but get in
> > some cases get a 0 back for the non-existent z value. I thought
> > 'force_3d' might do this; but it doesn't seem to.
>
> Try "asEWKT(force_3d(the_geom))".
>
> AsText currently cuts down to 2 dimensions due to the OpenGIS standard
> being 2D.
>
> > 2) There's a better way to find all cities within some distance from a
> > given city in my table that the following sub-select, right? It seems
> > a bit clunky.
> >
> > SELECT city_name FROM gnis WHERE distance_sphere(the_geom, (SELECT
> > the_geom FROM gnis WHERE city_name='San Francisco' AND
> > country_code='US' AND sub_national_code='CA')) < 18046.7;
>
> What do you mean with "better"?
>
> Markus
> --
> Markus Schaber | Logical Tracking&Tracing International AG
> Dipl. Inf.     | Software Development GIS
>
> Fight against software patents in Europe! www.ffii.org
> www.nosoftwarepatents.org
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>


-- 
E. Dylan Lorimer | Google Earth Enterprise
650.253.2459 (O) | 650.862.6810 (M) | 650.644.0182 (F)



More information about the postgis-users mailing list