Re: [postgis-users] ST_Distance issue

2011-11-19 Thread Mike Toews
On 18 November 2011 16:46, Archana Sachin Ghag  wrote:
> My regions are stored with SRID = 900913.

Your geometries look like EPSG:4326, which uses long/lat in degrees.

> Distance for point in Europe from USA region is coming as 122.78.
> How come this possible. These regions are so far.

The units for this calculation are the same as your input units, so degrees.

> Here is my query. Can you please suggest me how can I get actual distance in 
> meters here.

Read all about the geography data type, and if it is good for your
data (or not):
http://postgis.refractions.net/docs/ch04.html#PostGIS_Geography

SELECT ST_Distance('POINT(-123.574219125 47.8131546948944)'::geography,
'LINESTRING(-0.791015625 48.4874864798841,9.4921875
54.5975278521139,27.59765625 55.3541353102106,36.38671875
48.3124279040718,22.32421875 40.3465441211801,5.888671875
43.8662180065564,-0.791015625 48.4874864798841)'::geography);

Results in 7832865.04517846 metres

> Which SRID should we use for general purpose.

There isn't really one, but if you have global data then WGS 84
(EPSG:4326) is a good choice.

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


Re: [postgis-users] Problems installing PostGIS 2.0SVN on PostgreSQL 9.1

2011-11-19 Thread Mike Toews
On 18 November 2011 17:11,  wrote:
> cd postgis-2.0.0SVN
> ./configure --with-pgconfig=/usr/local/pgsql/bin/pg_config
> make
> make install
It's a good idea to also run a [sudo] ldconfig command here
> createdb db
> createlang plpgsql db
>
> When loading postgis.sql definitions with...
>
> psql -d db -h localhost -p 5432 -U postgres -f 
> /usr/local/pgsql/share/contrib/postgis-2.0/postgis.sql

There should only be one error, and you can stop psql on that with by
adding -v ON_ERROR_STOP=1 to your command

> ERROR:  could not load library "/usr/local/pgsql/lib/postgis-2.0.so": 
> /usr/local/pgsql/lib/postgis-2.0.so: undefined symbol: GEOSRelatePatternMatch
> STATEMENT:  CREATE OR REPLACE FUNCTION spheroid_in(cstring)
> RETURNS spheroid
> AS '$libdir/postgis-2.0','ellipsoid_in'
> LANGUAGE 'C' IMMUTABLE STRICT;

This looks like your error. What version of GEOS do you have? For
PostGIS 2.0 you need GEOS 3.2.2 or higher.

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