[postgis-users] Census Block, other fields from Tiger Geocoder?

2011-10-07 Thread Daniel Weitzenfeld
I'm currently using this as my query:

SELECT g.*,
ST_X(geomout) As lon,
ST_Y(geomout) As lat, (addy).*
FROM geocode('') As g;

I'm wondering what other fields I can add to the SELECT.  E.g., can I get
census block?

I know one route is to use the lon/lat together with the shapefiles
themselves and use point-in-polygon, but that seems circuitous.

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


Re: [postgis-users] set nr of decimales without changing field type

2011-10-07 Thread Gery .


Thanks Puneet for the link, it worked like a charm.

@Sandro: also, I forgot to thank you, the link is very useful, although it'd be 
great if more examples could be added there.

Thanks guys, PostGis rocks.



> From: gameji...@hotmail.com
> To: postgis-users@postgis.refractions.net
> Subject: set nr of decimales without changing field type
> Date: Fri, 7 Oct 2011 16:33:05 +
>
>
>
> Hi,
>
> I'm calculating some distances and getting too many decimals, I just want 4 
> decimals, this is the code:
>
> UPDATE line SET length_km = st_length(st_transform(geom,32718))/1000 WHERE 
> id::int between 1 and 75;
>
> and the result is for example:
>
> 75.1634098489817
>
> Is it possible to set the number of decimals in the code above?
>
> Thanks,
>
  
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] set nr of decimales without changing field type

2011-10-07 Thread Puneet Kishor

On Oct 7, 2011, at 11:33 AM, Gery . wrote:

> 
> 
> Hi,
> 
> I'm calculating some distances and getting too many decimals, I just want 4 
> decimals, this is the code:
> 
> UPDATE line SET length_km = st_length(st_transform(geom,32718))/1000 WHERE 
> id::int between 1 and 75;
> 
> and the result is for example:
> 
> 75.1634098489817
> 
> Is it possible to set the number of decimals in the code above?
> 

http://sqlzoo.net/howto/source/u.cgi/tip177276/postgres


You will get more mileage in your work with PostGIS and Postgres the better you 
get at basic SQL. Good luck.

Puneet.

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


[postgis-users] set nr of decimales without changing field type

2011-10-07 Thread Gery .


Hi,

I'm calculating some distances and getting too many decimals, I just want 4 
decimals, this is the code:

UPDATE line SET length_km = st_length(st_transform(geom,32718))/1000 WHERE 
id::int between 1 and 75;

and the result is for example:

75.1634098489817

Is it possible to set the number of decimals in the code above?

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


Re: [postgis-users] Problems with the storage of raster data, raster2pgsql.py -errors

2011-10-07 Thread Pierre Racine
Did you check if, even with this error happening, the raster was loaded 
successfully? I remember having seen this a couple of time but the raster was 
loaded properly. It might be more like a warning than an error...

Pierre

