Re: [postgis-users] unioning a buffer - bug?

2010-09-13 Thread Kevin Neufeld

How are you determining you have no results?

Try:
CREATE TABLE results AS
SELECT st_union(st_buffer(the_geom,0.1)) as the_geom
FROM base.current_assessment_parcel;

SELECT count(*) FROM results;
SELECT ST_Summary(the_geom) FROM results;

Unioning a buffer shouldn't be problematic:

SELECT ST_AsText(
  ST_Union(
ST_Buffer(column1, 0.1)
  )
)
FROM (VALUES
  ('POLYGON((1 1, 1 2, 2 2, 1 1))'::geometry),
  ('POLYGON((1 1, 2 2, 2 1, 1 1))'::geometry)
) as v;

POLYGON ((
1 0.9,
0.980490967798387 0.901921471959677,
0.961731656763491 0.907612046748871,
0.96173165676349 0.907612046748872,
0.954928240996994 0.911248548238567,
0.9297669804 0.916853038769746,
0.929289321881345 0.929289321881345,
0.929289321881345 0.929289321881346,
0.916853038769745 0.9297669804,
0.90817310697871 0.960681986902375,
0.907612046748871 0.961731656763491,
0.901921471959677 0.980490967798388,
0.900377969797711 0.996162408242473,
0.9 1,
0.9 2,
0.901921471959677 2.01950903220161,
0.907612046748871 2.03826834323651,
0.916853038769745 2.0702330196,
0.929289321881345 2.07071067811865,
0.9297669804 2.08314696123025,
0.961731656763491 2.09238795325113,
0.980490967798387 2.09807852804032,
1 2.1,
2 2.1,
2.01950903220161 2.09807852804032,
2.03826834323651 2.09238795325113,
2.0702330196 2.08314696123025,
2.07071067811865 2.07071067811865,
2.08314696123025 2.0702330196,
2.09238795325113 2.03826834323651,
2.09807852804032 2.01950903220161,
2.1 2,
2.1 1,
2.09807852804032 0.980490967798387,
2.09238795325113 0.961731656763491,
2.08314696123025 0.9297669804,
2.07071067811865 0.929289321881345,
2.0702330196 0.916853038769745,
2.03826834323651 0.907612046748871,
2.01950903220161 0.901921471959677,
2 0.9,
1 0.9
))

-- Kevin

On 9/13/2010 7:07 AM, Lee wrote:

So after some googling I see similar problems, but no solutions posted.

I am trying to union a buffer, but the query is returning no results.  
Here is ultimately what I would like to achieve:


select st_union(st_buffer(the_geom,0.1)) as the_geom from 
base.current_assessment_parcel


Here are some troubleshooting steps I have taken to try narrow it down:

select st_isvalid(the_geom) a from base.current_assessment_parcel 
group by a

TRUE

select st_isvalid(st_buffer(the_geom,0.1)) a from 
base.current_assessment_parcel group by a

TRUE

select st_isvalid(st_union(the_geom)) from base.current_assessment_parcel
TRUE

select st_isvalid(st_union(st_buffer(the_geom,0.1))) from 
base.current_assessment_parcel
NOTICE:  TopologyException: found non-noded intersection between 
586714 4.95189e+006, 586714 4.95189e+006 and 586714 4.95189e+006, 
586739 4.9519e+006 586714 4.95189e+006

Total query runtime: 859 ms.
1 row retrieved.
(returns blank record)

 And just for fun
select st_isvalid(st_buffer(st_union(the_geom),0.1)) a from 
base.current_assessment_parcel

TRUE

I guess my next step would be to try the snap to grid functions, but 
the first query above should work, shouldn't it?


Any help appreciated. Thanks.
Lee


___
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] (no subject)

2010-09-13 Thread Rorie Overby
http://niyutona.tripod.com/
  ___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] AsSvg

2010-09-13 Thread Rick
On Mon, Sep 13, 2010 at 12:46 PM, Bob Pawley  wrote:

>  Rick - thanks for answering.
>
> I am in the process of learning a little XML.
>
> I understood that a query such as 'Select AsSvg(the_geom) from p_id.image'
> went to Postgis and the return (the geometry) comes back.
>
> I think you are saying that this is also in the xml path and xml interprets
> this expression differently than 'Select the_geom from p_id.image'
>

