Re: [postgis-users] Can GEOGRAPHY object cross the date-line

2010-02-24 Thread Paul Ramsey
OK, this looks like a bug...

The area of 1 versus the area of 359 is expected, since the geometry
object does not handle the dateline. However, the geography area
should be identical in both cases. So, I have a bit of work to do.

More information as I find it.

P.

On Wed, Feb 24, 2010 at 10:38 AM, Dale Noss  wrote:
>
> I'm confused about whether the new Geography type correctly handles shapes
> that cross the date-line. The documentation in
> http://postgis.refractions.net/documentation/manual-1.5/ch04.html#id2802139
> reads:
>
> "What about the date-line and the poles?
>
> All the calculations have no conception of date-line or poles, the
> coordinates are spherical (longitude/latitude) so a shape that crosses the
> dateline is, from a calculation point of view, no different from any other
> shape."
>
> Section 4.2.3.3.        reads:
>
> "What is the longest arc you can process?
>
> We use great circle arcs as the "interpolation line" between two points.
> That means any two points are actually joined up two ways, depending on
> which direction you travel along the great circle. All our code assumes that
> the points are joined by the *shorter* of the two paths along the great
> circle. As a consequence, shapes that have arcs of more than 180 degrees
> will not be correctly modelled."
>
> The st_distance() function returns a sensible result for points that lie on
> either side of the
> date-line.
>
> g4wd=# select st_distance('POINT(179.5 1)'::geography, 'POINT(-179.5
> 1)'::geography)/1000;
>     ?column?
> --
>  111.302645148245
> (1 row)
>
> The st_area() function also returns a sensible result for a square degree
> near the equator.
>
> g4wd=# select st_area(g)/100, st_area(transform(geometry(g), 4326)),
> astext(geometry(g)) from (select 'POLYGON((178.5 2, 178.5 1, 179.5 1, 179.5
> 2, 178.5 2))'::geography) as foo(g);
>    ?column?     | st_area |                       astext
> -+-+
>  12304.814950073 |       1 | POLYGON((178.5 2,178.5 1,179.5 1,179.5 2,178.5
> 2))
> (1 row)
>
> If the GEOGRAPHY object crosses the date-line, I see results similar to what
> I'd get using a POLYGON. In other words, the calculations cannot be choosing
> the shorter of the two possible paths along a great circle. (See query
> results below) 359 implies choosing the longer path, and I have no idea why
> the area in square kilometers is roughly 4.5x instead of 359x larger than
> the non-dateline case above.
>
> g4wd=# select st_area(g)/100, st_area(transform(geometry(g), 4326)),
> astext(geometry(g)) from (select 'POLYGON((179.5 2, 179.5 1, -179.5 1,
> -179.5 2, 179.5 2))'::geography) as foo(g);
>     ?column?     | st_area |                        astext
> --+-+--
>  55910.8880691158 |     359 | POLYGON((179.5 2,179.5 1,-179.5 1,-179.5
> 2,179.5 2))
> (1 row)
>
> /
> My setup:
> g4wd=# select postgis_full_version();
> postgis_full_version
> ---
>  POSTGIS="2.0.0SVN" GEOS="3.2.0-CAPI-1.6.0" PROJ="Rel. 4.7.1, 23 September
> 2009" LIBXML="2.6.16" USE_STATS
> (1 row)
>
> g4wd=# select version();
>                                                                  version
> 
>  PostgreSQL 8.4.2 on powerpc-apple-darwin9.8.0, compiled by GCC
> powerpc-apple-darwin9-gcc-4.0.1 (GCC) 4.0.1 (Apple Inc. build 5490), 32-bit
> (1 row)
>
> Running OS X 10.5.8
>
> Work arounds, clarifications, links to solutions will be much appreciated.
>
> --
> View this message in context: 
> http://old.nabble.com/Can-GEOGRAPHY-object-cross-the-date-line-tp27714275p27714275.html
> Sent from the PostGIS - User mailing list archive at Nabble.com.
>
> ___
> 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] Can GEOGRAPHY object cross the date-line