> -Original Message-
> From: postgis-users-boun...@postgis.refractions.net [mailto:postgis-users-
> boun...@postgis.refractions.net] On Behalf Of torsten.d...@t-systems.com
> Sent: Friday, October 07, 2011 9:34 AM
> To: postgis-users@postgis.refractions.net
> Subject: [postgis-users] Problems with the storage of raster data,
> raster2pgsql.py -errors
> 
> Hi,
> 
> I'm new to this list and also rather new to the work with PostGIS , I used to 
> work
> with it a couple of years ago and started with it again 2 weeks ago.
> 
> Right now I'm experimenting a little bit with the possibilities to store 
> raster in
> PostGIS. I have a PostGIS 2.0 installation on top of PostgreSQL 9.1 (Running 
> on
> Centos 5.7).
> What I did is to register 8bit and 16bit GeoTiffs inside postgis, i.e. as 
> out-db
> raster. This works absolutely fine and when I publish this data via geoserver
> performance is extremely good!
> When I load and store 8bit data inside postgis everything works well, too. But
> when  I try to load 16bit (the same data which I could register as an out-db
> raster in postgis) data I get an error. The error actually already occurs 
> when I
> generate the SQL-file with raster2pgsql. When I execute:
> python raster2pgsql.py -r dem_pgin  -t public.dem_pgin -s 32632 -k 512x512 -F 
>  -
> I -o dem_pgin.sql
> 
> I get the following error:
> 
> Traceback (most recent call last):
>   File raster2pgsql.py, line 1040, in ?
> main()
>   File raster2pgsql.py, line 1003, in main
> gt = wkblify_raster(opts, filename.replace( '\', '/') , i, gt)
>   File raster2pgsql.py, line 945, in wkblify_raster
> summary = wkblify_raster_level(options, ds, options.overview_level,
> band_range, infile, i)
>   File raster2pgsql.py, line 905, in wkblify_raster_level
> hexwkb += wkblify_band(options, band, level, xoff, yoff, read_block_size,
> block_size, infile, b)
>   File raster2pgsql.py, line 825, in wkblify_band
> hexwkb = binascii.hexlify(out_pixels)
> TypeError: non-character (or 8-bit) array cannot be interpreted as character
> buffer
> 
> Is this a general issue with 16bit data or is it maybe an error in 
> raster2pgsql.py
> (From some searching it seems to be numpy issue)?
> 
> Any help is appreciated, Cheers
> 
> Torsten
> 
> --
> T-Systems International GmbH
> Torsten Drey
> Spezialist Geo-Consulting
> GeoServices/GIS
> Vorgebirgsstraße 49
> D-53119 Bonn
> 
> Fon: +49 (0)228 9841 3690
> Fax: +49 (0)228 9841 3990
> E-Mail: torsten.d...@t-systems.com 
> Internet: http://www.t-systems.com 
> 
> T-Systems International GmbH
> Aufsichtsrat: René Obermann (Vorsitzender)
> Geschäftsführung: Reinhard Clemens (Vorsitzender), Dr. Ferri Abolhassan, Olaf
> Heyden, Georg Pepping, Klaus Werner
> Handelsregister: Amtsgericht Frankfurt am Main HRB 55933 Sitz der
> Gesellschaft: Frankfurt am Main
> 
> Notice: This transmittal and/or attachments may be privileged or 
> confidential. If
> you are not the intended recipient, you are hereby notified that you have
> received this transmittal in error; any review, dissemination, or copying is 
> strictly
> prohibited. If you received this transmittal in error, please notify us 
> immediately
> by reply and immediately delete this message and all its attachments. Thank 
> you.
> 
> 
> 
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] Server not responding

2011-10-07 Thread Andy Colson

On 10/7/2011 4:32 AM, Andreas Forø Tollefsen wrote:

We will now try the python script again and terminate and open the
connection for each year in the for loop.
If this works, then it seems like there is a resource issue in
Postgresql or in one of the functions of postgis i think.
As i said. This worked without a problem before.

2011/10/7 Andreas Forø Tollefsen mailto:andrea...@gmail.com>>

Hi,
What i have done now is to try to run the query in PgAdmin SQL
windows instead of through the Python/Psycopg2 framework to see if
that was the problem.

This means one insert query for each year. I tried to run a limited
set with 10 annual insert queries and this worked. Then i tried the
rest of the years, and this never completed. Stopped the query. Then
trying with 3 years, it works. So there is a problem here with a
query that runs for a long time. It never finishes, and the cpu load
is still 100 %, but it never completes.


Did you wait forever?  No?  Then its just slow.  It will eventually 
finish if you let it.  But you don't want to wait that long, I 
understand.  My point being, fixing "slow" is different than fixing "it 
crashes".


> Could there be settings in postgresql.conf could cause this problem?

Yes.  But you didnt offer computer info, nor settings, so I cannot help 
you there.




As i wrote earlier, this query had no problem finishing on our
previous server.



What's different?  Saying it used to work doesnt really help anyone. 
How about you compare the two boxes, and their settings.


Reading this might help:

http://wiki.postgresql.org/wiki/Guide_to_reporting_problems

especially the "Server Configuration" link.



Here is my explain analyze for one year: http://explain.depesz.com/s/xRj



I notice the _st_intersects(b.geom, c.geom) takes a while.  Do you have 
complicated shapes (with lots of points)?  Have you thought of 
st_simplify?  You might loose a little accuracy, but it might speed up 
10 fold.  Just depends.


I also see a Materialize line, which I believe means its swapping out to 
disk.  (Which points at work_mem being too low).  If you have slow disk 
IO then that'll be even worse.


The GroupAggregate is just killing you, but I'm not sure what that step 
is actually doing.


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


[postgis-users] Problems with the storage of raster data, raster2pgsql.py -errors

2011-10-07 Thread Torsten.Drey
Hi,

I'm new to this list and also rather new to the work with PostGIS , I used to 
work with it a couple of years ago and started with it again 2 weeks ago.

Right now I'm experimenting a little bit with the possibilities to store raster 
in PostGIS. I have a PostGIS 2.0 installation on top of PostgreSQL 9.1 (Running 
on Centos 5.7).
What I did is to register 8bit and 16bit GeoTiffs inside postgis, i.e. as 
out-db raster. This works absolutely fine and when I publish this data via 
geoserver performance is extremely good!
When I load and store 8bit data inside postgis everything works well, too. But 
when  I try to load 16bit (the same data which I could register as an out-db 
raster in postgis) data I get an error. The error actually already occurs when 
I generate the SQL-file with raster2pgsql. When I execute:
python raster2pgsql.py -r dem_pgin  -t public.dem_pgin -s 32632 -k 512x512 -F  
-I -o dem_pgin.sql

I get the following error:

Traceback (most recent call last):
  File raster2pgsql.py, line 1040, in ?
main()
  File raster2pgsql.py, line 1003, in main
gt = wkblify_raster(opts, filename.replace( '\', '/') , i, gt)
  File raster2pgsql.py, line 945, in wkblify_raster
summary = wkblify_raster_level(options, ds, options.overview_level, 
band_range, infile, i)
  File raster2pgsql.py, line 905, in wkblify_raster_level
hexwkb += wkblify_band(options, band, level, xoff, yoff, read_block_size, 
block_size, infile, b)
  File raster2pgsql.py, line 825, in wkblify_band
hexwkb = binascii.hexlify(out_pixels)
TypeError: non-character (or 8-bit) array cannot be interpreted as character 
buffer

Is this a general issue with 16bit data or is it maybe an error in 
raster2pgsql.py (From some searching it seems to be numpy issue)?

Any help is appreciated, Cheers

Torsten

--
T-Systems International GmbH
Torsten Drey
Spezialist Geo-Consulting
GeoServices/GIS
Vorgebirgsstraße 49
D-53119 Bonn

Fon: +49 (0)228 9841 3690
Fax: +49 (0)228 9841 3990
E-Mail: torsten.d...@t-systems.com
Internet: http://www.t-systems.com

T-Systems International GmbH
Aufsichtsrat: René Obermann (Vorsitzender)
Geschäftsführung: Reinhard Clemens (Vorsitzender), Dr. Ferri Abolhassan,
Olaf Heyden, Georg Pepping, Klaus Werner
Handelsregister: Amtsgericht Frankfurt am Main HRB 55933
Sitz der Gesellschaft: Frankfurt am Main

Notice: This transmittal and/or attachments may be privileged or confidential. 
If you are not the intended recipient, you are hereby notified that you have 
received this transmittal in error; any review, dissemination, or copying is 
strictly prohibited. If you received this transmittal in error, please notify 
us immediately by reply and immediately delete this message and all its 
attachments. Thank you.



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


Re: [postgis-users] Problem with correlative ID after using INSERT INTO

2011-10-07 Thread Puneet Kishor



On Oct 7, 2011, at 6:39 AM, "Gery ."  wrote:

> 
> 
> Thanks Puneet, it's enough what I have now in the table, the scheme you 
> showed (a & b into table c) is actually what I did, but the order just in one 
> table (4000 rows) changed I dont know why.



Because, as I said in my earlier email, you can't rely on the db to store data 
the way you want. Generally, if you don't provide any ORDER BY, and if the 
table has a primary key, the data will come out ordered by the primary key 
(data in indexes are ordered, which is why the db is able to find your results 
quickly). So, remember -- don't worry too much about how the data go in. Keep 
your mind on how you want the data to come out. Make sure you have a column in 
your table that you can control, and use that to ORDER BY when you SELECT.

> The other table (50 rows) remained the same after being inserted in c. Both a 
> and b had their correlative IDs. Anyway, in order to update my table I just 
> order by id and know which one are the ones to be updated. Thanks.
> 
> 
> 
>> From: gameji...@hotmail.com
>> To: postgis-users@postgis.refractions.net
>> Subject: FW: Problem with correlative ID after using INSERT INTO
>> Date: Thu, 6 Oct 2011 20:07:56 +
>> 
>> 
>> 
>> Thanks Sandro, what means "You want to order at query time."? I did a simple 
>> "select * from both_lines order by id;" and worked perfectly, I was thinking 
>> about creating a new table, based on the headers of the both_line table and 
>> copy all the ordered values into this new table, but after reading for a 
>> while I noticed that the geometrycolumn information will be lost and adding 
>> the same into it can cause some problems.
>> 
>> 
>> 
>> 
>>> From: gameji...@hotmail.com
>>> To: postgis-users@postgis.refractions.net
>>> Subject: FW: Problem with correlative ID after using INSERT INTO
>>> Date: Thu, 6 Oct 2011 18:41:21 +
>>> 
>>> 
>>> 
>>> Thanks Paul, I put ORDER BY ID before Select and after it but didn't work. 
>>> Could you provide me please an example based on the code below?
>>> 
>>> INSERT INTO both_lines (ID, SURVEY, PROFILE, TYPE, SOURCE, LENGTH_KM, 
>>> LENGTH_NM, COMMENTS, GEOM)
>>> SELECT ID, SURVEY, PROFILE, TYPE, SOURCE, LENGTH_KM, LENGTH_NM, COMMENTS, 
>>> GEOM FROM line;
>>> 
>>> Thanks,
>>> 
>>> 
>>> 
 From: gameji...@hotmail.com
 To: postgis-users@postgis.refractions.net
 Subject: Problem with correlative ID after using INSERT INTO
 Date: Thu, 6 Oct 2011 12:17:54 +
 
 
 
 Hello,
 
 I'm trying to get a table, composed of other two tables, but the 
 correlative ID of one of them changes, it "jumps", this is what happens:
 
 **
 id | name
 ...
 34 | 79-051
 35 | 79-052
 52 | 79-076
 214 | 96-008A
 215 | | 96-009
 36 | 79-053
 37 | 79-055
 
 
 
 this shape was inserted as follows:
 
 shp2pgsql -s 4326 -W UTF-8 -g geom -I -D /home/postgres/shp/line/line.shp 
 | psql -U postgres -d mydb
 
 after checking it in my db, it looks like:
 
 **
 ...
 34 | 79-051
 35 | 79-052
 36 | 79-053
 37 | 79-055
 ...
 **
 
 this is the part of the code I used to insert this table:
 
 INSERT INTO both_lines (ID, SURVEY, PROFILE, TYPE, SOURCE, LENGTH_KM, 
 LENGTH_NM, COMMENTS, GEOM)
 SELECT ID, SURVEY, PROFILE, TYPE, SOURCE, LENGTH_KM, LENGTH_NM, COMMENTS, 
 GEOM FROM line;
 
 I tried adding "ORDER BY ID" at the end of the second line (after "line") 
 but didn't work.
 
 Any suggestions are very welcome, thanks in advance,
 
 Gery
 
>>> 
>> 
> 
> ___
> 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] Trouble with shp2pgsql-gui?

2011-10-07 Thread Mark Cave-Ayland

On 05/10/11 14:09, MarkW wrote:


John - SET CLIENT is the beginning of a larger SQL statement. The
error says the SQL statement failed, "...sql begins:"
and then later down the error dump indicates a connectivity issue -
which you later identified as the probable cause.
So it is not saying the encoding is the failure, just that that was
first line in SQL block submitted to pg server.

Mark


Yes, that's correct. Did you check your connection using the conncetion 
test button before trying to load your data?


If the connection test succeeds but the header SQL doesn't, perhaps 
you're trying to load the data into a database that isn't PostGIS enabled?



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] Update table based on identical rows but in one call

2011-10-07 Thread Sandro Santilli
On Fri, Oct 07, 2011 at 12:05:30PM +, Gery . wrote:

> where I can find the notation you used to solve this problem? 

http://www.postgresql.org/docs/

--strk; 

  ()   Free GIS & Flash consultant/developer
  /\   http://strk.keybit.net/services.html
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] Update table based on identical rows but in one call