Not exactly.  You will need to understand the basics of an XML document, and
a little SVG before you can use this.

Here is a link to the SVG spec regarding paths, it will enlighten you on
what you need to sort out.

http://www.w3.org/TR/SVG/paths.html#PathElement

See the example in red fine type.  That is a valid SVG document with the
path element:

**

'd' is the attribute in the path that tells it how to draw, the value of the
d attribute is "M 100 100 L 300 100 L 200 300 " and this is what PostGIS
returns from the AsSvg() call.

That element draws a polyline from (M 100,100) to (300,100) to (200,300) and
closes it (z) fills it with red, strokes it in blue with a stroke width of 3
pixels. (px is the default)

You can use the fragment in the example to form your own documents and style
them.

Be aware that you can also use CSS to style SVG, should you happen to be
familiar with it.

Have fun.


> Bob
>
>
>  *From:* Rick 
> *Sent:* Monday, September 13, 2010 9:08 AM
> *To:* PostGIS Users Discussion 
> *Subject:* Re: [postgis-users] AsSvg
>
>
> Not sure what you are asking, but I'll take a stab in the dark.
>
> When you retrieve geometry as SVG what you get back is the contents of a
> path attribute node.
>
> So if an SVG path element is written  the result of the query
> is "X", or the value of the 'd' (data) attribute, not an XML element, and
> certainly not a valid SVG document.  You have to construct these yourself.
>
> On Mon, Sep 13, 2010 at 12:00 PM, Bob Pawley  wrote:
>
>>  Hi
>>
>> I may be on the wrong list but xml and Delphi guys that know Postgis seem
>> to be few and far between.
>>
>> I`m using the following to display the binary data on a memo component as
>> text.
>>
>>  PSQLQUery1.SQL.Add('Select the_geom from p_id.image');
>> PSQLQUery1.SQL.Add ('where p_id.image.p_id_id = ''1534''');
>> PSQLQUery1.Open;
>>
>> This works fine.
>>
>> When I change it to select AsSvg the xml consider assvg as another node
>> and the geometry data does not appear.
>>
>>  PSQLQUery1.SQL.Add('Select AsSvg(the_geom) from p_id.image');
>> PSQLQUery1.SQL.Add ('where p_id.image.p_id_id = ''1534''');
>> PSQLQUery1.Open;
>>
>> If any one can suggest a possible reason for this behavior It would be
>> appreciated.
>>
>> Bob
>>
>> ___
>> postgis-users mailing list
>> postgis-users@postgis.refractions.net
>> http://postgis.refractions.net/mailman/listinfo/postgis-users
>>
>>
>
>
> --
> Cheers!
> Rick
> Eeny, Meeny, Jelly Beanie, the spirits are about to speak!
> -- Bullwinkle Moose
>
>  --
>
> ___
> 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
>
>


-- 
Cheers!
Rick
Eeny, Meeny, Jelly Beanie, the spirits are about to speak!
-- Bullwinkle Moose
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] AsSvg

2010-09-13 Thread Bob Pawley
Rick - thanks for answering.

I am in the process of learning a little XML.

I understood that a query such as 'Select AsSvg(the_geom) from p_id.image' went 
to Postgis and the return (the geometry) comes back.

I think you are saying that this is also in the xml path and xml interprets 
this expression differently than 'Select the_geom from p_id.image'

Bob



From: Rick 
Sent: Monday, September 13, 2010 9:08 AM
To: PostGIS Users Discussion 
Subject: Re: [postgis-users] AsSvg



Not sure what you are asking, but I'll take a stab in the dark.

When you retrieve geometry as SVG what you get back is the contents of a path 
attribute node.

So if an SVG path element is written  the result of the query is 
"X", or the value of the 'd' (data) attribute, not an XML element, and 
certainly not a valid SVG document.  You have to construct these yourself.


On Mon, Sep 13, 2010 at 12:00 PM, Bob Pawley  wrote:

  Hi

  I may be on the wrong list but xml and Delphi guys that know Postgis seem to 
be few and far between.

  I`m using the following to display the binary data on a memo component as 