2010-02-24 Thread Paul Ramsey
Dale, I'll have a closer read of your mail and get back to you later
today. My first geography issue, how exciting!
P

On Wed, Feb 24, 2010 at 10:38 AM, Dale Noss  wrote:
>
> I'm confused about whether the new Geography type correctly handles shapes
> that cross the date-line.
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


[postgis-users] Can GEOGRAPHY object cross the date-line

2010-02-24 Thread Dale Noss

I'm confused about whether the new Geography type correctly handles shapes 
that cross the date-line. The documentation in
http://postgis.refractions.net/documentation/manual-1.5/ch04.html#id2802139
reads: 

"What about the date-line and the poles? 

All the calculations have no conception of date-line or poles, the
coordinates are spherical (longitude/latitude) so a shape that crosses the
dateline is, from a calculation point of view, no different from any other
shape." 

Section 4.2.3.3.reads:

"What is the longest arc you can process? 

We use great circle arcs as the "interpolation line" between two points.
That means any two points are actually joined up two ways, depending on
which direction you travel along the great circle. All our code assumes that
the points are joined by the *shorter* of the two paths along the great
circle. As a consequence, shapes that have arcs of more than 180 degrees
will not be correctly modelled." 

The st_distance() function returns a sensible result for points that lie on
either side of the 
date-line. 

g4wd=# select st_distance('POINT(179.5 1)'::geography, 'POINT(-179.5
1)'::geography)/1000; 
 ?column? 
-- 
 111.302645148245 
(1 row)

The st_area() function also returns a sensible result for a square degree
near the equator. 

g4wd=# select st_area(g)/100, st_area(transform(geometry(g), 4326)),
astext(geometry(g)) from (select 'POLYGON((178.5 2, 178.5 1, 179.5 1, 179.5
2, 178.5 2))'::geography) as foo(g); 
?column? | st_area |   astext   
-+-+
 
 12304.814950073 |   1 | POLYGON((178.5 2,178.5 1,179.5 1,179.5 2,178.5
2)) 
(1 row)

If the GEOGRAPHY object crosses the date-line, I see results similar to what
I'd get using a POLYGON. In other words, the calculations cannot be choosing
the shorter of the two possible paths along a great circle. (See query
results below) 359 implies choosing the longer path, and I have no idea why
the area in square kilometers is roughly 4.5x instead of 359x larger than
the non-dateline case above. 

g4wd=# select st_area(g)/100, st_area(transform(geometry(g), 4326)),
astext(geometry(g)) from (select 'POLYGON((179.5 2, 179.5 1, -179.5 1,
-179.5 2, 179.5 2))'::geography) as foo(g); 
 ?column? | st_area |astext 

--+-+--
 
 55910.8880691158 | 359 | POLYGON((179.5 2,179.5 1,-179.5 1,-179.5
2,179.5 2)) 
(1 row)

/
My setup: 
g4wd=# select postgis_full_version();  
postgis_full_version 
---
 
 POSTGIS="2.0.0SVN" GEOS="3.2.0-CAPI-1.6.0" PROJ="Rel. 4.7.1, 23 September
2009" LIBXML="2.6.16" USE_STATS 
(1 row) 

g4wd=# select version(); 
  version   


 
 PostgreSQL 8.4.2 on powerpc-apple-darwin9.8.0, compiled by GCC
powerpc-apple-darwin9-gcc-4.0.1 (GCC) 4.0.1 (Apple Inc. build 5490), 32-bit 
(1 row)

Running OS X 10.5.8 

Work arounds, clarifications, links to solutions will be much appreciated.

-- 
View this message in context: 
http://old.nabble.com/Can-GEOGRAPHY-object-cross-the-date-line-tp27714275p27714275.html
Sent from the PostGIS - User mailing list archive at Nabble.com.

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