2011-10-07 Thread Gery .


Thanks Nicolas, it worked perfectly, and yes, my IDs are INT, I just put the 
quotes (' ') because I saw that in some examples, btw, where I can find the 
notation you used to solve this 
problem? I was looking for something like that I didnt find anything like that, 
also, I'm not receiving the answers to my posts by email, I just saw them in 
the postgis-user forum website, is there something wrong with it? I edited two 
times my options and nothing, this website should have also the possibility to 
post there, something like a quick answer link.

Thanks again.



> From: gameji...@hotmail.com
> To: postgis-users@postgis.refractions.net
> Subject: Update table based on identical rows but in one call
> Date: Fri, 7 Oct 2011 11:43:17 +
>
>
>
> Hi,
>
> I'm trying to update several rows of my table just with one call, based e.g., 
> in the number of ID. For that I would like to do something like the following:
>
> UPDATE line SET survey = 'GT', type = 'MR', source = 'TY' WHERE id = '5' TO 
> id = '15';
>
> I know this doesnt work, it's just to ask if there is a way of doing this in 
> this way, just with one call.
>
> Thanks for any suggestions,
>
>
  
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] Update table based on identical rows but in one call

2011-10-07 Thread Nicolas Ribot
> Hi,
>
> I'm trying to update several rows of my table just with one call, based e.g., 
> in the number of ID. For that I would like to do something like the following:
>
> UPDATE line SET survey = 'GT', type = 'MR', source = 'TY' WHERE id = '5' TO 
> id = '15';
>
> I know this doesnt work, it's just to ask if there is a way of doing this in 
> this way, just with one call.
>
> Thanks for any suggestions,
>

Hi,

The construct "WHERE id = '5' TO id = '15'" is meant to get a range of IDs?
If it is the case, then use the "between" operator

(Strangely, your ids seem to be strings. It won't be easy to order
them based on natural order. If ids are really numbers, you should
store them as numbers (faster to index, easier to work with))

UPDATE line SET survey = 'GT', type = 'MR', source = 'TY' WHERE
id::int between 5 and 15;

Though you should check the cast is ok in this case.

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


[postgis-users] Update table based on identical rows but in one call

2011-10-07 Thread Gery .


Hi,

I'm trying to update several rows of my table just with one call, based e.g., 
in the number of ID. For that I would like to do something like the following:

UPDATE line SET survey = 'GT', type = 'MR', source = 'TY' WHERE id = '5' TO id 
= '15';

I know this doesnt work, it's just to ask if there is a way of doing this in 
this way, just with one call.

Thanks for any suggestions,

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


Re: [postgis-users] Problem with correlative ID after using INSERT INTO

2011-10-07 Thread Gery .


Thanks Puneet, it's enough what I have now in the table, the scheme you showed 
(a & b into table c) is actually what I did, but the order just in one table 
(4000 rows) changed I dont know why. The other table (50 rows) remained the 
same after being inserted in c. Both a and b had their correlative IDs. Anyway, 
in order to update my table I just order by id and know which one are the ones 
to be updated. Thanks.



