Re: [postgis-users] Topology

2012-04-24 Thread Bob Pawley



-Original Message- 
From: Sandro Santilli 
Sent: Tuesday, April 24, 2012 12:12 PM 
To: PostGIS Users Discussion 
Subject: Re: [postgis-users] Topology 


On Tue, Apr 24, 2012 at 10:56:44AM -0700, Bob Pawley wrote:

pg_proc returns 6 rows.

Three rows identical to yours and three rows with column
proargnames  returning a blank or (null) value.


Yeah, so a dirty upgrade (how did you upgrade?).

EnterpriseBD

Remove the non-matching ones
(or all of them and load postgis_upgrade_20_minor.sql)


postgresql version returns PostreSQL 9.1.3.


Should work fine.

Thanks for your help.

Bob

--strk; 

 ,--o-. 
 |   __/  |Delivering high quality PostGIS 2.0 !

 |  / 2.0 |http://strk.keybit.net - http://vizzuality.com
 `-o--'

___
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] Geom/Rast Intersection St9bad_alloc

2012-04-24 Thread JamesH
"What is the type of the geometries you are intersecting with the raster?"
I am intersecting a shapefile of polygons.

-If they are polygons, what proportion of your raster does all your geometry
layer represent? 
They do cover a large proportion of the raster.

ST_SummaryStatsAgg is not installed with PostGIS 2.0. You will find here:

http://trac.osgeo.org/postgis/browser/trunk/raster/scripts/plpgsql/st_summarystatsagg.sql
I copied the code and ran it, returned as successful but when I run the full
query it says that function ST_SummaryStatsagg(raster) does not exist.

Have I copied the function incorrect>

Thank you for your reply,

Regards,
James

-
GIS Undergraduate
--
View this message in context: 
http://postgis.17.n6.nabble.com/Geom-Rast-Intersection-St9bad-alloc-tp4912994p4914495.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] Topology

2012-04-24 Thread Sandro Santilli
On Tue, Apr 24, 2012 at 10:56:44AM -0700, Bob Pawley wrote:
> pg_proc returns 6 rows.
> 
> Three rows identical to yours and three rows with column
> proargnames  returning a blank or (null) value.

Yeah, so a dirty upgrade (how did you upgrade?).

Remove the non-matching ones
(or all of them and load postgis_upgrade_20_minor.sql)

> postgresql version returns PostreSQL 9.1.3.

Should work fine.

--strk; 

  ,--o-. 
  |   __/  |Delivering high quality PostGIS 2.0 !
  |  / 2.0 |http://strk.keybit.net - http://vizzuality.com
  `-o--'

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


Re: [postgis-users] Geom/Rast Intersection St9bad_alloc

2012-04-24 Thread Pierre Racine
James,

Sorry for this late answer.

-What is the type of the geometries you are intersecting with the raster? 

-If they are polygons, what proportion of your raster does all your geometry 
layer represent? 

If this proportion is very high (your polygons cover like 90% of the raster 
extent and your raster are big) then you are better to compute the summary stat 
in raster space like this:

SELECT (ST_SummaryStatsAgg(ST_Clip(rast, geom))).*
FROM clip_build, nclheat
WHERE ST_Intersects(rast, geom)

ST_SummaryStatsAgg is not installed with PostGIS 2.0. You will find here:

http://trac.osgeo.org/postgis/browser/trunk/raster/scripts/plpgsql/st_summarystatsagg.sql

In this case your tiles should be about the same size of the average size of 
your polygons.

If the area covered by your polygons or if those geometries are lines you might 
instead do the process in vector space and do like you did using 
ST_AreaWeightedSummaryStats.sql

http://trac.osgeo.org/postgis/browser/trunk/raster/scripts/plpgsql/st_areaweightedsummarystats.sql

In this case smaller tiles are always better (10x10).

The result of ST_Intersection is vectors and it is done on one band at a time. 
If you want a three band raster as a result then maybe you want to ST_Clip 
instead.

Pierre

> -Original Message-
> From: postgis-users-boun...@postgis.refractions.net [mailto:postgis-users-
> boun...@postgis.refractions.net] On Behalf Of JamesH
> Sent: Tuesday, April 24, 2012 11:42 AM
> To: postgis-users@postgis.refractions.net
> Subject: Re: [postgis-users] Geom/Rast Intersection St9bad_alloc
> 
> "I am attempting to intersect a vector dataset of building polygons with a
> 3-Band Thermal tiff to produce a dataset that shows the thermal readings for
> each polygon."
> 
> If I took the 3 band jpeg of this raster and used ST_AsTiff to convert it to
> a single band tiff would this calculation be valid? How could I place this
> into the query?
> 
> SELECT gid, ST_Intersection(geom, rast, 1)
> FROM clip_build, nclheat
> WHERE ST_Intersects(rast, geom)
> 
> any help greatly appreciated,
> 
> Kind Regards,
> James
> 
> -
> GIS Undergraduate
> --
> View this message in context: http://postgis.17.n6.nabble.com/Geom-Rast-
> Intersection-St9bad-alloc-tp4912994p4913835.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] Topology

2012-04-24 Thread Bob Pawley