Re: [postgis-users] ESRI Shape to Postgres

2010-02-24 Thread pcreso
Hi,

The typical approach is via OGC web services (WFS/WMS)

You set up a server (eg: geoserver, UMN mapserver) then you can use a web 
client to render maps (eg: OpenLayers, GeoMoose)

mapserver is a cgi which comes in a ms4w package which may be simpler for you, 
Geoserver is a java/tomcay application.

mapserver can provide WMS/WFS services & also has a java (& php, etc) mapscript 
capability if you want to craft your own client interface instead of using 
something like OpenLayers.

HTH,

  Brent Wood


--- On Thu, 2/25/10, Khurram Niaz Sheikh  wrote:

> From: Khurram Niaz Sheikh 
> Subject: Re: [postgis-users] ESRI Shape to Postgres
> To: "PostGIS Users Discussion" 
> Date: Thursday, February 25, 2010, 2:21 AM
> Thanks Leo,
> 
> That was very helpful I managed to import the shape file as
> a table. Is there any place where I can find javascript apis
> to plot that data on a web platform?
> 
> Regards,
> Khuram
> 
> -Original Message-
> From: postgis-users-boun...@postgis.refractions.net
> [mailto:postgis-users-boun...@postgis.refractions.net]
> On Behalf Of Paragon Corporation
> Sent: Wednesday, February 24, 2010 4:39 PM
> To: 'PostGIS Users Discussion'
> Subject: Re: [postgis-users] ESRI Shape to Postgres
> 
> Khuram,
> 
> We have a quick tutorial here targeted for windows
> users.  Please take a
> look at it and see if it solves your questions.  It
> also covers the loader
> 
> Regarding your create new database.  You need to use
> template_postgis as the
> template when creating a new database.
> 
> http://www.bostongis.com/PrinterFriendly.aspx?content_name=postgis_tut01
> 
> Leo
> 
>  
> 
> -Original Message-
> From: postgis-users-boun...@postgis.refractions.net
> [mailto:postgis-users-boun...@postgis.refractions.net]
> On Behalf Of Khurram
> Niaz Sheikh
> Sent: Wednesday, February 24, 2010 5:51 AM
> To: PostGIS Users Discussion
> Subject: Re: [postgis-users] ESRI Shape to Postgres
> 
> Hi,
> 
> I created the database using admin console, I mean
> rigtclick and create a
> new database, do I have to create the database using
> command line, plz
> advise?
> 
> Regards,
> Khuram
> 
> -Original Message-
> From: postgis-users-boun...@postgis.refractions.net
> [mailto:postgis-users-boun...@postgis.refractions.net]
> On Behalf Of Mark
> Cave-Ayland
> Sent: Wednesday, February 24, 2010 3:50 PM
> To: PostGIS Users Discussion
> Subject: Re: [postgis-users] ESRI Shape to Postgres
> 
> Khurram Niaz Sheikh wrote:
> 
> > Thanks Mark,
> > 
> > Can anyone plz me on this, I have tried to create a
> new database as well
> but still get the same error.
> > 
> > Regards,
> > Khuram
> 
> Hi Khurram,
> 
> You'll have to show us all of the commands you typed from
> creating the
> database to loading the shapefile in order for us to help
> you.
> 
> 
> ATB,
> 
> Mark.
> 
> -- 
> Mark Cave-Ayland - Senior Technical Architect
> PostgreSQL - PostGIS
> Sirius Corporation plc - control through freedom
> http://www.siriusit.co.uk
> t: +44 870 608 0063
> 
> Sirius Labs: http://www.siriusit.co.uk/labs
> ___
> 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
> ___
> 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] ESRI Shape to Postgres

2010-02-24 Thread Khurram Niaz Sheikh
Thanks Leo,

That was very helpful I managed to import the shape file as a table. Is there 
any place where I can find javascript apis to plot that data on a web platform?

Regards,
Khuram