> From: gameji...@hotmail.com
> To: postgis-users@postgis.refractions.net
> Subject: FW: Problem with correlative ID after using INSERT INTO
> Date: Thu, 6 Oct 2011 20:07:56 +
>
>
>
> Thanks Sandro, what means "You want to order at query time."? I did a simple 
> "select * from both_lines order by id;" and worked perfectly, I was thinking 
> about creating a new table, based on the headers of the both_line table and 
> copy all the ordered values into this new table, but after reading for a 
> while I noticed that the geometrycolumn information will be lost and adding 
> the same into it can cause some problems.
>
>
>
> 
> > From: gameji...@hotmail.com
> > To: postgis-users@postgis.refractions.net
> > Subject: FW: Problem with correlative ID after using INSERT INTO
> > Date: Thu, 6 Oct 2011 18:41:21 +
> >
> >
> >
> > Thanks Paul, I put ORDER BY ID before Select and after it but didn't work. 
> > Could you provide me please an example based on the code below?
> >
> > INSERT INTO both_lines (ID, SURVEY, PROFILE, TYPE, SOURCE, LENGTH_KM, 
> > LENGTH_NM, COMMENTS, GEOM)
> > SELECT ID, SURVEY, PROFILE, TYPE, SOURCE, LENGTH_KM, LENGTH_NM, COMMENTS, 
> > GEOM FROM line;
> >
> > Thanks,
> >
> >
> > 
> > > From: gameji...@hotmail.com
> > > To: postgis-users@postgis.refractions.net
> > > Subject: Problem with correlative ID after using INSERT INTO
> > > Date: Thu, 6 Oct 2011 12:17:54 +
> > >
> > >
> > >
> > > Hello,
> > >
> > > I'm trying to get a table, composed of other two tables, but the 
> > > correlative ID of one of them changes, it "jumps", this is what happens:
> > >
> > > **
> > > id | name
> > > ...
> > > 34 | 79-051
> > > 35 | 79-052
> > > 52 | 79-076
> > > 214 | 96-008A
> > > 215 | | 96-009
> > > 36 | 79-053
> > > 37 | 79-055
> > > 
> > > 
> > >
> > > this shape was inserted as follows:
> > >
> > > shp2pgsql -s 4326 -W UTF-8 -g geom -I -D /home/postgres/shp/line/line.shp 
> > > | psql -U postgres -d mydb
> > >
> > > after checking it in my db, it looks like:
> > >
> > > **
> > > ...
> > > 34 | 79-051
> > > 35 | 79-052
> > > 36 | 79-053
> > > 37 | 79-055
> > > ...
> > > **
> > >
> > > this is the part of the code I used to insert this table:
> > >
> > > INSERT INTO both_lines (ID, SURVEY, PROFILE, TYPE, SOURCE, LENGTH_KM, 
> > > LENGTH_NM, COMMENTS, GEOM)
> > > SELECT ID, SURVEY, PROFILE, TYPE, SOURCE, LENGTH_KM, LENGTH_NM, COMMENTS, 
> > > GEOM FROM line;
> > >
> > > I tried adding "ORDER BY ID" at the end of the second line (after "line") 
> > > but didn't work.
> > >
> > > Any suggestions are very welcome, thanks in advance,
> > >
> > > Gery
> > >
> >
>
  
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] Need Help :How to Install PostGIS Raster

2011-10-07 Thread wendiadriansaga
Hi Sandro,

Since I am newbie in open source GIS so I have no experience in writing 
scripts. :)
Yes, it will be great if there are other geologist which use these open source 
GIS software.
Ok, I will try gvSIG.
Thanks.

Regards,

Wendi A
Powered by Telkomsel BlackBerry®

-Original Message-
From: Sandro Santilli 
Sender: Sandro Santilli 
Date: Fri, 7 Oct 2011 12:18:03 
To: 
Cc: PostGIS Users Discussion
Subject: Re: [postgis-users] Need Help :How to Install PostGIS Raster

On Fri, Oct 07, 2011 at 09:39:58AM +, wendiadrians...@yahoo.com wrote:

> I prefer to use MapInfo because it supports more on my activities,
> mainly on geological study.
> I have tried Quantum GIS, but it does not meet my needs. 

Quantum GIS has a powerful plugin-based architecture, allowing you
to search/download plugins at runtime. Chances are there's one for you,
but you can also write your own, or have it written by somebody
(I see mapinfo license costs around 1.5k USD...).

Freely sharing effort with other geologists would give you the best.
Just an hint...

--strk;

  ()   Free GIS & Flash consultant/developer
  /\   http://strk.keybit.net/services.html
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] Need Help :How to Install PostGIS Raster

2011-10-07 Thread Paolo Cavallini
Il 07/10/2011 12:18, Sandro Santilli ha scritto:
> On Fri, Oct 07, 2011 at 09:39:58AM +, wendiadrians...@yahoo.com wrote:
> 
>> I prefer to use MapInfo because it supports more on my activities,
>> mainly on geological study.
>> I have tried Quantum GIS, but it does not meet my needs. 
> 
> Quantum GIS has a powerful plugin-based architecture, allowing you
> to search/download plugins at runtime. Chances are there's one for you,
> but you can also write your own, or have it written by somebody
> (I see mapinfo license costs around 1.5k USD...).

We are getting badly OT here, but can you tell us exactly what is missing?
Thanks.

-- 
Paolo Cavallini - Faunalia
www.faunalia.eu
Full contact details at www.faunalia.eu/pc
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] Need Help :How to Install PostGIS Raster

2011-10-07 Thread Sandro Santilli
On Fri, Oct 07, 2011 at 09:39:58AM +, wendiadrians...@yahoo.com wrote:

> I prefer to use MapInfo because it supports more on my activities,
> mainly on geological study.
> I have tried Quantum GIS, but it does not meet my needs. 

Quantum GIS has a powerful plugin-based architecture, allowing you
to search/download plugins at runtime. Chances are there's one for you,
but you can also write your own, or have it written by somebody
(I see mapinfo license costs around 1.5k USD...).

Freely sharing effort with other geologists would give you the best.
Just an hint...

--strk;

  ()   Free GIS & Flash consultant/developer
  /\   http://strk.keybit.net/services.html
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] Need Help :How to Install PostGIS Raster

2011-10-07 Thread wendiadriansaga
Hi Jorge,

I haven't try gvSIG, maybe I can do it.
Thanks for advice.

Regards,

Wendi
Powered by Telkomsel BlackBerry®

-Original Message-
From: Jorge Arévalo 
Date: Fri, 7 Oct 2011 11:57:26 
To: ; PostGIS Users 
Discussion
Cc: Sandro Santilli; Sandro Santilli
Subject: Re: [postgis-users] Need Help :How to Install PostGIS Raster

And what about gvSIG?

On Fri, Oct 7, 2011 at 11:39 AM,   wrote:
> Hi Sandro,
>
> Thanks for your comments.
> Yes, I prefer to use MapInfo because it supports more on my activities, 
> mainly on geological study.
> I have tried Quantum GIS, but it does not meet my needs. That is the reason.
>
> Regards,
>
> Wendi
>
>
>
> Powered by Telkomsel BlackBerry®
>
> -Original Message-
> From: Sandro Santilli 
> Sender: Sandro Santilli 
> Date: Fri, 7 Oct 2011 11:16:29
> To: ; PostGIS Users 
> Discussion
> Subject: Re: [postgis-users] Need Help :How to Install PostGIS Raster
>
> On Fri, Oct 07, 2011 at 08:13:43AM +, wendiadrians...@yahoo.com wrote:
>
>> For your information, I am going to use MapInfo as GIS Engine.
>> Is PostGIS v2.0 compatible with MapInfo?
>
> PostGIS is lower level, so the correct question is:
> "Is MapInfo® compatible with PostGIS v2.0 ?"
>
> Beside, why would you want to use MapInfo® ?
> Did you try QuantumGIS [1] ?
>
> [1] http://qgis.org/
>
> --strk;
>
>  ()   Free GIS & Flash consultant/developer
>  /\   http://strk.keybit.net/services.html
> ___
> postgis-users mailing list
> postgis-users@postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>



-- 
Jorge Arévalo
Internet & Mobility Division, DEIMOS
jorge.arev...@deimos-space.com
http://es.linkedin.com/in/jorgearevalo80
http://mobility.grupodeimos.com/
http://gis4free.wordpress.com
http://geohash.org/ezjqgrgzz0g
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] Need Help :How to Install PostGIS Raster

2011-10-07 Thread Jorge Arévalo
And what about gvSIG?