pg_proc returns 6 rows.

Three rows identical to yours and three rows with column
proargnames  returning a blank or (null) value.

postgresql version returns PostreSQL 9.1.3.

Bob


-Original Message- 
From: Sandro Santilli

Sent: Tuesday, April 24, 2012 10:28 AM
To: PostGIS Users Discussion
Subject: Re: [postgis-users] Topology

On Tue, Apr 24, 2012 at 10:14:52AM -0700, Bob Pawley wrote:


I’ve set up postgis 2.0 and have run the topology.sql file.
Select postgis_full_version() returns the TOPOLOGY label.

However, unlike the postgis 1.5 setup, when I run
select topology.CreateTopology('TEST', -1);

...
ERROR:  function addgeometrycolumn(unknown, unknown, unknown, unknown, 
unknown, integer) is not unique

LINE 1: SELECT AddGeometryColumn('TEST','face','mbr','-1','POLYGON',...


Uhm, maybe you have old PostGIS 1.5 signatures around ?

This is what I have here:

=> select proname, proargnames from pg_proc where proname = 
'addgeometrycolumn';

 proname  |proargnames
---+---
addgeometrycolumn | 
{catalog_name,schema_name,table_name,column_name,new_srid_in,new_type,new_dim,use_typmod}
addgeometrycolumn | 
{schema_name,table_name,column_name,new_srid,new_type,new_dim,use_typmod}
addgeometrycolumn | 
{table_name,column_name,new_srid,new_type,new_dim,use_typmod}

(3 rows)

There might indeed be an ambiguity due to the use_typmod default argument,
but I can't reproduce here so please first of all check your pg_proc.

Then report your postgresql version.

--strk;

 ,--o-.
 |   __/  |Delivering high quality PostGIS 2.0 !
 |  / 2.0 |http://strk.keybit.net - http://vizzuality.com
 `-o--'

___
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] Installation Error

2012-04-24 Thread Smaran Harihar
Hi,

I tried installing GeoDjango on Ubuntu and assumed that GEOS and Proj
existed on Linux and directly installed PostGIS.

Now I ran the tests as given on the Django
site,
and this is the output I am receiving

>>>from django.contrib.gis.tests import test_gdal
Traceback (most recent call last):
  File "", line 1, in 
  File
"/home/smaranh/django-env/local/lib/python2.7/site-packages/django/contrib/gis/tests/__init__.py",
line 2, in 
from django.test.simple import build_suite, DjangoTestSuiteRunner
  File
"/home/smaranh/django-env/local/lib/python2.7/site-packages/django/test/__init__.py",
line 5, in 
from django.test.client import Client, RequestFactory
  File
"/home/smaranh/django-env/local/lib/python2.7/site-packages/django/test/client.py",
line 21, in 
from django.test import signals
  File
"/home/smaranh/django-env/local/lib/python2.7/site-packages/django/test/signals.py",
line 2, in 
from django.db import connections
  File
"/home/smaranh/django-env/local/lib/python2.7/site-packages/django/db/__init__.py",
line 11, in 
if DEFAULT_DB_ALIAS not in settings.DATABASES:
  File
"/home/smaranh/django-env/local/lib/python2.7/site-packages/django/utils/functional.py",
line 184, in inner
self._setup()
  File
"/home/smaranh/django-env/local/lib/python2.7/site-packages/django/conf/__init__.py",
line 40, in _setup
raise ImportError("Settings cannot be imported, because environment
variable %s is undefined." % ENVIRONMENT_VARIABLE)
ImportError: Settings cannot be imported, because environment variable
DJANGO_SETTINGS_MODULE is undefined.

Should I uninstall PostGIS and install GEOS and PROJ or should I install
them over PostGIS? Also how do I uninstall PostGIS?

-- 
Thanks & Regards
Smaran Harihar
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] Topology

2012-04-24 Thread Sandro Santilli
On Tue, Apr 24, 2012 at 10:14:52AM -0700, Bob Pawley wrote:

> I’ve set up postgis 2.0 and have run the topology.sql file.
> Select postgis_full_version() returns the TOPOLOGY label.
> 
> However, unlike the postgis 1.5 setup, when I run 
> select topology.CreateTopology('TEST', -1);
...
> ERROR:  function addgeometrycolumn(unknown, unknown, unknown, unknown, 
> unknown, integer) is not unique
> LINE 1: SELECT AddGeometryColumn('TEST','face','mbr','-1','POLYGON',...

Uhm, maybe you have old PostGIS 1.5 signatures around ?

This is what I have here:

=> select proname, proargnames from pg_proc where proname = 'addgeometrycolumn';
  proname  |proargnames
---+---
 addgeometrycolumn | 
{catalog_name,schema_name,table_name,column_name,new_srid_in,new_type,new_dim,use_typmod}
 addgeometrycolumn | 
{schema_name,table_name,column_name,new_srid,new_type,new_dim,use_typmod}
 addgeometrycolumn | 
{table_name,column_name,new_srid,new_type,new_dim,use_typmod}
(3 rows)

There might indeed be an ambiguity due to the use_typmod default argument,
but I can't reproduce here so please first of all check your pg_proc.

Then report your postgresql version.

--strk;

  ,--o-. 
  |   __/  |Delivering high quality PostGIS 2.0 !
  |  / 2.0 |http://strk.keybit.net - http://vizzuality.com
  `-o--'

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


Re: [postgis-users] banging my head on setting up and running geodjango

2012-04-24 Thread Smaran Harihar
how do I verify if my database is proper?

On Tue, Apr 24, 2012 at 10:14 AM, Smaran Harihar
wrote:

> thanks for replying. I have attached the settings.py file
>
>
> On Tue, Apr 24, 2012 at 10:10 AM, Nabil Servais 
> wrote:
>
>> Could you post your settings.py please? I think it's a problem with the
>> database section.
>> Le 24 avr. 2012 19:03, "Smaran Harihar"  a
>> écrit :
>>
>>>  Hi,
>>>
>>> I am really fed up in setting up and running GeoDjango.
>>>
>>> The first step was to setup the Spatial Database in PostGIS which I was
>>> really banging my head when it came to OS X. So i shifted to Ubuntu 11.10
>>> and it seemed it was quite easy. Now having completed the post
>>> installation 
>>> process,
>>> I created the required changes that need to be done in the settings.py and
>>> now i am trying to,
>>>
>>> python manage.py sqlall world
>>>
>>> but it is returning a bunch of errors.
>>>
>>> (django-env)smaranh@ubuntu:~/geodjango$ python manage.py sqlall world
>>> Traceback (most recent call last):
>>>   File "manage.py", line 10, in 
>>> execute_from_command_line(sys.argv)
>>>   File
>>> "/home/smaranh/django-env/local/lib/python2.7/site-packages/django/core/management/__init__.py",
>>> line 443, in execute_from_command_line
>>> utility.execute()
>>>   File
>>> "/home/smaranh/django-env/local/lib/python2.7/site-packages/django/core/management/__init__.py",
>>> line 382, in execute
>>> self.fetch_command(subcommand).run_from_argv(self.argv)
>>>   File
>>> "/home/smaranh/django-env/local/lib/python2.7/site-packages/django/core/management/__init__.py",
>>> line 261, in fetch_command
>>> klass = load_command_class(app_name, subcommand)
>>>   File
>>> "/home/smaranh/django-env/local/lib/python2.7/site-packages/django/core/management/__init__.py",
>>> line 69, in load_command_class
>>> module = import_module('%s.management.commands.%s' % (app_name,
>>> name))
>>>   File
>>> "/home/smaranh/django-env/local/lib/python2.7/site-packages/django/utils/importlib.py",
>>> line 35, in import_module
>>> __import__(name)
>>>   File
>>> "/home/smaranh/django-env/local/lib/python2.7/site-packages/django/core/management/commands/sqlall.py",
>>> line 4, in 
>>> from django.core.management.sql import sql_all
>>>   File
>>> "/home/smaranh/django-env/local/lib/python2.7/site-packages/django/core/management/sql.py",
>>> line 6, in 
>>> from django.db import models
>>>   File
>>> "/home/smaranh/django-env/local/lib/python2.7/site-packages/django/db/__init__.py",
>>> line 40, in 
>>> backend = load_backend(connection.settings_dict['ENGINE'])
>>>   File
>>> "/home/smaranh/django-env/local/lib/python2.7/site-packages/django/db/__init__.py",
>>> line 34, in __getattr__
>>> return getattr(connections[DEFAULT_DB_ALIAS], item)
>>>   File
>>> "/home/smaranh/django-env/local/lib/python2.7/site-packages/django/db/utils.py",
>>> line 92, in __getitem__
>>> backend = load_backend(db['ENGINE'])
>>>   File
>>> "/home/smaranh/django-env/local/lib/python2.7/site-packages/django/db/utils.py",
>>> line 44, in load_backend
>>> raise ImproperlyConfigured(error_msg)
>>> django.core.exceptions.ImproperlyConfigured:
>>> 'django.contrib.gis.db.backends.postgis' isn't an available database
>>> backend.
>>> Try using django.db.backends.XXX, where XXX is one of:
>>> 'dummy', 'mysql', 'oracle', 'postgresql_psycopg2', 'sqlite3'
>>> Error was: No module named psycopg2.extensions
>>>
>>>
>>> Really need your help guys.
>>>
>>> --
>>> Thanks & Regards
>>> Smaran Harihar
>>>
>>>
>>> ___
>>> 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
>>
>>
>
>
> --
> Thanks & Regards
> Smaran Harihar
>
>


-- 
Thanks & Regards
Smaran Harihar
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] banging my head on setting up and running geodjango

