[postgis-users] PostgreSQL geometric data types vs GEOMETRY data type

Baris Ergun barisergun75 at gmail.com
Thu Jan 2 13:50:18 PST 2014


Until today the usual way I create Geometry columns was to specify it as
Geometry(point), Geometry(polygon) etc... and Geometry maybe for generic
geometry type. I have never tried to create the data type as point.

Now if u look spatial functions supported by postgis. You will see they use
arguments as geometry, geography, raster... etc. But not point or polygon.
Thus ur spatial postgis methods will fail with point type. You can still
declare a geometry column with specific point type as
Geometry(point,<srid>) as I stated above.

So why is point, polygon type there? That might be some legacy stuff which
might be deprecated. I hope somebody enlighten us about this? As this is
something I noticed right now regarding ur thread.


On 2 January 2014 23:04, Peter Len <peteralen at earthlink.net> wrote:

> Thanks Baris.... here are the two table definitions:
>
> -- Using default PostgreSQL geometric types
> create table gis.cities (
>    id serial primary key,
>    name varchar(50),
>    state varchar(2),
>    geom point
> );
>
> -- Using PostGIS geometry types
> create table gis.table_pt (
>    id serial primary key,
>    name varchar(50),
>    state varchar(2),
>    geom geometry(Point)
> );
>
>
> The select query below only worked when run against the PostGIS geometry
> type:
>
> SELECT id, name FROM gis.table_pt WHERE ST_DWithin(
>   geom,
>   ST_GeomFromText('POINT(0 0)', 26910),
>   1000
> );
>
>
>
>
>
> --
> View this message in context:
> http://postgis.17.x6.nabble.com/PostgreSQL-geometric-data-types-vs-GEOMETRY-data-type-tp5005378p5005381.html
> Sent from the PostGIS - User mailing list archive at Nabble.com.
> _______________________________________________
> postgis-users mailing list
> postgis-users at lists.osgeo.org
> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
>



-- 
Barış
www.linkedin.com/in/barisergun
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20140102/d9163f16/attachment.html>


More information about the postgis-users mailing list