On Fri, Oct 7, 2011 at 11:39 AM,   wrote:
> Hi Sandro,
>
> Thanks for your comments.
> Yes, I prefer to use MapInfo because it supports more on my activities, 
> mainly on geological study.
> I have tried Quantum GIS, but it does not meet my needs. That is the reason.
>
> Regards,
>
> Wendi
>
>
>
> Powered by Telkomsel BlackBerry®
>
> -Original Message-
> From: Sandro Santilli 
> Sender: Sandro Santilli 
> Date: Fri, 7 Oct 2011 11:16:29
> To: ; PostGIS Users 
> Discussion
> Subject: Re: [postgis-users] Need Help :How to Install PostGIS Raster
>
> On Fri, Oct 07, 2011 at 08:13:43AM +, wendiadrians...@yahoo.com wrote:
>
>> For your information, I am going to use MapInfo as GIS Engine.
>> Is PostGIS v2.0 compatible with MapInfo?
>
> PostGIS is lower level, so the correct question is:
> "Is MapInfo® compatible with PostGIS v2.0 ?"
>
> Beside, why would you want to use MapInfo® ?
> Did you try QuantumGIS [1] ?
>
> [1] http://qgis.org/
>
> --strk;
>
>  ()   Free GIS & Flash consultant/developer
>  /\   http://strk.keybit.net/services.html
> ___
> postgis-users mailing list
> postgis-users@postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>



-- 
Jorge Arévalo
Internet & Mobility Division, DEIMOS
jorge.arev...@deimos-space.com
http://es.linkedin.com/in/jorgearevalo80
http://mobility.grupodeimos.com/
http://gis4free.wordpress.com
http://geohash.org/ezjqgrgzz0g
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] Need Help :How to Install PostGIS Raster

2011-10-07 Thread wendiadriansaga
Hi Sandro,

Thanks for your comments.
Yes, I prefer to use MapInfo because it supports more on my activities, mainly 
on geological study.
I have tried Quantum GIS, but it does not meet my needs. That is the reason.

Regards,

Wendi 



Powered by Telkomsel BlackBerry®

-Original Message-
From: Sandro Santilli 
Sender: Sandro Santilli 
Date: Fri, 7 Oct 2011 11:16:29 
To: ; PostGIS Users 
Discussion
Subject: Re: [postgis-users] Need Help :How to Install PostGIS Raster

On Fri, Oct 07, 2011 at 08:13:43AM +, wendiadrians...@yahoo.com wrote:

> For your information, I am going to use MapInfo as GIS Engine.
> Is PostGIS v2.0 compatible with MapInfo?

PostGIS is lower level, so the correct question is:
"Is MapInfo® compatible with PostGIS v2.0 ?"

Beside, why would you want to use MapInfo® ? 
Did you try QuantumGIS [1] ?

[1] http://qgis.org/

--strk; 

  ()   Free GIS & Flash consultant/developer
  /\   http://strk.keybit.net/services.html
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] Server not responding

2011-10-07 Thread Andreas Forø Tollefsen
We will now try the python script again and terminate and open the
connection for each year in the for loop.
If this works, then it seems like there is a resource issue in Postgresql or
in one of the functions of postgis i think.
As i said. This worked without a problem before.

2011/10/7 Andreas Forø Tollefsen 

> Hi,
> What i have done now is to try to run the query in PgAdmin SQL windows
> instead of through the Python/Psycopg2 framework to see if that was the
> problem.
>
> This means one insert query for each year. I tried to run a limited set
> with 10 annual insert queries and this worked. Then i tried the rest of the
> years, and this never completed. Stopped the query. Then trying with 3
> years, it works. So there is a problem here with a query that runs for a
> long time. It never finishes, and the cpu load is still 100 %, but it never
> completes.
> Could there be settings in postgresql.conf could cause this problem? As i
> wrote earlier, this query had no problem finishing on our previous server.
>
> Here is my explain analyze for one year: http://explain.depesz.com/s/xRj
>
> The complete query is now:
>
> DROP TABLE IF EXISTS priogridall_geom;
> SELECT priogridall.*, priogrid.cell, priogrid.centroid INTO
> priogridall_geom from priogridall
> LEFT JOIN priogrid ON priogridall.gid = priogrid.gid;
>
> CREATE INDEX idx_priogrid_geom ON priogridall_geom USING GIST(centroid);
> CREATE INDEX idx_priogrid_gid ON priogridall_geom USING btree(gid, gwcode,
> col, row, area);
> DROP TABLE IF EXISTS borddist;
> CREATE TABLE borddist(gid int, gwcode int, gridyear int, borddist decimal,
> primary key(gid, gridyear));
>
> INSERT INTO borddist(gid, gwcode, gridyear, borddist) SELECT a.gid,
> a.gwcode, 1946, MIN(ST_Distance(a.centroid, b.geom)) FROM priogridall_geom
> a, cshapes b, cshapes c WHERE a.gwcode != b.gwcode AND b.gwsyear <= 1946 AND
> b.gweyear >= 1946 AND a.gwcode = c.gwcode and ST_Intersects(b.geom, c.geom)
> AND a.gridyear = 1946 GROUP BY a.gid, a.gwcode;
> INSERT INTO borddist(gid, gwcode, gridyear, borddist) SELECT a.gid,
> a.gwcode, 1947, MIN(ST_Distance(a.centroid, b.geom)) FROM priogridall_geom
> a, cshapes b, cshapes c WHERE a.gwcode != b.gwcode AND b.gwsyear <= 1947 AND
> b.gweyear >= 1947 AND a.gwcode = c.gwcode and ST_Intersects(b.geom, c.geom)
> AND a.gridyear = 1947 GROUP BY a.gid, a.gwcode;
> INSERT INTO borddist(gid, gwcode, gridyear, borddist) SELECT a.gid,
> a.gwcode, 1948, MIN(ST_Distance(a.centroid, b.geom)) FROM priogridall_geom
> a, cshapes b, cshapes c WHERE a.gwcode != b.gwcode AND b.gwsyear <= 1948 AND
> b.gweyear >= 1948 AND a.gwcode = c.gwcode and ST_Intersects(b.geom, c.geom)
> AND a.gridyear = 1948 GROUP BY a.gid, a.gwcode;
> INSERT INTO borddist(gid, gwcode, gridyear, borddist) SELECT a.gid,
> a.gwcode, 1949, MIN(ST_Distance(a.centroid, b.geom)) FROM priogridall_geom
> a, cshapes b, cshapes c WHERE a.gwcode != b.gwcode AND b.gwsyear <= 1949 AND
> b.gweyear >= 1949 AND a.gwcode = c.gwcode and ST_Intersects(b.geom, c.geom)
> AND a.gridyear = 1949 GROUP BY a.gid, a.gwcode;
> INSERT INTO borddist(gid, gwcode, gridyear, borddist) SELECT a.gid,
> a.gwcode, 1950, MIN(ST_Distance(a.centroid, b.geom)) FROM priogridall_geom
> a, cshapes b, cshapes c WHERE a.gwcode != b.gwcode AND b.gwsyear <= 1950 AND
> b.gweyear >= 1950 AND a.gwcode = c.gwcode and ST_Intersects(b.geom, c.geom)
> AND a.gridyear = 1950 GROUP BY a.gid, a.gwcode;
> INSERT INTO borddist(gid, gwcode, gridyear, borddist) SELECT a.gid,
> a.gwcode, 1951, MIN(ST_Distance(a.centroid, b.geom)) FROM priogridall_geom
> a, cshapes b, cshapes c WHERE a.gwcode != b.gwcode AND b.gwsyear <= 1951 AND
> b.gweyear >= 1951 AND a.gwcode = c.gwcode and ST_Intersects(b.geom, c.geom)
> AND a.gridyear = 1951 GROUP BY a.gid, a.gwcode;
> INSERT INTO borddist(gid, gwcode, gridyear, borddist) SELECT a.gid,
> a.gwcode, 1952, MIN(ST_Distance(a.centroid, b.geom)) FROM priogridall_geom
> a, cshapes b, cshapes c WHERE a.gwcode != b.gwcode AND b.gwsyear <= 1952 AND
> b.gweyear >= 1952 AND a.gwcode = c.gwcode and ST_Intersects(b.geom, c.geom)
> AND a.gridyear = 1952 GROUP BY a.gid, a.gwcode;
> INSERT INTO borddist(gid, gwcode, gridyear, borddist) SELECT a.gid,
> a.gwcode, 1953, MIN(ST_Distance(a.centroid, b.geom)) FROM priogridall_geom
> a, cshapes b, cshapes c WHERE a.gwcode != b.gwcode AND b.gwsyear <= 1953 AND
> b.gweyear >= 1953 AND a.gwcode = c.gwcode and ST_Intersects(b.geom, c.geom)
> AND a.gridyear = 1953 GROUP BY a.gid, a.gwcode;
> INSERT INTO borddist(gid, gwcode, gridyear, borddist) SELECT a.gid,
> a.gwcode, 1954, MIN(ST_Distance(a.centroid, b.geom)) FROM priogridall_geom
> a, cshapes b, cshapes c WHERE a.gwcode != b.gwcode AND b.gwsyear <= 1954 AND
> b.gweyear >= 1954 AND a.gwcode = c.gwcode and ST_Intersects(b.geom, c.geom)
> AND a.gridyear = 1954 GROUP BY a.gid, a.gwcode;
> INSERT INTO borddist(gid, gwcode, gridyear, borddist) SELECT a.gid,
> a.gwcode, 1955, MIN(ST_Distance(a.centroid, b.geom)) FROM priogridall_geom
> a, cshapes b, csha