2012-04-24 Thread Smaran Harihar
thanks for replying. I have attached the settings.py file

On Tue, Apr 24, 2012 at 10:10 AM, Nabil Servais wrote:

> Could you post your settings.py please? I think it's a problem with the
> database section.
> Le 24 avr. 2012 19:03, "Smaran Harihar"  a
> écrit :
>
>>  Hi,
>>
>> I am really fed up in setting up and running GeoDjango.
>>
>> The first step was to setup the Spatial Database in PostGIS which I was
>> really banging my head when it came to OS X. So i shifted to Ubuntu 11.10
>> and it seemed it was quite easy. Now having completed the post
>> installation 
>> process,
>> I created the required changes that need to be done in the settings.py and
>> now i am trying to,
>>
>> python manage.py sqlall world
>>
>> but it is returning a bunch of errors.
>>
>> (django-env)smaranh@ubuntu:~/geodjango$ python manage.py sqlall world
>> Traceback (most recent call last):
>>   File "manage.py", line 10, in 
>> execute_from_command_line(sys.argv)
>>   File
>> "/home/smaranh/django-env/local/lib/python2.7/site-packages/django/core/management/__init__.py",
>> line 443, in execute_from_command_line
>> utility.execute()
>>   File
>> "/home/smaranh/django-env/local/lib/python2.7/site-packages/django/core/management/__init__.py",
>> line 382, in execute
>> self.fetch_command(subcommand).run_from_argv(self.argv)
>>   File
>> "/home/smaranh/django-env/local/lib/python2.7/site-packages/django/core/management/__init__.py",
>> line 261, in fetch_command
>> klass = load_command_class(app_name, subcommand)
>>   File
>> "/home/smaranh/django-env/local/lib/python2.7/site-packages/django/core/management/__init__.py",
>> line 69, in load_command_class
>> module = import_module('%s.management.commands.%s' % (app_name, name))
>>   File
>> "/home/smaranh/django-env/local/lib/python2.7/site-packages/django/utils/importlib.py",
>> line 35, in import_module
>> __import__(name)
>>   File
>> "/home/smaranh/django-env/local/lib/python2.7/site-packages/django/core/management/commands/sqlall.py",
>> line 4, in 
>> from django.core.management.sql import sql_all
>>   File
>> "/home/smaranh/django-env/local/lib/python2.7/site-packages/django/core/management/sql.py",
>> line 6, in 
>> from django.db import models
>>   File
>> "/home/smaranh/django-env/local/lib/python2.7/site-packages/django/db/__init__.py",
>> line 40, in 
>> backend = load_backend(connection.settings_dict['ENGINE'])
>>   File
>> "/home/smaranh/django-env/local/lib/python2.7/site-packages/django/db/__init__.py",
>> line 34, in __getattr__
>> return getattr(connections[DEFAULT_DB_ALIAS], item)
>>   File
>> "/home/smaranh/django-env/local/lib/python2.7/site-packages/django/db/utils.py",
>> line 92, in __getitem__
>> backend = load_backend(db['ENGINE'])
>>   File
>> "/home/smaranh/django-env/local/lib/python2.7/site-packages/django/db/utils.py",
>> line 44, in load_backend
>> raise ImproperlyConfigured(error_msg)
>> django.core.exceptions.ImproperlyConfigured:
>> 'django.contrib.gis.db.backends.postgis' isn't an available database
>> backend.
>> Try using django.db.backends.XXX, where XXX is one of:
>> 'dummy', 'mysql', 'oracle', 'postgresql_psycopg2', 'sqlite3'
>> Error was: No module named psycopg2.extensions
>>
>>
>> Really need your help guys.
>>
>> --
>> Thanks & Regards
>> Smaran Harihar
>>
>>
>> ___
>> 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
>
>


