[postgis-users] unit

David Bitner osgis.lists at gmail.com
Mon Jan 23 14:15:35 PST 2006


Select * from spatial_ref_sys where srid=[your srid]

Incidently, I forgot about the srid(geometry) function to get the srid
of a geometry.  Put them together:

select * from spatial_ref_sys where srid=(select srid([geometry]) from
[table] limit 1)

On 1/23/06, Gilbert, Antoine <AGilbert at korem.com> wrote:
> I know the SRID
>
> I was figuring given the SRID I could know the unit. I don't know what
> reference system is used at each time. I only have a bunch of queries
> with srid associated
>
> -----Original Message-----
> From: David Bitner [mailto:osgis.lists at gmail.com]
> Sent: January 23, 2006 4:46 PM
> To: PostGIS Users Discussion
> Subject: Re: [postgis-users] unit
>
> If you don't know the projection units, then you don't know anything
> about how to reference them at all!
>
> If you are just using PostGIS tables set up by someone else, in
> PostGIS, you can look at a a geometry using astext(geom) this will
> give you the srid for the given projection.  You can then look up that
> srid to see what projection is and what the units are.  If the
> SRID=-1, then you know nothing about the projection and any distance
> that you are measuring is pretty much meaningless.
>
> On 1/23/06, Gilbert, Antoine <AGilbert at korem.com> wrote:
> > I wonder if there is a better way to achieve this, suppose you don't
> > know the projection of a given geometry
> >
> > -----Original Message-----
> > From: David Bitner [mailto:osgis.lists at gmail.com]
> > Sent: January 23, 2006 3:53 PM
> > To: PostGIS Users Discussion
> > Subject: Re: [postgis-users] unit
> >
> > The units that are returned are the units that the projection your
> > data is in.  For example, if your data is in meters then the distance
> > returned will be in meters to get your distance in kilometers, you
> > could use this query Distance(geometry,geometry)/1000.
> >
> >
> > On 1/23/06, Gilbert, Antoine <AGilbert at korem.com> wrote:
> > >
> > >
> > >
> > > Hi
> > >
> > >
> > >
> > > When you are using functions like Distance(geometry, geometry),
> > withinh SQL
> > > queries, does it exists an easy way to tell the system I want
> > kilometer
> > > units ?
> > >
> > >
> > >
> > > Antoine
> > > _______________________________________________
> > > 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
>
> _______________________________________________
> 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