Re: [postgis-users] Need Help :How to Install PostGIS Raster

2011-10-07 Thread Sandro Santilli
On Fri, Oct 07, 2011 at 08:13:43AM +, wendiadrians...@yahoo.com wrote:

> For your information, I am going to use MapInfo as GIS Engine.
> Is PostGIS v2.0 compatible with MapInfo?

PostGIS is lower level, so the correct question is:
"Is MapInfo® compatible with PostGIS v2.0 ?"

Beside, why would you want to use MapInfo® ? 
Did you try QuantumGIS [1] ?

[1] http://qgis.org/

--strk; 

  ()   Free GIS & Flash consultant/developer
  /\   http://strk.keybit.net/services.html
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] Need Help :How to Install PostGIS Raster

2011-10-07 Thread wendiadriansaga
Hi Jorge,

Thanks for your information. This is very useful.
I will try on my laptop.
For your information, I am going to use MapInfo as GIS Engine. Is PostGIS v2.0 
compatible with MapInfo?
Regards,

Wendi A

Powered by Telkomsel BlackBerry®

-Original Message-
From: Jorge Arévalo 
Date: Fri, 7 Oct 2011 10:05:23 
To: Wendi Adrian
Cc: PostGIS Users Discussion
Subject: Re: [postgis-users] Need Help :How to Install PostGIS Raster

Hi Wendi,

I've updated the post. Please install the GDAL Python bindings
separately. Download the installer from
http://vbkto.dyndns.org/sdk/Download.aspx?file=release-1310-gdal-1-8-mapserver-5-6%5CGDAL-1.8.0.win32-py2.7.msi

Or you can use any of the executables at
http://www.lfd.uci.edu/~gohlke/pythonlibs/

Best regards,
Jorge

2011/10/6 Wendi Adrian :
> Hi Jorge,
> thanks for your response.
> I have follow your instructions, i.e :
> 1) install Python (I use Python v.2.7) and numpy-MKL-1.6.1.win32-py2.7
> 2) install GDAL library. I use gdal-18-1310-core.msi to get GDAL library.
> After I have installed it nad go through C:\Program Files\GDAL directory, I
> can not find python. I thought that the environment has not been binded yet.
> maybe the problem is here.
> Can you let me know how to build binding between GDAL and python? I try it
> several times but failed.
> Thanks.
> Regards,
> Wendi
>
>
> 
> From: Jorge Arévalo 
> To: Wendi Adrian ; PostGIS Users Discussion
> 
> Sent: Thursday, October 6, 2011 3:18 PM
> Subject: Re: [postgis-users] Need Help :How to Install PostGIS Raster
>
> On Thu, Oct 6, 2011 at 2:55 AM, Wendi Adrian 
> wrote:
>> Dear all,
>> it is great for me to join with you in PostGIS user milist. :)
>> I need your advices, maybe some of you have found same problems with me.
>> I have installed PostgreSQL v.9.0 and want to install PostGIS v.2.0 which
>> I
>> have download from Postgis website. The files was called postgis-2.0.0
>> SVN.
>> This supports PostGIS Raster database based on documentation I found.
>> I try to install it, but always find errors which can described as follow
>> ;
>> 1) I use command prompt to run makepostgisdb.bat but I adapt environmental
>> variables in windows according to parameters.
>> 2) when I run it, I get notification "operation aborted...transaction
>> block"
>> 3) I rename libiconv-2.dll in Postgresql/8.4/bin folder to any other name.
>> This according to article on
>>
>> http://gis4free.wordpress.com/2011/03/10/how-to-install-and-configure-postgis-raster-on-windows.
>> 4) But when I run makepostgisdb.bat again, I found another errors "can't
>> find libiconv-2.dllplease re-install"
>> Do anyone can help me with this?
>> Thank you.
>> Regards,
>>
>> Wendi A
>> ___
>> postgis-users mailing list
>> postgis-users@postgis.refractions.net
>> http://postgis.refractions.net/mailman/listinfo/postgis-users
>>
>>
>
> Hello,
>
> Renaming the dll file was a solution suggested by a Windows XP SP2
> user. Are you in the same situation? I didn't need to do that using
> Windows 7.
>
> About the execution of the bat file, could you please send us the
> output? Did you experiment any other problems following the previous
> steps?
>
> I've responded you in the blog post too. But we can keep the question
> in the list (it has a wider audience)
>
> --
> Jorge Arévalo
> Internet & Mobility Division, DEIMOS
> jorge.arev...@deimos-space.com
> http://es.linkedin.com/in/jorgearevalo80
> http://mobility.grupodeimos.com/
> http://gis4free.wordpress.com
> http://geohash.org/ezjqgrgzz0g
>
>
>