-Original Message-
From: postgis-users-boun...@postgis.refractions.net 
[mailto:postgis-users-boun...@postgis.refractions.net] On Behalf Of Paragon 
Corporation
Sent: Wednesday, February 24, 2010 4:39 PM
To: 'PostGIS Users Discussion'
Subject: Re: [postgis-users] ESRI Shape to Postgres

Khuram,

We have a quick tutorial here targeted for windows users.  Please take a
look at it and see if it solves your questions.  It also covers the loader

Regarding your create new database.  You need to use template_postgis as the
template when creating a new database.

http://www.bostongis.com/PrinterFriendly.aspx?content_name=postgis_tut01

Leo

 

-Original Message-
From: postgis-users-boun...@postgis.refractions.net
[mailto:postgis-users-boun...@postgis.refractions.net] On Behalf Of Khurram
Niaz Sheikh
Sent: Wednesday, February 24, 2010 5:51 AM
To: PostGIS Users Discussion
Subject: Re: [postgis-users] ESRI Shape to Postgres

Hi,

I created the database using admin console, I mean rigtclick and create a
new database, do I have to create the database using command line, plz
advise?

Regards,
Khuram

-Original Message-
From: postgis-users-boun...@postgis.refractions.net
[mailto:postgis-users-boun...@postgis.refractions.net] On Behalf Of Mark
Cave-Ayland
Sent: Wednesday, February 24, 2010 3:50 PM
To: PostGIS Users Discussion
Subject: Re: [postgis-users] ESRI Shape to Postgres

Khurram Niaz Sheikh wrote:

> Thanks Mark,
> 
> Can anyone plz me on this, I have tried to create a new database as well
but still get the same error.
> 
> Regards,
> Khuram

Hi Khurram,

You'll have to show us all of the commands you typed from creating the
database to loading the shapefile in order for us to help you.


ATB,

Mark.

-- 
Mark Cave-Ayland - Senior Technical Architect
PostgreSQL - PostGIS
Sirius Corporation plc - control through freedom
http://www.siriusit.co.uk
t: +44 870 608 0063

Sirius Labs: http://www.siriusit.co.uk/labs
___
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
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] postgis upgrade 1.4 to 1.5 sql file couldn't find $libdir/postgis-1.4

2010-02-24 Thread Paragon Corporation
Bruno,

>From the error its sounds  like the PostGIS 1.4 has been uninstalled in the
process of upgrading  to 1.5.  This is a big no no as if the old is
uninstalled before the database is upgraded, you run into this kind of issue
since they now use different file names.

 

-Original Message-
From: postgis-users-boun...@postgis.refractions.net
[mailto:postgis-users-boun...@postgis.refractions.net] On Behalf Of Mark
Cave-Ayland
Sent: Wednesday, February 24, 2010 5:04 AM
To: PostGIS Users Discussion
Subject: Re: [postgis-users] postgis upgrade 1.4 to 1.5 sql file couldn't
find $libdir/postgis-1.4

Bruno Friedmann wrote:

> Doesn't know if already reported or what I'm doing wrong.
> 
> In rpm (suppose to be the same with .deb) if you upgrade postgis from 
> 1.4 to 1.5 the postgis-1.4 referenced in function doesn't exist after
upgrade.
> 
> As the default postgis upgrade script call the select 
> postgis_lib_version(); we get a fatal error
> ERROR:  could not access file "$libdir/postgis-1.4": No such file or 
> directory
> 
> and all the process fail leaving normal user in trouble ...
> 
> I've try to bypass it commenting the SELECT 
> postgis_major_version_check(); and get the sql executed ...
> 
> Any comments ?

Hi Bruno,

Sorry but I'm not really sure what's happening here - I know that people
have tested the upgrade script when upgrading from 1.4 to 1.5 before the
final release and reported that it works.

I suspect you will need to talk to the maintainer of the .deb packages you
are using to find out why this is failing.


HTH,

Mark.