text.

   PSQLQUery1.SQL.Add('Select the_geom from p_id.image');
  PSQLQUery1.SQL.Add ('where p_id.image.p_id_id = ''1534''');
  PSQLQUery1.Open;

  This works fine.

  When I change it to select AsSvg the xml consider assvg as another node and 
the geometry data does not appear.

   PSQLQUery1.SQL.Add('Select AsSvg(the_geom) from p_id.image');
  PSQLQUery1.SQL.Add ('where p_id.image.p_id_id = ''1534''');
  PSQLQUery1.Open;

  If any one can suggest a possible reason for this behavior It would be 
appreciated. 

  Bob

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





-- 
Cheers!
Rick
Eeny, Meeny, Jelly Beanie, the spirits are about to speak!
-- Bullwinkle Moose







___
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] Size of .dbf file produced with pgsql2shp

2010-09-13 Thread Mark Cave-Ayland

Denis Rykov wrote:


Mark, thanks for quick response, I've try to do it with bash:

[...@gis ~/gl/projects/osmrus]$ pgsql2shp -u pgsql -f dagestan.shp osm 
"SELECT st_intersection as geom from dagestan_point_attr WHERE 
highway='bus_stop'"

Initializing...
ERROR: Could not determine table metadata (empty table)
[...@gis ~/gl/projects/osmrus]$ echo $?
1

But you wrote that

exit code of 0 on success, and 2 
if 0 records were processed


Why I get 1, but not 2?


Yes, the return code of 2 was from an old email - I reworked it based 
upon strk's suggestion that trying to dump an empty table is actually an 
ERROR, so now it returns 1. This is because without any geometries 
present in the table, we are unable to generate the basic table metadata.


Note that the ERROR text is sent to stderr so you can capture it from 
there if you need to pass the information back to the user (or to a 
logfile).



HTH,

Mark.

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

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


Re: [postgis-users] Size of .dbf file produced with pgsql2shp

2010-09-13 Thread Denis Rykov
Mark, thanks for quick response, I've try to do it with bash:

[...@gis ~/gl/projects/osmrus]$ pgsql2shp -u pgsql -f dagestan.shp osm
"SELECT st_intersection as geom from dagestan_point_attr WHERE
highway='bus_stop'"
Initializing...
ERROR: Could not determine table metadata (empty table)
[...@gis ~/gl/projects/osmrus]$ echo $?
1

But you wrote that

> exit code of 0 on success, and 2
> if 0 records were processed
>
> Why I get 1, but not 2?
On Mon, Sep 13, 2010 at 11:06 PM, Mark Cave-Ayland <
mark.cave-ayl...@siriusit.co.uk> wrote:

> Denis Rykov wrote:
>
>  I've try to get exit code with my python script:
>>
>>import os
>>code = os.system("pgsql2shp -f dagestan.shp -h gis-lab.info
>> -u labinfo -P *** osm \"SELECT
>>
>   ^^
>
>>st_intersection as geom from dagestan_point_attr WHERE
>>highway='bus_stop'")
>>print code
>>
>> At result I've got 256 (not 2 as expected).
>>
>
> H looks like you're missing an escaped quote somewhere? If your "svn
> up" worked, the exit code should be either 0 or 1. To test from bash:
>
> pgsql2shp -f dagestan.shp  "SELECT st_intersection as geom from
> dagestan_point_attr WHERE highway='bus_stop'"
> echo $?
>
>
> HTH,
>
>
> Mark.
>
> --
> Mark Cave-Ayland - Senior Technical Architect
> PostgreSQL - PostGIS
> Sirius Corporation plc - control through freedom
> http://www.siriusit.co.uk
> t: +44 870 608 0063
>
> Sirius Labs: http://www.siriusit.co.uk/labs
> ___
> postgis-users mailing list
> postgis-users@postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] AsSvg

2010-09-13 Thread Rick
Not sure what you are asking, but I'll take a stab in the dark.

When you retrieve geometry as SVG what you get back is the contents of a
path attribute node.

So if an SVG path element is written  the result of the query
is "X", or the value of the 'd' (data) attribute, not an XML element, and
certainly not a valid SVG document.  You have to construct these yourself.

On Mon, Sep 13, 2010 at 12:00 PM, Bob Pawley  wrote:

