Monday, 21 January 2019

postgresql - Multipoint vs point PostGIS


Is it normal to use the geometry type 'multipoint' instead of 'point' knowing that I use it to store only one point?


How can I convert from multipoint to point?



Answer



To convert "Multipoint" to "Point", you have to use ST_Dump, for example:


SELECT (ST_Dump(the_geom)).geom AS the_POINT_geom
FROM MULTIPOINT_table;


On the question of using "Multi" or single geometries, I use this logic:



  • if every geometry has different attributes -> Single

  • if a group of geometries have same attributes -> "Multi"


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...