-- 
Thanks & Regards
Smaran Harihar


settings.py
Description: Binary data
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


[postgis-users] Topology

2012-04-24 Thread Bob Pawley
Hi

I’ve set up postgis 2.0 and have run the topology.sql file.

Select postgis_full_version() returns the TOPOLOGY label.

However, unlike the postgis 1.5 setup, when I run 
select topology.CreateTopology('TEST', -1);
I get the following error which I’m not able to interpret.

NOTICE:  CREATE TABLE will create implicit sequence "face_face_id_seq" for 
serial column "face.face_id"
CONTEXT:  SQL statement "CREATE TABLE "TEST".face (face_id SERIAL, CONSTRAINT 
face_primary_key PRIMARY KEY(face_id));"
PL/pgSQL function "createtopology" line 26 at EXECUTE statement
NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index 
"face_primary_key" for table "face"
CONTEXT:  SQL statement "CREATE TABLE "TEST".face (face_id SERIAL, CONSTRAINT 
face_primary_key PRIMARY KEY(face_id));"
PL/pgSQL function "createtopology" line 26 at EXECUTE statement
ERROR:  function addgeometrycolumn(unknown, unknown, unknown, unknown, unknown, 
integer) is not unique
LINE 1: SELECT AddGeometryColumn('TEST','face','mbr','-1','POLYGON',...
   ^
HINT:  Could not choose a best candidate function. You might need to add 
explicit type casts.
QUERY:  SELECT AddGeometryColumn('TEST','face','mbr','-1','POLYGON',2)
CONTEXT:  PL/pgSQL function "createtopology" line 33 at EXECUTE statement

Any help would be appreciated.

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


Re: [postgis-users] banging my head on setting up and running geodjango

2012-04-24 Thread Nabil Servais
Could you post your settings.py please? I think it's a problem with the
database section.
Le 24 avr. 2012 19:03, "Smaran Harihar"  a écrit :

> Hi,
>
> I am really fed up in setting up and running GeoDjango.
>
> The first step was to setup the Spatial Database in PostGIS which I was
> really banging my head when it came to OS X. So i shifted to Ubuntu 11.10
> and it seemed it was quite easy. Now having completed the post
> installation 
> process,
> I created the required changes that need to be done in the settings.py and
> now i am trying to,
>
> python manage.py sqlall world
>
> but it is returning a bunch of errors.
>
> (django-env)smaranh@ubuntu:~/geodjango$ python manage.py sqlall world
> Traceback (most recent call last):
>   File "manage.py", line 10, in 
> execute_from_command_line(sys.argv)
>   File
> "/home/smaranh/django-env/local/lib/python2.7/site-packages/django/core/management/__init__.py",
> line 443, in execute_from_command_line
> utility.execute()
>   File
> "/home/smaranh/django-env/local/lib/python2.7/site-packages/django/core/management/__init__.py",
> line 382, in execute
> self.fetch_command(subcommand).run_from_argv(self.argv)
>   File
> "/home/smaranh/django-env/local/lib/python2.7/site-packages/django/core/management/__init__.py",
> line 261, in fetch_command
> klass = load_command_class(app_name, subcommand)
>   File
> "/home/smaranh/django-env/local/lib/python2.7/site-packages/django/core/management/__init__.py",
> line 69, in load_command_class
> module = import_module('%s.management.commands.%s' % (app_name, name))
>   File
> "/home/smaranh/django-env/local/lib/python2.7/site-packages/django/utils/importlib.py",
> line 35, in import_module
> __import__(name)
>   File
> "/home/smaranh/django-env/local/lib/python2.7/site-packages/django/core/management/commands/sqlall.py",
> line 4, in 
> from django.core.management.sql import sql_all
>   File
> "/home/smaranh/django-env/local/lib/python2.7/site-packages/django/core/management/sql.py",
> line 6, in 
> from django.db import models
>   File
> "/home/smaranh/django-env/local/lib/python2.7/site-packages/django/db/__init__.py",
> line 40, in 
> backend = load_backend(connection.settings_dict['ENGINE'])
>   File
> "/home/smaranh/django-env/local/lib/python2.7/site-packages/django/db/__init__.py",
> line 34, in __getattr__
> return getattr(connections[DEFAULT_DB_ALIAS], item)
>   File
> "/home/smaranh/django-env/local/lib/python2.7/site-packages/django/db/utils.py",
> line 92, in __getitem__
> backend = load_backend(db['ENGINE'])
>   File
> "/home/smaranh/django-env/local/lib/python2.7/site-packages/django/db/utils.py",
> line 44, in load_backend
> raise ImproperlyConfigured(error_msg)
> django.core.exceptions.ImproperlyConfigured:
> 'django.contrib.gis.db.backends.postgis' isn't an available database
> backend.
> Try using django.db.backends.XXX, where XXX is one of:
> 'dummy', 'mysql', 'oracle', 'postgresql_psycopg2', 'sqlite3'
> Error was: No module named psycopg2.extensions
>
>
> Really need your help guys.
>
> --
> Thanks & Regards
> Smaran Harihar
>
>
> ___
> 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] banging my head on setting up and running geodjango