>  Hi
>
> I may be on the wrong list but xml and Delphi guys that know Postgis seem
> to be few and far between.
>
> I`m using the following to display the binary data on a memo component as
> text.
>
>  PSQLQUery1.SQL.Add('Select the_geom from p_id.image');
> PSQLQUery1.SQL.Add ('where p_id.image.p_id_id = ''1534''');
> PSQLQUery1.Open;
>
> This works fine.
>
> When I change it to select AsSvg the xml consider assvg as another node and
> the geometry data does not appear.
>
>  PSQLQUery1.SQL.Add('Select AsSvg(the_geom) from p_id.image');
> PSQLQUery1.SQL.Add ('where p_id.image.p_id_id = ''1534''');
> PSQLQUery1.Open;
>
> If any one can suggest a possible reason for this behavior It would be
> appreciated.
>
> Bob
>
> ___
> postgis-users mailing list
> postgis-users@postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
>


-- 
Cheers!
Rick
Eeny, Meeny, Jelly Beanie, the spirits are about to speak!
-- Bullwinkle Moose
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] Size of .dbf file produced with pgsql2shp

2010-09-13 Thread Mark Cave-Ayland

Denis Rykov wrote:


I've try to get exit code with my python script:

import os
code = os.system("pgsql2shp -f dagestan.shp -h gis-lab.info
 -u labinfo -P *** osm \"SELECT

   ^^

st_intersection as geom from dagestan_point_attr WHERE
highway='bus_stop'")
print code

At result I've got 256 (not 2 as expected).


H looks like you're missing an escaped quote somewhere? If your "svn 
up" worked, the exit code should be either 0 or 1. To test from bash:


pgsql2shp -f dagestan.shp  "SELECT st_intersection as geom from 
dagestan_point_attr WHERE highway='bus_stop'"

echo $?


HTH,

Mark.

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

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


[postgis-users] AsSvg

2010-09-13 Thread Bob Pawley
Hi

I may be on the wrong list but xml and Delphi guys that know Postgis seem to be 
few and far between.

I`m using the following to display the binary data on a memo component as text.

 PSQLQUery1.SQL.Add('Select the_geom from p_id.image');
PSQLQUery1.SQL.Add ('where p_id.image.p_id_id = ''1534''');
PSQLQUery1.Open;

This works fine.

When I change it to select AsSvg the xml consider assvg as another node and the 
geometry data does not appear.

 PSQLQUery1.SQL.Add('Select AsSvg(the_geom) from p_id.image');
PSQLQUery1.SQL.Add ('where p_id.image.p_id_id = ''1534''');
PSQLQUery1.Open;

If any one can suggest a possible reason for this behavior It would be 
appreciated. 

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


Re: [postgis-users] Size of .dbf file produced with pgsql2shp

2010-09-13 Thread Denis Rykov
I've try to get exit code with my python script:

> import os
> code = os.system("pgsql2shp -f dagestan.shp -h gis-lab.info -u labinfo -P
> *** osm \"SELECT st_intersection as geom from dagestan_point_attr WHERE
> highway='bus_stop'")
> print code
>
At result I've got 256 (not 2 as expected).
On Thu, Sep 2, 2010 at 12:41 AM, Mark Cave-Ayland <
mark.cave-ayl...@siriusit.co.uk> wrote:

> Denis Rykov wrote:
>
>  It would be great if you can add an exit code for 0 records dbfs,
>> it'll make my life so much easier.
>>
>
> Okay done - it was quite a simple patch in the end. Can you update to SVN
> r5888 and confirm that you get an exit code of 0 on success, and 2 if 0
> records were processed?
>
>
>
> ATB,
>
> Mark.
>
> --
> Mark Cave-Ayland - Senior Technical Architect
> PostgreSQL - PostGIS
> Sirius Corporation plc - control through freedom
> http://www.siriusit.co.uk
> t: +44 870 608 0063
>
> Sirius Labs: http://www.siriusit.co.uk/labs
> ___
> postgis-users mailing list
> postgis-users@postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] unioning a buffer - bug?

2010-09-13 Thread Lee
Forgot to mention, I have tried this on a couple other polygon and polyline 
tables with similar results.

 






From: Lee 
To: postgis mailing list 
Sent: Mon, September 13, 2010 10:07:06 AM
Subject: [postgis-users] unioning a buffer - bug?