-- 
Jorge Arévalo
Internet & Mobility Division, DEIMOS
jorge.arev...@deimos-space.com
http://es.linkedin.com/in/jorgearevalo80
http://mobility.grupodeimos.com/
http://gis4free.wordpress.com
http://geohash.org/ezjqgrgzz0g
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] Need Help :How to Install PostGIS Raster

2011-10-07 Thread Jorge Arévalo
Hi Wendi,

"mercator" is the name of one of my machines. In the PgAdmin GUI tree
you can see your defined connections. I have 3 connections defined.
When you define your own connections, you'll see them at same place.

Best regards,
Jorge

2011/10/7  :
> Hi Jorge,
>
> Can you let me know how to make Mercator and PostGIS Raster appear on PgAdmin 
> tree on GUI? Because they are not appear on my PgAdmin III.
> Please help me.
> Thanks.
>
> Regards,
>
> Wendi A
> Powered by Telkomsel BlackBerry®
>
> -Original Message-
> From: Jorge Arévalo 
> Date: Thu, 6 Oct 2011 10:18:27
> To: Wendi Adrian; PostGIS Users 
> Discussion
> Subject: Re: [postgis-users] Need Help :How to Install PostGIS Raster
>
> On Thu, Oct 6, 2011 at 2:55 AM, Wendi Adrian  
> wrote:
>> Dear all,
>> it is great for me to join with you in PostGIS user milist. :)
>> I need your advices, maybe some of you have found same problems with me.
>> I have installed PostgreSQL v.9.0 and want to install PostGIS v.2.0 which I
>> have download from Postgis website. The files was called postgis-2.0.0 SVN.
>> This supports PostGIS Raster database based on documentation I found.
>> I try to install it, but always find errors which can described as follow ;
>> 1) I use command prompt to run makepostgisdb.bat but I adapt environmental
>> variables in windows according to parameters.
>> 2) when I run it, I get notification "operation aborted...transaction block"
>> 3) I rename libiconv-2.dll in Postgresql/8.4/bin folder to any other name.
>> This according to article on
>> http://gis4free.wordpress.com/2011/03/10/how-to-install-and-configure-postgis-raster-on-windows.
>> 4) But when I run makepostgisdb.bat again, I found another errors "can't
>> find libiconv-2.dllplease re-install"
>> Do anyone can help me with this?
>> Thank you.
>> Regards,
>>
>> Wendi A
>> ___
>> postgis-users mailing list
>> postgis-users@postgis.refractions.net
>> http://postgis.refractions.net/mailman/listinfo/postgis-users
>>
>>
>
> Hello,
>
> Renaming the dll file was a solution suggested by a Windows XP SP2
> user. Are you in the same situation? I didn't need to do that using
> Windows 7.
>
> About the execution of the bat file, could you please send us the
> output? Did you experiment any other problems following the previous
> steps?
>
> I've responded you in the blog post too. But we can keep the question
> in the list (it has a wider audience)
>
> --
> Jorge Arévalo
> Internet & Mobility Division, DEIMOS
> jorge.arev...@deimos-space.com
> http://es.linkedin.com/in/jorgearevalo80
> http://mobility.grupodeimos.com/
> http://gis4free.wordpress.com
> http://geohash.org/ezjqgrgzz0g
>



-- 
Jorge Arévalo
Internet & Mobility Division, DEIMOS
jorge.arev...@deimos-space.com
http://es.linkedin.com/in/jorgearevalo80
http://mobility.grupodeimos.com/
http://gis4free.wordpress.com
http://geohash.org/ezjqgrgzz0g
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] Need Help :How to Install PostGIS Raster

2011-10-07 Thread Jorge Arévalo
Hi Wendi,

I've updated the post. Please install the GDAL Python bindings
separately. Download the installer from
http://vbkto.dyndns.org/sdk/Download.aspx?file=release-1310-gdal-1-8-mapserver-5-6%5CGDAL-1.8.0.win32-py2.7.msi

Or you can use any of the executables at
http://www.lfd.uci.edu/~gohlke/pythonlibs/

Best regards,
Jorge

2011/10/6 Wendi Adrian :
> Hi Jorge,
> thanks for your response.
> I have follow your instructions, i.e :
> 1) install Python (I use Python v.2.7) and numpy-MKL-1.6.1.win32-py2.7
> 2) install GDAL library. I use gdal-18-1310-core.msi to get GDAL library.
> After I have installed it nad go through C:\Program Files\GDAL directory, I
> can not find python. I thought that the environment has not been binded yet.
> maybe the problem is here.
> Can you let me know how to build binding between GDAL and python? I try it
> several times but failed.
> Thanks.
> Regards,
> Wendi
>
>
> 
> From: Jorge Arévalo 
> To: Wendi Adrian ; PostGIS Users Discussion
> 
> Sent: Thursday, October 6, 2011 3:18 PM
> Subject: Re: [postgis-users] Need Help :How to Install PostGIS Raster
>
> On Thu, Oct 6, 2011 at 2:55 AM, Wendi Adrian 
> wrote:
>> Dear all,
>> it is great for me to join with you in PostGIS user milist. :)
>> I need your advices, maybe some of you have found same problems with me.
>> I have installed PostgreSQL v.9.0 and want to install PostGIS v.2.0 which
>> I
>> have download from Postgis website. The files was called postgis-2.0.0
>> SVN.
>> This supports PostGIS Raster database based on documentation I found.
>> I try to install it, but always find errors which can described as follow
>> ;
>> 1) I use command prompt to run makepostgisdb.bat but I adapt environmental
>> variables in windows according to parameters.
>> 2) when I run it, I get notification "operation aborted...transaction
>> block"
>> 3) I rename libiconv-2.dll in Postgresql/8.4/bin folder to any other name.
>> This according to article on
>>
>> http://gis4free.wordpress.com/2011/03/10/how-to-install-and-configure-postgis-raster-on-windows.
>> 4) But when I run makepostgisdb.bat again, I found another errors "can't
>> find libiconv-2.dllplease re-install"
>> Do anyone can help me with this?
>> Thank you.
>> Regards,
>>
>> Wendi A
>> ___
>> postgis-users mailing list
>> postgis-users@postgis.refractions.net
>> http://postgis.refractions.net/mailman/listinfo/postgis-users
>>
>>
>
> Hello,
>
> Renaming the dll file was a solution suggested by a Windows XP SP2
> user. Are you in the same situation? I didn't need to do that using
> Windows 7.
>
> About the execution of the bat file, could you please send us the
> output? Did you experiment any other problems following the previous
> steps?
>
> I've responded you in the blog post too. But we can keep the question
> in the list (it has a wider audience)
>
> --
> Jorge Arévalo
> Internet & Mobility Division, DEIMOS
> jorge.arev...@deimos-space.com
> http://es.linkedin.com/in/jorgearevalo80
> http://mobility.grupodeimos.com/
> http://gis4free.wordpress.com
> http://geohash.org/ezjqgrgzz0g
>
>
>



-- 
Jorge Arévalo
Internet & Mobility Division, DEIMOS
jorge.arev...@deimos-space.com
http://es.linkedin.com/in/jorgearevalo80
http://mobility.grupodeimos.com/
http://gis4free.wordpress.com
http://geohash.org/ezjqgrgzz0g
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] Server not responding

