Saturday 20 June 2015

PostGIS Update parse error – invalid geometry


I’m trying to update geometry table using the following command but get


parse error – invalid geometry HINT: “MULTIPOINT(“ <-- parse error at position 11 within geometry


Update geo_table
Set geom =ST_ConvexHull(
ST_GeomFromText('MULTIPOINT(co_ord_string)', 4326));
WHERE
Id =1234;

originally I created this data with a perl script something like



 insert into geo_table (stuff,date, co_ord_string,geom) values (‘Hello’,’02-07-2018 00:00:00’, T_ConvexHull(ST_GeomFromText('MULTIPOINT($co_ord_string)', 4326));

The co_ord_string is a series of long lat points separated by a comma. These don’t create perfect polygons as they may contain internal points but using ST_ConvexHull a polygon is created


only by viewing the data in Qgis I can see there are errors in the original coordinates that need manually editing (Missing minus signs some points or other issues ) and the geometry recreating


Could someone help with the syntex




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...