2

I have downloaded the latest spatialite-gui v.1.4.0. (spatialite version 2.4.0.) When I try to correct invalid geometries and I use the following string (that I use to use with the past version):

UPDATE com2011 SET geometry = ST_MakeValid(geometry) WHERE ST_IsValid(geometry) = 0;

This string does not work at all! It seems that ST_MakeValid(geometry) is a command that is not working anymore!

How can I remedy this problem or can you tell me the new string?

  • 1
    ST_IsValid(geometry) returns boolean, not a number. should be ST_IsValid(geometry) = 'f' – Sharon Ben Asher Dec 14 '16 at 14:40
  • How does the "string not work at all"? Please edit the question and include what error you are getting or what the result is. – kttii Dec 14 '16 at 14:46
  • @sharonbn, ST_IsValid is documented to return -1, 0, or 1 in gaia-gis.it/gaia-sins/spatialite-sql-latest.html. – user30184 Dec 14 '16 at 15:05
  • for ktti the error signal is: SQL ERROR: unrecognized error “ɕ” – Fabio Dec 15 '16 at 22:56
1

You can do a controlled test for checking if ST_MakeValid is working or not. For example with this polygon that has a self-intersection:

SELECT ST_AsText(
ST_MakeValid(
ST_GeomFromText('POLYGON (( 300 580, 480 580, 300 400, 460 400, 300 580 ))')));

The result should be a multipolygon

MULTIPOLYGON(((384.705882 484.705882, 460 400, 300 400, 384.705882 484.705882)), ((300 580, 480 580, 384.705882 484.705882, 300 580)))
| improve this answer | |

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.