2011-10-07 Thread Andreas Forø Tollefsen
Hi,
What i have done now is to try to run the query in PgAdmin SQL windows
instead of through the Python/Psycopg2 framework to see if that was the
problem.

This means one insert query for each year. I tried to run a limited set with
10 annual insert queries and this worked. Then i tried the rest of the
years, and this never completed. Stopped the query. Then trying with 3
years, it works. So there is a problem here with a query that runs for a
long time. It never finishes, and the cpu load is still 100 %, but it never
completes.
Could there be settings in postgresql.conf could cause this problem? As i
wrote earlier, this query had no problem finishing on our previous server.

Here is my explain analyze for one year: http://explain.depesz.com/s/xRj

The complete query is now:

DROP TABLE IF EXISTS priogridall_geom;
SELECT priogridall.*, priogrid.cell, priogrid.centroid INTO priogridall_geom
from priogridall
LEFT JOIN priogrid ON priogridall.gid = priogrid.gid;

CREATE INDEX idx_priogrid_geom ON priogridall_geom USING GIST(centroid);
CREATE INDEX idx_priogrid_gid ON priogridall_geom USING btree(gid, gwcode,
col, row, area);
DROP TABLE IF EXISTS borddist;
CREATE TABLE borddist(gid int, gwcode int, gridyear int, borddist decimal,
primary key(gid, gridyear));

INSERT INTO borddist(gid, gwcode, gridyear, borddist) SELECT a.gid,
a.gwcode, 1946, MIN(ST_Distance(a.centroid, b.geom)) FROM priogridall_geom
a, cshapes b, cshapes c WHERE a.gwcode != b.gwcode AND b.gwsyear <= 1946 AND
b.gweyear >= 1946 AND a.gwcode = c.gwcode and ST_Intersects(b.geom, c.geom)
AND a.gridyear = 1946 GROUP BY a.gid, a.gwcode;
INSERT INTO borddist(gid, gwcode, gridyear, borddist) SELECT a.gid,
a.gwcode, 1947, MIN(ST_Distance(a.centroid, b.geom)) FROM priogridall_geom
a, cshapes b, cshapes c WHERE a.gwcode != b.gwcode AND b.gwsyear <= 1947 AND
b.gweyear >= 1947 AND a.gwcode = c.gwcode and ST_Intersects(b.geom, c.geom)
AND a.gridyear = 1947 GROUP BY a.gid, a.gwcode;
INSERT INTO borddist(gid, gwcode, gridyear, borddist) SELECT a.gid,
a.gwcode, 1948, MIN(ST_Distance(a.centroid, b.geom)) FROM priogridall_geom
a, cshapes b, cshapes c WHERE a.gwcode != b.gwcode AND b.gwsyear <= 1948 AND
b.gweyear >= 1948 AND a.gwcode = c.gwcode and ST_Intersects(b.geom, c.geom)
AND a.gridyear = 1948 GROUP BY a.gid, a.gwcode;
INSERT INTO borddist(gid, gwcode, gridyear, borddist) SELECT a.gid,
a.gwcode, 1949, MIN(ST_Distance(a.centroid, b.geom)) FROM priogridall_geom
a, cshapes b, cshapes c WHERE a.gwcode != b.gwcode AND b.gwsyear <= 1949 AND
b.gweyear >= 1949 AND a.gwcode = c.gwcode and ST_Intersects(b.geom, c.geom)
AND a.gridyear = 1949 GROUP BY a.gid, a.gwcode;
INSERT INTO borddist(gid, gwcode, gridyear, borddist) SELECT a.gid,
a.gwcode, 1950, MIN(ST_Distance(a.centroid, b.geom)) FROM priogridall_geom
a, cshapes b, cshapes c WHERE a.gwcode != b.gwcode AND b.gwsyear <= 1950 AND
b.gweyear >= 1950 AND a.gwcode = c.gwcode and ST_Intersects(b.geom, c.geom)
AND a.gridyear = 1950 GROUP BY a.gid, a.gwcode;
INSERT INTO borddist(gid, gwcode, gridyear, borddist) SELECT a.gid,
a.gwcode, 1951, MIN(ST_Distance(a.centroid, b.geom)) FROM priogridall_geom
a, cshapes b, cshapes c WHERE a.gwcode != b.gwcode AND b.gwsyear <= 1951 AND
b.gweyear >= 1951 AND a.gwcode = c.gwcode and ST_Intersects(b.geom, c.geom)
AND a.gridyear = 1951 GROUP BY a.gid, a.gwcode;
INSERT INTO borddist(gid, gwcode, gridyear, borddist) SELECT a.gid,
a.gwcode, 1952, MIN(ST_Distance(a.centroid, b.geom)) FROM priogridall_geom
a, cshapes b, cshapes c WHERE a.gwcode != b.gwcode AND b.gwsyear <= 1952 AND
b.gweyear >= 1952 AND a.gwcode = c.gwcode and ST_Intersects(b.geom, c.geom)
AND a.gridyear = 1952 GROUP BY a.gid, a.gwcode;
INSERT INTO borddist(gid, gwcode, gridyear, borddist) SELECT a.gid,
a.gwcode, 1953, MIN(ST_Distance(a.centroid, b.geom)) FROM priogridall_geom
a, cshapes b, cshapes c WHERE a.gwcode != b.gwcode AND b.gwsyear <= 1953 AND
b.gweyear >= 1953 AND a.gwcode = c.gwcode and ST_Intersects(b.geom, c.geom)
AND a.gridyear = 1953 GROUP BY a.gid, a.gwcode;
INSERT INTO borddist(gid, gwcode, gridyear, borddist) SELECT a.gid,
a.gwcode, 1954, MIN(ST_Distance(a.centroid, b.geom)) FROM priogridall_geom
a, cshapes b, cshapes c WHERE a.gwcode != b.gwcode AND b.gwsyear <= 1954 AND
b.gweyear >= 1954 AND a.gwcode = c.gwcode and ST_Intersects(b.geom, c.geom)
AND a.gridyear = 1954 GROUP BY a.gid, a.gwcode;
INSERT INTO borddist(gid, gwcode, gridyear, borddist) SELECT a.gid,
a.gwcode, 1955, MIN(ST_Distance(a.centroid, b.geom)) FROM priogridall_geom
a, cshapes b, cshapes c WHERE a.gwcode != b.gwcode AND b.gwsyear <= 1955 AND
b.gweyear >= 1955 AND a.gwcode = c.gwcode and ST_Intersects(b.geom, c.geom)
AND a.gridyear = 1955 GROUP BY a.gid, a.gwcode;
INSERT INTO borddist(gid, gwcode, gridyear, borddist) SELECT a.gid,
a.gwcode, 1956, MIN(ST_Distance(a.centroid, b.geom)) FROM priogridall_geom
a, cshapes b, cshapes c WHERE a.gwcode != b.gwcode AND b.gwsyear <= 1956 AND
b.gweyear >= 1956 AND a.gwcode = c.gwcode and ST_Intersects(b.