So after some googling I see similar problems, but no solutions posted.

I am trying to union a buffer, but the query is returning no results.  Here is 
ultimately what I would like to achieve:

select st_union(st_buffer(the_geom,0.1)) as the_geom from 
base.current_assessment_parcel

Here are some troubleshooting steps I have taken to try narrow it down:

select st_isvalid(the_geom) a from base.current_assessment_parcel group by a
TRUE

select st_isvalid(st_buffer(the_geom,0.1)) a from 
base.current_assessment_parcel 
group by a
TRUE

select st_isvalid(st_union(the_geom)) from base.current_assessment_parcel
TRUE

select st_isvalid(st_union(st_buffer(the_geom,0.1))) from 
base.current_assessment_parcel
NOTICE:  TopologyException: found non-noded intersection between 586714 
4.95189e+006, 586714 4.95189e+006 and 586714 4.95189e+006, 586739 4.9519e+006 
586714 4.95189e+006
Total query runtime: 859 ms.
1 row retrieved.
(returns blank record)


 And just for fun
select st_isvalid(st_buffer(st_union(the_geom),0.1)) a from 
base.current_assessment_parcel
TRUE


I guess my next step would be to try the snap to grid functions, but the first 
query above should work, shouldn't it?

Any help appreciated. Thanks.
Lee
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


[postgis-users] unioning a buffer - bug?

2010-09-13 Thread Lee
So after some googling I see similar problems, but no solutions posted.

I am trying to union a buffer, but the query is returning no results.  Here is 
ultimately what I would like to achieve:

select st_union(st_buffer(the_geom,0.1)) as the_geom from 
base.current_assessment_parcel

Here are some troubleshooting steps I have taken to try narrow it down:

select st_isvalid(the_geom) a from base.current_assessment_parcel group by a
TRUE

select st_isvalid(st_buffer(the_geom,0.1)) a from 
base.current_assessment_parcel 
group by a
TRUE

select st_isvalid(st_union(the_geom)) from base.current_assessment_parcel
TRUE

select st_isvalid(st_union(st_buffer(the_geom,0.1))) from 
base.current_assessment_parcel
NOTICE:  TopologyException: found non-noded intersection between 586714 
4.95189e+006, 586714 4.95189e+006 and 586714 4.95189e+006, 586739 4.9519e+006 
586714 4.95189e+006
Total query runtime: 859 ms.
1 row retrieved.
(returns blank record)


 And just for fun
select st_isvalid(st_buffer(st_union(the_geom),0.1)) a from 
base.current_assessment_parcel
TRUE


I guess my next step would be to try the snap to grid functions, but the first 
query above should work, shouldn't it?

Any help appreciated. Thanks.
Lee
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] pgsql2shp revision

2010-09-13 Thread Mark Cave-Ayland

strk wrote:

Perhaps we could "touch" the pgsql2shp-core.h file but that just seems 
messy :(


Why drop the feature ?
If we want a "true" repository revision we should provide
that in an header file (which we'd touch) and use that when
we see fit. I wouldn't drop the file-specific one though,
you can always get a diff from current to the specific one
w/out querying the server (right? or time to move to git :).


Yeah; out of all the options I'd prefer to keep the standard 
svn:keywords tag and touch the file when appropriate (maybe as part of 
the release process?). It's not a great solution, but probably the least 
worse out of all the alternatives.



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] help on converting points to polygon.

2010-09-13 Thread Nathan Gerber
Your table is setup to accept only MULTIPOLYGONs. Either adjust your table
constraint to allow regular polygons or convert your polygon to a
MULTIPOLYGON.
--
Nathan Gerber


On Mon, Sep 13, 2010 at 6:56 AM, Nicholas I wrote:

> Hi,
>
>  I want to create a polygon from the given points and clip the area's
> within the polygon.
>
> I just tried with the below one to create a polygon,
>
> \d test_polygon;
>   Table "public.test_polygon"
>   Column  |  Type  |
> Modifiers
>
> --++
>  gid  | integer| not null default
> nextval('test_polygon_gid_seq'::regclass)
>  name | character varying(254) |
>  the_geom | geometry   |
> Indexes:
> "test_polygon_pkey" PRIMARY KEY, btree (gid)
> Check constraints:
> "enforce_dims_the_geom" CHECK (st_ndims(the_geom) = 2)
> "enforce_geotype_the_geom" CHECK (geometrytype(the_geom) =
> 'MULTIPOLYGON'::text OR the_geom IS NULL)
> "enforce_srid_the_geom" CHECK (st_srid(the_geom) = 4326)
>
> *INSERT INTO test_polygon VALUES (3,'test',PolyFromText('POLYGON((78.76708
> 14.04584,81.54662 14.04584,78.78906 11.25531,81.53564 11.25531,78.76708
> 14.04584))'));
> *
> i get a message saying,
>
> INSERT INTO test_polygon VALUES (3,'test',PolyFromText('POLYGON((78.76708
> 14.04584,81.54662 14.04584,78.78906 11.25531,81.53564 11.25531,78.76708
> 14.04584))'));
> *ERROR:  new row for relation "test_polygon" violates check constraint
> "enforce_geotype_the_geom"*
>
> *Can anyone help me how do i form a polygon with these points.*
>
> Thank you
> -Nicholas I
>
>
> ___
> 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] help on converting points to polygon.

