[postgis] Error in creating WKBPolygon by Postgis in Cygwin PostgreSQL

Paul Ramsey pramsey at refractions.net
Wed Aug 15 09:04:36 PDT 2001


> I've got the following errors for.Error in creating WKBPolygon from
> WKTMultiPolygon, created by shp2pgml,  by PostGis 0.5.1 in Cygwin 
> PostgreSQL 7.1.2 on WinNT Server 4.0 SP6a (Memory 256MBytes).

> #create table ku2 as select * from ku;
> #alter table ku2 add column geo2_val wkb;
> # update ku2 set geo2_val = asbinary(geo_value,'NDR');

OK, the first thing to remember is that our internal storage format is
not WKB, it is 'geometry' :)
WKB is a standard external representation, so is WKT. So your update
command should look like this:

  # update ku2 set geo2_val = geo_value;

That will make the second column be identical to the first. There is no
point in trying to change the endianness of the stored features: they
will always be stored in the endianness of the underlying server
platform. If you want a different endianness for your WKB, specify it
when *extracting* them, not when storing them.

> And I also have troubles in creating WKBPoint from WKTPolygon. No error
> message, but created WKB contained only 0x010180s (01 = little endian, 01 =
> WKBPoint, 80=?).

I'm not sure what you're trying to do here... but as an example, you
should be able to do

select AsBinary(PointN('POLYGON(0 0,1 0,1 1,0 1,0 0)'::geometry,1));

That would turn a text string into a postgis geometry object, turn the
polygon geometry into a point, then return the binary representation of
that point.

------------------------ Yahoo! Groups Sponsor ---------------------~-->
The Nissan Sentra
Everything but compact
http://NissanDriven.com
http://us.click.yahoo.com/3vsIKC/txlCAA/ySSFAA/PhFolB/TM
---------------------------------------------------------------------~->

To unsubscribe from this group, send an email to:
postgis-unsubscribe at yahoogroups.com

 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 





More information about the postgis-users mailing list