2012-04-24 Thread Smaran Harihar
Hi,

I am really fed up in setting up and running GeoDjango.

The first step was to setup the Spatial Database in PostGIS which I was
really banging my head when it came to OS X. So i shifted to Ubuntu 11.10
and it seemed it was quite easy. Now having completed the post installation
process,
I created the required changes that need to be done in the settings.py and
now i am trying to,

python manage.py sqlall world

but it is returning a bunch of errors.

(django-env)smaranh@ubuntu:~/geodjango$ python manage.py sqlall world
Traceback (most recent call last):
  File "manage.py", line 10, in 
execute_from_command_line(sys.argv)
  File
"/home/smaranh/django-env/local/lib/python2.7/site-packages/django/core/management/__init__.py",
line 443, in execute_from_command_line
utility.execute()
  File
"/home/smaranh/django-env/local/lib/python2.7/site-packages/django/core/management/__init__.py",
line 382, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
  File
"/home/smaranh/django-env/local/lib/python2.7/site-packages/django/core/management/__init__.py",
line 261, in fetch_command
klass = load_command_class(app_name, subcommand)
  File
"/home/smaranh/django-env/local/lib/python2.7/site-packages/django/core/management/__init__.py",
line 69, in load_command_class
module = import_module('%s.management.commands.%s' % (app_name, name))
  File
"/home/smaranh/django-env/local/lib/python2.7/site-packages/django/utils/importlib.py",
line 35, in import_module
__import__(name)
  File
"/home/smaranh/django-env/local/lib/python2.7/site-packages/django/core/management/commands/sqlall.py",
line 4, in 
from django.core.management.sql import sql_all
  File
"/home/smaranh/django-env/local/lib/python2.7/site-packages/django/core/management/sql.py",
line 6, in 
from django.db import models
  File
"/home/smaranh/django-env/local/lib/python2.7/site-packages/django/db/__init__.py",
line 40, in 
backend = load_backend(connection.settings_dict['ENGINE'])
  File