-- 
Mark Cave-Ayland - Senior Technical Architect
PostgreSQL - PostGIS
Sirius Corporation plc - control through freedom
http://www.siriusit.co.uk
t: +44 870 608 0063

Sirius Labs: http://www.siriusit.co.uk/labs
___
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] ESRI Shape to Postgres

2010-02-24 Thread Paragon Corporation
Khuram,

We have a quick tutorial here targeted for windows users.  Please take a
look at it and see if it solves your questions.  It also covers the loader

Regarding your create new database.  You need to use template_postgis as the
template when creating a new database.

http://www.bostongis.com/PrinterFriendly.aspx?content_name=postgis_tut01

Leo

 

-Original Message-
From: postgis-users-boun...@postgis.refractions.net
[mailto:postgis-users-boun...@postgis.refractions.net] On Behalf Of Khurram
Niaz Sheikh
Sent: Wednesday, February 24, 2010 5:51 AM
To: PostGIS Users Discussion
Subject: Re: [postgis-users] ESRI Shape to Postgres

Hi,

I created the database using admin console, I mean rigtclick and create a
new database, do I have to create the database using command line, plz
advise?

Regards,
Khuram

-Original Message-
From: postgis-users-boun...@postgis.refractions.net
[mailto:postgis-users-boun...@postgis.refractions.net] On Behalf Of Mark
Cave-Ayland
Sent: Wednesday, February 24, 2010 3:50 PM
To: PostGIS Users Discussion
Subject: Re: [postgis-users] ESRI Shape to Postgres

Khurram Niaz Sheikh wrote:

> Thanks Mark,
> 
> Can anyone plz me on this, I have tried to create a new database as well
but still get the same error.
> 
> Regards,
> Khuram

Hi Khurram,

You'll have to show us all of the commands you typed from creating the
database to loading the shapefile in order for us to help you.


ATB,

Mark.

-- 
Mark Cave-Ayland - Senior Technical Architect
PostgreSQL - PostGIS
Sirius Corporation plc - control through freedom
http://www.siriusit.co.uk
t: +44 870 608 0063

Sirius Labs: http://www.siriusit.co.uk/labs
___
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] ESRI Shape to Postgres

2010-02-24 Thread Mark Cave-Ayland

Khurram Niaz Sheikh wrote:


Hi,

I created the database using admin console, I mean rigtclick and create a new 
database, do I have to create the database using command line, plz advise?

Regards,
Khuram


Hi Khuram,

You need to load the postgis.sql and spatial_ref_sys.sql files into your 
database in order to spatially enable it, as per 
http://postgis.refractions.net/documentation/manual-1.5/ch02.html#id2797624.



HTH,

Mark.

--
Mark Cave-Ayland - Senior Technical Architect
PostgreSQL - PostGIS
Sirius Corporation plc - control through freedom
http://www.siriusit.co.uk
t: +44 870 608 0063

Sirius Labs: http://www.siriusit.co.uk/labs
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] ESRI Shape to Postgres

2010-02-24 Thread Khurram Niaz Sheikh
Hi,

I created the database using admin console, I mean rigtclick and create a new 
database, do I have to create the database using command line, plz advise?

Regards,
Khuram

-Original Message-
From: postgis-users-boun...@postgis.refractions.net 
[mailto:postgis-users-boun...@postgis.refractions.net] On Behalf Of Mark 
Cave-Ayland
Sent: Wednesday, February 24, 2010 3:50 PM
To: PostGIS Users Discussion
Subject: Re: [postgis-users] ESRI Shape to Postgres

Khurram Niaz Sheikh wrote:

> Thanks Mark,
> 
> Can anyone plz me on this, I have tried to create a new database as well but 
> still get the same error.
> 
> Regards,
> Khuram

Hi Khurram,

You'll have to show us all of the commands you typed from creating the 
database to loading the shapefile in order for us to help you.


ATB,

Mark.

-- 
Mark Cave-Ayland - Senior Technical Architect
PostgreSQL - PostGIS
Sirius Corporation plc - control through freedom
http://www.siriusit.co.uk
t: +44 870 608 0063

