Hello. I think this question is really just a general ‘how to write an update query’ question rather than being specific to Spatialite but I would like some advice on how to debug it.
I have a table of polygons in spt_PPolygons representing countries but some of these polygons extend into the sea a bit.
So I want to find the intersection with land polygons in spt_LandPolygons which follow the coastline precisely.
So I wrote:
<U P D A T > E spt_polygons
SET p.polygon = ST_Intersection( p.polygon, l.lpolygon )
FROM spt_Polygons AS p
JOIN spt_LandPolygons AS l
WHERE ST_Contains( l.lpolygon, ST_Centroid( p.polygon ) );
[put the first bit in a funny way to stop Google blocking the email]
But the Spatialite CLI just gives me “Syntax error near ‘.’”.
How can I get richer information on what the error is through the CLI?
And is my approach correct for what I want to do?
Best, Chris
I wrote:
There are 778,000 land polygons and 1400 plain polygons. So is my join statement not specific enough?
Think I need to add a filter in my where clause to exclude polygons that don’t overlap and use the spatial index to do this.
Best, Chris