"/home/smaranh/django-env/local/lib/python2.7/site-packages/django/db/__init__.py",
line 34, in __getattr__
return getattr(connections[DEFAULT_DB_ALIAS], item)
  File
"/home/smaranh/django-env/local/lib/python2.7/site-packages/django/db/utils.py",
line 92, in __getitem__
backend = load_backend(db['ENGINE'])
  File
"/home/smaranh/django-env/local/lib/python2.7/site-packages/django/db/utils.py",
line 44, in load_backend
raise ImproperlyConfigured(error_msg)
django.core.exceptions.ImproperlyConfigured:
'django.contrib.gis.db.backends.postgis' isn't an available database
backend.
Try using django.db.backends.XXX, where XXX is one of:
'dummy', 'mysql', 'oracle', 'postgresql_psycopg2', 'sqlite3'
Error was: No module named psycopg2.extensions


Really need your help guys.

-- 
Thanks & Regards
Smaran Harihar
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] Geom/Rast Intersection St9bad_alloc

2012-04-24 Thread JamesH
"I am attempting to intersect a vector dataset of building polygons with a
3-Band Thermal tiff to produce a dataset that shows the thermal readings for
each polygon."

If I took the 3 band jpeg of this raster and used ST_AsTiff to convert it to
a single band tiff would this calculation be valid? How could I place this
into the query?

SELECT gid, ST_Intersection(geom, rast, 1) 
FROM clip_build, nclheat 
WHERE ST_Intersects(rast, geom) 

any help greatly appreciated,

Kind Regards,
James

-
GIS Undergraduate
--
View this message in context: 
http://postgis.17.n6.nabble.com/Geom-Rast-Intersection-St9bad-alloc-tp4912994p4913835.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] type "public.geometry" is only a shell

2012-04-24 Thread Gold, Jack L (US SSA)
Thanks Sandro. That was exactly it and gives me more insight to what I'm doing.

--Jack

-Original Message-
From: postgis-users-boun...@postgis.refractions.net 
[mailto:postgis-users-boun...@postgis.refractions.net] On Behalf Of Sandro 
Santilli
Sent: Tuesday, April 24, 2012 8:51 AM
To: PostGIS Users Discussion
Subject: Re: [postgis-users] type "public.geometry" is only a shell

On Tue, Apr 24, 2012 at 08:46:19AM -0400, Gold, Jack L  (US SSA) wrote:
> I recently dumped a database and attempted to rebuild postgis and my database 
> on an alternate server.  I am receiving a message:
> 
> ERROR: type "public.geometry" is only a shell SQL state 42704
> 
> I'm pretty sure I put everything in correctly when rebuilding.  Is anyone 
> aware of what this message is indicating?
> 
> Running: postgreSQL 9.1, postGIS 2.0.1SVN, geos 3.3.2, gdal 1.9.0, 
> proj 4.8.0

See the Hard Upgrade section in PostGIS manual:
http://postgis.refractions.net/documentation/manual-svn/postgis_installation.html#hard_upgrade

--strk;

  ,--o-. 
  |   __/  |Delivering high quality PostGIS 2.0 !
  |  / 2.0 |http://strk.keybit.net - http://vizzuality.com
  `-o--'

___
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] type "public.geometry" is only a shell

2012-04-24 Thread Sandro Santilli
On Tue, Apr 24, 2012 at 08:46:19AM -0400, Gold, Jack L  (US SSA) wrote:
> I recently dumped a database and attempted to rebuild postgis and my database 
> on an alternate server.  I am receiving a message:
> 
> ERROR: type "public.geometry" is only a shell
> SQL state 42704
> 
> I'm pretty sure I put everything in correctly when rebuilding.  Is anyone 
> aware of what this message is indicating?
> 
> Running: postgreSQL 9.1, postGIS 2.0.1SVN, geos 3.3.2, gdal 1.9.0, proj 4.8.0

See the Hard Upgrade section in PostGIS manual:
http://postgis.refractions.net/documentation/manual-svn/postgis_installation.html#hard_upgrade

--strk;

  ,--o-. 
  |   __/  |Delivering high quality PostGIS 2.0 !
  |  / 2.0 |http://strk.keybit.net - http://vizzuality.com
  `-o--'

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


[postgis-users] type "public.geometry" is only a shell

2012-04-24 Thread Gold, Jack L (US SSA)
I recently dumped a database and attempted to rebuild postgis and my database 
on an alternate server.  I am receiving a message:

ERROR: type "public.geometry" is only a shell
SQL state 42704

I'm pretty sure I put everything in correctly when rebuilding.  Is anyone aware 
of what this message is indicating?

Running: postgreSQL 9.1, postGIS 2.0.1SVN, geos 3.3.2, gdal 1.9.0, proj 4.8.0


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


Re: [postgis-users] Postgis2.0 documentation for Windows

2012-04-24 Thread JamesH
"Is there any online or at least any useful articles and tips? I guess some
things must be the same with the linux documentation but some others, 
like uploading a raster file, cannot be the same."

Is there a specific task you're trying to acheive?

I use Postgis 2.0 on Windows and although the syntax is obviously different
from Linux, most of the content is the same. 
I find this document helpful:
http://www.postgis.us/downloads/postgis20_raster_cheatsheet.html

