5

I dont't have any experience with the geographics databases so I hope that you be patiente with me, the thing is: I know that the datatype geography is used if all you care about is measuring distances and lengths and you have data from all over the world and the datatype geometry is used is best if you are pretty comfortable with spatial reference systems or you are dealing with localized data where all your data fits in a single spatial reference system (SRID), or you need to do a lot of spatial processing (that's what I read in chapter 3 of the documentation of postgis) and I saw on the link https://www.tutorialspoint.com/postgresql/postgresql_data_types.htm the following datatypes: point, line, lseg, box, path, path, polygon and circle. And then I saw the documentation again of the postgis on the section 4.1.3 SQL-MM Part 3 about the following types with the extension well-know text: circularString, compoundCurve, curvePolygon, multiCurve, multiSurface. What I don't understand is: what is the difference between these datatypes?

EDIT: And what is the relation between the datatypes that I saw in the section 4.1.3 and the datatypes that I saw in https://www.tutorialspoint.com/postgresql/postgresql_data_types.htm

  • knee-jerk response here...but it sounds like you've got the geography/geometry types backwards. The geometry type is definitely better-suited for situations requiring a lot of Cartesian operations (i.e. geometry intersections, line/area measures). – elrobis Feb 8 '17 at 16:48
6

The types geometry and geography are PostGIS data types, whereas point, line, path, etc. are native PostgreSQL data types. The native types offer very little functionality compared to the PostGIS types, and have relatively poor support by client applications. On the other hand, the native storage types use less storage space and may be faster for the few operations that they support.

Unlike the native PostgreSQL types, the PostGIS geometry and geography types are not limited to holding a single shape. Any of the following shapes can be stored in a PostGIS geometry or geography:

  • Point
  • LineString
  • Polygon
  • MultiPoint
  • MultiLineString
  • MultiPolygon
  • GeometryCollection
  • CircularString
  • CompoundCurve
  • CurvePolygon
  • MultiCurvePolygon
  • MultiSurface
  • PolyhedralSurface
  • Triangle
  • TIN
  • Oh thanks man, you helped a lot, but what "things" I can represent with the datatypes geometry and geography, for example: LineString, GeomCollection, CircularString and so on. – singleMan Feb 8 '17 at 17:27
  • This is exactly what I want, could you please tell me where did you find this list, so I can study more about the subject. – singleMan Feb 8 '17 at 19:13
  • @singleMan I pulled it from this link but I'd imagine it's in the docs somewhere. – dbaston Feb 8 '17 at 19:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.