Sirius Labs: http://www.siriusit.co.uk/labs
___
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] ESRI Shape to Postgres

2010-02-24 Thread Mark Cave-Ayland

Khurram Niaz Sheikh wrote:


Thanks Mark,

Can anyone plz me on this, I have tried to create a new database as well but 
still get the same error.

Regards,
Khuram


Hi Khurram,

You'll have to show us all of the commands you typed from creating the 
database to loading the shapefile in order for us to help you.



ATB,

Mark.

--
Mark Cave-Ayland - Senior Technical Architect
PostgreSQL - PostGIS
Sirius Corporation plc - control through freedom
http://www.siriusit.co.uk
t: +44 870 608 0063

Sirius Labs: http://www.siriusit.co.uk/labs
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] ESRI Shape to Postgres

2010-02-24 Thread Khurram Niaz Sheikh
Thanks Mark,

Can anyone plz me on this, I have tried to create a new database as well but 
still get the same error.

Regards,
Khuram

-Original Message-
From: Mark Cave-Ayland [mailto:mark.cave-ayl...@siriusit.co.uk] 
Sent: Wednesday, February 24, 2010 3:02 PM
To: Khurram Niaz Sheikh; PostGIS Users Discussion
Subject: Re: ESRI Shape to Postgres

Khurram Niaz Sheikh wrote:

[CC-d to postgis-users list]

> Hi Mark,  
> 
> Can u plz help me on this, I have just installed to evaluate postgres, I 
> have the data in shape format and wish to convert to postgres format, 
> when I try to do it using shp to postgres importer it gives me error
> 
> Connecting: user=postgres password=** port=5432 host=localhost 
> dbname=postgres
> 
> Connection succeeded.
> 
> Connection: user=postgres password=** port=5432 host=localhost 
> dbname=postgres
> 
> Destination: public.postgrestest
> 
> Source File: D:\My Documents\Data\postgres\postgrestest
> 
> Shapefile type: Arc
> 
> Postgis type: MULTILINESTRING[2]
> 
> Failed SQL begins: "SET CLIENT_ENCODING TO UTF8;
> 
> SET STANDARD_CONFORMING_STRINGS TO ON;
> 
> BEGIN;
> 
> CREATE TABLE "public"."postgrestest" (gid serial PRIMARY KEY,
> 
> "road_id" int4,
> 
> "priority" int2,
> 
> "name" varchar(250),
> 
> "geography" varchar(50));
> 
> SELECT AddGeometryColumn('public','po"
> 
> Failed in pgui_exec(): ERROR:  function addgeometrycolumn(unknown, 
> unknown, unknown, unknown, unknown, integer) does not exist
> 
> LINE 9: SELECT AddGeometryColumn('public','postgrestest','the_geom',...
> 
>^
> 
> HINT:  No function matches the given name and argument types. You might 
> need to add explicit type casts. 
> 
> Shapefile import failed.
> 
> Can uplz give me solution of this issue.

Hi Khurram,

Please email the list directly in future since it is much more likely 
that someone will be able to help you.

Note that the in-built postgres database is for 
maintenance/administration only - you need to create yourself a new 
database and load postgis.sql into it, as per the manual here: 
http://postgis.refractions.net/documentation/manual-1.5/ch02.html#id2797624.


HTH,

Mark.

-- 
Mark Cave-Ayland - Senior Technical Architect
PostgreSQL - PostGIS
Sirius Corporation plc - control through freedom
http://www.siriusit.co.uk
t: +44 870 608 0063

Sirius Labs: http://www.siriusit.co.uk/labs
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] postgis upgrade 1.4 to 1.5 sql file couldn't find $libdir/postgis-1.4

2010-02-24 Thread Mark Cave-Ayland

Bruno Friedmann wrote:


Doesn't know if already reported or what I'm doing wrong.

In rpm (suppose to be the same with .deb) if you upgrade postgis from 1.4 to 
1.5 the postgis-1.4 referenced in function doesn't
exist after upgrade.

As the default postgis upgrade script call the
select postgis_lib_version();
we get a fatal error
ERROR:  could not access file "$libdir/postgis-1.4": No such file or directory

and all the process fail leaving normal user in trouble ...

I've try to bypass it commenting the SELECT postgis_major_version_check();
and get the sql executed ...

Any comments ?


Hi Bruno,

Sorry but I'm not really sure what's happening here - I know that people 
have tested the upgrade script when upgrading from 1.4 to 1.5 before the 
final release and reported that it works.


I suspect you will need to talk to the maintainer of the .deb packages 
you are using to find out why this is failing.



HTH,

Mark.

--
Mark Cave-Ayland - Senior Technical Architect
PostgreSQL - PostGIS
Sirius Corporation plc - control through freedom
http://www.siriusit.co.uk
t: +44 870 608 0063

Sirius Labs: http://www.siriusit.co.uk/labs
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] ESRI Shape to Postgres

