Hi,

I am trying to find a way to retrieve the geography type of a Postgis
column in Perl.

Using these statements:

my $datatype   = $sth->{'TYPE'}->[$i];
my @type_info  = $dbh->type_info([$datatype]);
my $dtype_name = $type_info[0]->{'TYPE_NAME'};

The content of $dtype_name is 'unknown' which is not surprising.

In psql client, executing \d command gives me something like:

\d contactloc
              Table "public.contactloc"
     Column      |         Type          | Modifiers
-----------------+-----------------------+-----------
 contactid       | integer               | not null
 contactlocation | geography(Point,4326) | not null
Indexes:
    "contactloc_pkey" PRIMARY KEY, btree (contactid)
    "contactlocation_sp_index" gist (contactlocation)

Is there any way to check whether a geography column a point or a polygon?

Regards,
Puthick
_______________________________________________
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users

Reply via email to