2010-09-13 Thread Nicholas I
Hi,

 I want to create a polygon from the given points and clip the area's within
the polygon.

I just tried with the below one to create a polygon,

\d test_polygon;
  Table "public.test_polygon"
  Column  |  Type  |
Modifiers
--++
 gid  | integer| not null default
nextval('test_polygon_gid_seq'::regclass)
 name | character varying(254) |
 the_geom | geometry   |
Indexes:
"test_polygon_pkey" PRIMARY KEY, btree (gid)
Check constraints:
"enforce_dims_the_geom" CHECK (st_ndims(the_geom) = 2)
"enforce_geotype_the_geom" CHECK (geometrytype(the_geom) =
'MULTIPOLYGON'::text OR the_geom IS NULL)
"enforce_srid_the_geom" CHECK (st_srid(the_geom) = 4326)

*INSERT INTO test_polygon VALUES (3,'test',PolyFromText('POLYGON((78.76708
14.04584,81.54662 14.04584,78.78906 11.25531,81.53564 11.25531,78.76708
14.04584))'));
*
i get a message saying,

INSERT INTO test_polygon VALUES (3,'test',PolyFromText('POLYGON((78.76708
14.04584,81.54662 14.04584,78.78906 11.25531,81.53564 11.25531,78.76708
14.04584))'));
*ERROR:  new row for relation "test_polygon" violates check constraint
"enforce_geotype_the_geom"*

*Can anyone help me how do i form a polygon with these points.*

Thank you
-Nicholas I
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


[postgis-users] sum dot product of outward normal vectors of polygon segments to given direction

2010-09-13 Thread Henri De Feraudy
Hello, I'm trying to calculate how much a polygon "points" in a given 
direction. 
This is to calculate how much light would come from a given light source.
This means that for each segment of its outer ring I want to calculate the 
scalar (dot) product of
outward normal vector (whose magnitude is the segment's length) and the given 
vector.

One idea is to rotate the polygon, and the given vector simultaneously so that 
the given vector is vertical and
then calculate the width of the bounding box.

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


Re: [postgis-users] Windows binaries available for PostGIS 2.0, WKT Raster for PostgreSQL 8.4, 9.0

2010-09-13 Thread Andrea Peri
>For those who are interested we have 32-bit binaries available for Windows
>for the PostGIS 2.0 trunk version
>>http://www.postgis.org/download/windows/experimental.php 
>>
>
>The packages are for PostgreSQL 8.4 and 9.0 and include the following

Hi,

I'm really interested to test the Postgis 2.0.0 under windows.
I use a Win7 - 64 bit with Postgres 8.4.4 (32 bit) and postgis 1.5.1
(32 bit) installed on it.

But I need to leave unchanged my postgis 1.5.1, and I don't know if
(and how) is possible to
install the postgis 2.0.0 from your exe without damage the 1.5.1
version available in the same postgres.

Perhaps this is a easy question, but because I never set two distinct
postgis version on the same postgres db.
I'm not sure how to do this.

Thx,

-- 
-
Andrea Peri
. . . . . . . . .
qwerty àèìòù
-
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users