2010-02-24 Thread Mark Cave-Ayland

Khurram Niaz Sheikh wrote:

[CC-d to postgis-users list]

Hi Mark,  

Can u plz help me on this, I have just installed to evaluate postgres, I 
have the data in shape format and wish to convert to postgres format, 
when I try to do it using shp to postgres importer it gives me error


Connecting: user=postgres password=** port=5432 host=localhost 
dbname=postgres


Connection succeeded.

Connection: user=postgres password=** port=5432 host=localhost 
dbname=postgres


Destination: public.postgrestest

Source File: D:\My Documents\Data\postgres\postgrestest

Shapefile type: Arc

Postgis type: MULTILINESTRING[2]

Failed SQL begins: "SET CLIENT_ENCODING TO UTF8;

SET STANDARD_CONFORMING_STRINGS TO ON;

BEGIN;

CREATE TABLE "public"."postgrestest" (gid serial PRIMARY KEY,

"road_id" int4,

"priority" int2,

"name" varchar(250),

"geography" varchar(50));

SELECT AddGeometryColumn('public','po"

Failed in pgui_exec(): ERROR:  function addgeometrycolumn(unknown, 
unknown, unknown, unknown, unknown, integer) does not exist


LINE 9: SELECT AddGeometryColumn('public','postgrestest','the_geom',...

   ^

HINT:  No function matches the given name and argument types. You might 
need to add explicit type casts. 


Shapefile import failed.

Can uplz give me solution of this issue.


Hi Khurram,

Please email the list directly in future since it is much more likely 
that someone will be able to help you.


Note that the in-built postgres database is for 
maintenance/administration only - you need to create yourself a new 
database and load postgis.sql into it, as per the manual here: 
http://postgis.refractions.net/documentation/manual-1.5/ch02.html#id2797624.



HTH,

Mark.

--
Mark Cave-Ayland - Senior Technical Architect
PostgreSQL - PostGIS
Sirius Corporation plc - control through freedom
http://www.siriusit.co.uk
t: +44 870 608 0063

Sirius Labs: http://www.siriusit.co.uk/labs
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] Postgis 1.3.7 wit PostgreSQL 8.4. (64bit) on OpenSolaris

2010-02-24 Thread Mark Cave-Ayland

Andreas Luka wrote:

I compiled and installed geos-3.2.0 and proj-4.7.0 successfully with the 
following options


CFLAGS="-m64" CPPFLAGS="-m64" CXXFLAGS="-m64" LDFLAGS="-m64" 
FFLAGS="-m64" LDFLAGS="-L/usr/sfw/lib/amd64/" ./configure


make, make install, make check are also okay, files are installed in 
/usr/local


ls /usr/local -al
drwxr-xr-x  2 root root16 2010-02-24 00:43 .
drwxr-xr-x  6 root other6 2010-02-24 00:35 ..
-rw-r--r--  1 root root296214 2010-02-24 00:35 libgeos_c.a
-rwxr-xr-x+ 1 root root  1020 2010-02-24 00:35 libgeos_c.la
lrwxrwxrwx  1 root root18 2010-02-24 00:35 libgeos_c.so -> 
libgeos_c.so.1.6.0
lrwxrwxrwx  1 root root18 2010-02-24 00:35 libgeos_c.so.1 -> 
libgeos_c.so.1.6.0

-rwxr-xr-x+ 1 root root215312 2010-02-24 00:35 libgeos_c.so.1.6.0
-rwxr-xr-x+ 1 root root   4777808 2010-02-24 00:35 libgeos-3.2.0.so
-rw-r--r--  1 root root  13625096 2010-02-24 00:35 libgeos.a
-rwxr-xr-x+ 1 root root   988 2010-02-24 00:35 libgeos.la
lrwxrwxrwx  1 root root16 2010-02-24 00:35 libgeos.so -> 
libgeos-3.2.0.so

-rw-r--r--  1 root root751590 2010-02-24 00:43 libproj.a
-rwxr-xr-x+ 1 root root   841 2010-02-24 00:43 libproj.la
lrwxrwxrwx  1 root root16 2010-02-24 00:43 libproj.so -> 
libproj.so.0.6.6
lrwxrwxrwx  1 root root16 2010-02-24 00:43 libproj.so.0 -> 
libproj.so.0.6.6

-rwxr-xr-x+ 1 root root440672 2010-02-24 00:43 libproj.so.0.6.6

I compiled postgis with the following options
CC="gcc -m64" CXX="g++" FFLAGS="-m64" LDFLAGS="-L/usr/sfw/lib/amd64/" 
./configure --with-pgsql='/usr/postgres/8.4/bin/amd64/pg_config' 
--with-geos='/usr/local/bin/geos-config' --with-proj='/usr/local' 
--with-proj-libdir='/usr/local/lib'


make and make install are okay

ls -al /usr/postgres/8.4/lib/amd64/liblwgeo*
lrwxrwxrwx 1 root root 16 2010-02-24 00:45 
/usr/postgres/8.4/lib/amd64/liblwgeom.so -> liblwgeom.so.1.3
lrwxrwxrwx 1 root root 16 2010-02-24 00:45 
/usr/postgres/8.4/lib/amd64/liblwgeom.so.1 -> liblwgeom.so.1.3
-rwxr-xr-x 1 root root 980520 2010-02-24 00:45 
/usr/postgres/8.4/lib/amd64/liblwgeom.so.1.3


echo $LD_LIBRARY_PATH
/usr/local/lib

seems okay, restart of the database
but I still getting the following error when I run the sql query for 
lwpostgis.sql:



HINWEIS:  Typ »histogram2d« ist noch nicht definiert
DETAIL:  Hüllentypdefinition wird erzeugt.
FEHLER:  konnte Bibliothek »/usr/postgres/8.4/lib/amd64/liblwgeom.so« 
nicht laden: ld.so.1: postgres: fatal: libgeos_c.so.1: open failed: No 
such file or directory


** Fehler **

FEHLER: konnte Bibliothek »/usr/postgres/8.4/lib/amd64/liblwgeom.so« 
nicht laden: ld.so.1: postgres: fatal: libgeos_c.so.1: open failed: No 
such file or directory

SQL Status:58P01

Any suggestion?


How are you starting PostgreSQL? Bear in mind you need to make sure that 
LD_LIBRARY_PATH is being set for the postgres user as you start the 
database, and not just the user you are logged in as. You may need to 
alter the /etc/init.d/postgresql script in order to do this.



HTH,

Mark.

--
Mark Cave-Ayland - Senior Technical Architect
PostgreSQL - PostGIS
Sirius Corporation plc - control through freedom
http://www.siriusit.co.uk
t: +44 870 608 0063

Sirius Labs: http://www.siriusit.co.uk/labs
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users