For uploading a Raster, if you're PostGIS install has been successful, I run
raster2pgsql from command prompt, navigating to the folder 
raster2pgsql is in C:\Program Files..\PostgreSQL\9.1\bin

Then for most of my raster work I've used basic constraints, so something
like
>raster2pgsql -s YOURSRID -I -C C:\Users\dataname.tif public.tablename >
C:\Users\dataname.sql
Where the constraints are from this manual:
http://www.postgis.org/documentation/manual-svn/using_raster.xml.html

To load it into PostGIS I opt for: In a Query Window > File > Open > the SQL
file from raster2pgsql and then Execute Query
Though for larger files it is better to use something like: psql -U
yourpostgresrole -f "C:\Users\Data\Thermal.sql" yourDatabase 

Hope that helps,

James 

-
GIS Undergraduate
--
View this message in context: 
http://postgis.17.n6.nabble.com/Postgis2-0-documentation-for-Windows-tp4907743p4913285.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] Euclidean Distance Raster

2012-04-24 Thread JamesH
"> I am wanting to create a Raster in PostGIS that displays the Euclidean
> Distance between Points that I have in a table.
> It can be done in ArcGIS, using the Euclidean Distance tool but I'm aiming
> to create it through PostGIS.

There is no easy tool to do that right now. You will have to use
ST_MapAlgebraFct and write your own custom function. Let us know your
results."

Unfortunately I couldn't find a successful solution to do a Euclidean
distance raster so being pushed for time on my dissertation, I made one in
ArcGIS and used it for the next stage. I am trying to recreate a ArcGIS
tutorial using PostGIS, starting with the same data for both and examining
the outputs.

Kind Regards,
James


-
GIS Undergraduate
--
View this message in context: 
http://postgis.17.n6.nabble.com/Euclidean-Distance-Raster-tp4860017p4913247.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] Geom/Rast Intersection St9bad_alloc

2012-04-24 Thread JamesH
I am attempting to intersect a vector dataset of building polygons with a
3-Band Thermal tiff to produce a dataset that shows the thermal readings for
each polygon.

"What were you trying to achieve ? Did you read the reference manual ?"

I hoped from the example in the reference
"-- Return bands 2 and 3. Use array to define bands
SELECT ST_NumBands(ST_Band(rast, ARRAY[2,3])) " 
that I could use ST_Band(rast, ARRAY[1,2,3]) to perform the intersection on
all three bands simultaneously.

Is there an easier way of completing this?

Regards,
James




-
GIS Undergraduate
--
View this message in context: 
http://postgis.17.n6.nabble.com/Geom-Rast-Intersection-St9bad-alloc-tp4912994p4913238.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] Geom/Rast Intersection St9bad_alloc

2012-04-24 Thread Sandro Santilli
On Tue, Apr 24, 2012 at 03:51:27AM -0700, JamesH wrote:

> Have tried ST_Intersection(geom, rast, ST_Band(rast, ARRAY[1,2,3])) in query

What were you trying to achieve ? Did you read the reference manual ?

--strk;

  ,--o-. 
  |   __/  |Delivering high quality PostGIS 2.0 !
  |  / 2.0 |http://strk.keybit.net - http://vizzuality.com
  `-o--'

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


Re: [postgis-users] Geom/Rast Intersection St9bad_alloc

2012-04-24 Thread JamesH
"ST_Band ?" Thank you.

Have tried ST_Intersection(geom, rast, ST_Band(rast, ARRAY[1,2,3])) in query
above
Returns: function st_intersection(geometry, raster, raster) does not exist.

Have also attempted ST_Intersection(geom, rast, ST_Band(rast, '1,2,3')) 
but this returns the same error.

Basic syntax question, but how do I cast to integer or double precision?
I've used ::text before
but not sure its the same.

Kind Regards,
James

-
GIS Undergraduate
--
View this message in context: 
http://postgis.17.n6.nabble.com/Geom-Rast-Intersection-St9bad-alloc-tp4912994p4913110.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] Geom/Rast Intersection St9bad_alloc

2012-04-24 Thread Sandro Santilli
On Tue, Apr 24, 2012 at 03:06:15AM -0700, JamesH wrote:

> I've checked and seen that my raster is actually three bands when I thought
> it was just single band.
> Is there a way to alter the query to account for this? 

ST_Band ?
http://www.postgis.org/documentation/manual-svn/RT_ST_Band.html

--strk;

  ,--o-. 
  |   __/  |Delivering high quality PostGIS 2.0 !
  |  / 2.0 |http://strk.keybit.net - http://vizzuality.com
  `-o--'

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


Re: [postgis-users] Geom/Rast Intersection St9bad_alloc

2012-04-24 Thread JamesH
"St9Bad_alloc means the process run out of memory.
There may be a memory leak or uncareful use in
ST_Intersection(raster,geometry)."

Thought it could be something like that.

"Try restricting the scope of your queries, using
subsets from clip_build and nclheat and storing the
results in a temporary table."

I've checked and seen that my raster is actually three bands when I thought
it was just single band.
Is there a way to alter the query to account for this? 

Regards,
James

-
GIS Undergraduate
--
View this message in context: 
http://postgis.17.n6.nabble.com/Geom-Rast-Intersection-St9bad-alloc-tp4912994p4913025.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] Geom/Rast Intersection St9bad_alloc

2012-04-24 Thread Sandro Santilli
On Tue, Apr 24, 2012 at 02:50:37AM -0700, JamesH wrote:
> Hi all,
> 
> I am attempting to intersect a thermal raster TIFF with a MasterMap
> shapefile.
> 
> Both sets of data are stored in my database successfully and the query I am
> running is:
> SELECT gid, ST_Intersection(geom, rast, 1)
> FROM clip_build, nclheat
> WHERE ST_Intersects(rast, geom)
> 
> The raster file is quite large so takes a few hours to run, but it returned
> an error message that I don't fully understand (below)
> NOTICE:  Ring Self-intersection at or near point 425485.0638371231
> 567560.21788342111
> CONTEXT:  PL/pgSQL function "st_intersection" line 10 at RETURN QUERY
> NOTICE:  LWGEOM_GEOS_buildArea() threw an error: St9bad_alloc
> CONTEXT:  PL/pgSQL function "st_intersection" line 10 at RETURN QUERY
> ERROR:  St9bad_alloc
> CONTEXT:  PL/pgSQL function "st_intersection" line 10 at RETURN QUERY
> 
> Can anyone explain how to solve the Ring self-intersection problem or what
> St9Bad_alloc is?

St9Bad_alloc means the process run out of memory.
There may be a memory leak or uncareful use in
ST_Intersection(raster,geometry).
Try restricting the scope of your queries, using
subsets from clip_build and nclheat and storing the
results in a temporary table.

Shall you find a single pair of inputs consistently triggering the problem
it'll be easier to deal with.

--strk; 

  ,--o-. 
  |   __/  |Delivering high quality PostGIS 2.0 !
  |  / 2.0 |http://strk.keybit.net - http://vizzuality.com
  `-o--'

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


[postgis-users] Geom/Rast Intersection St9bad_alloc

2012-04-24 Thread JamesH
Hi all,

I am attempting to intersect a thermal raster TIFF with a MasterMap
shapefile.

Both sets of data are stored in my database successfully and the query I am
running is:
SELECT gid, ST_Intersection(geom, rast, 1)
FROM clip_build, nclheat
WHERE ST_Intersects(rast, geom)

The raster file is quite large so takes a few hours to run, but it returned
an error message that I don't fully understand (below)
NOTICE:  Ring Self-intersection at or near point 425485.0638371231
567560.21788342111
CONTEXT:  PL/pgSQL function "st_intersection" line 10 at RETURN QUERY
NOTICE:  LWGEOM_GEOS_buildArea() threw an error: St9bad_alloc
CONTEXT:  PL/pgSQL function "st_intersection" line 10 at RETURN QUERY
ERROR:  St9bad_alloc
CONTEXT:  PL/pgSQL function "st_intersection" line 10 at RETURN QUERY

Can anyone explain how to solve the Ring self-intersection problem or what
St9Bad_alloc is?

Kind Regards,
James

-
GIS Undergraduate
--
View this message in context: 
http://postgis.17.n6.nabble.com/Geom-Rast-Intersection-St9bad-alloc-tp4912994p4912994.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] Raster import is causing Postgres to close

2012-04-24 Thread JamesH
Thanks to both - definitely the error was caused by the Raster file I was
trying to load was too large - PgAdmin could not handle the SQL file.

I have cut the Raster down to a smaller area and am using that instead.

Kind Regards,
James 


-
GIS Undergraduate
--
View this message in context: 
http://postgis.17.n6.nabble.com/Raster-import-is-causing-Postgres-to-close-tp4897915p4912979.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] compiling documentation

2012-04-24 Thread Sandro Santilli
On Tue, Apr 24, 2012 at 08:56:15AM +0200, Pasquale Di Donato wrote:
> >
> > By using the ./make_dist.sh call and working inside the created
> > folder it won't be easy to contribute patches back, instead
> > you can take out the 2nd step:
> >
> >  -> svn checkout http://svn.osgeo.org/postgiss/trunk
> >  -> cd trunk
> >  -> ./autogen.sh
> >  -> ./configure
> >  -> cd doc
> >  -> make html (or pdf)
> >
> 
> Sandro tha was the way I first proceeded..but got the error:
> 
> 
> In file included from liblwgeom_internal.h:19:0,
>  from stringbuffer.c:40:
> ../postgis_config.h:4:34: fatal error: postgis_svn_revision.h: No such
> file or directory
> 
> Don't know what it means.

It means that TOPDIR/postgis_svn_revision.h is required but such
requirement isn't properly encoded in doc/Makefile.
You can build it manually using (from within the doc/ dir):

 make -C .. postgis_svn_revision.h

I'll update the Makefile to do it automatically if you file a ticket for it.
Thanks !

--strk;

  ,--o-. 
  |   __/  |Delivering high quality PostGIS 2.0 !
  |  / 2.0 |http://strk.keybit.net - http://vizzuality.com
  `-o--'

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