I have table1 with columns of segment_id, xcoordinate, ycoordinate and I have another table with the columns of segment_id, geometry, wktgeometry. those two tables coming from a SQL databases, My geometries are in char format, my first table contains null values for some values of segment_id. I want to search xcoordinate and ycoordinate inside second table's geometry column to find my missing segment_id in the first table.
How can i achieve this?
I had tried following query but getting error,
Code:
segment_id xcoor ycoor 406 28.66968 41.0059921 416 22.66968 41.3059921 426 28.66968 41.7159921 . 31.66968 39.7159921 segment_id, geometry 426 LINESTRING (28.909554 41.027676, 25.909642 41.3276522, 28.911091 41.02725, 28.9128588 41.0269018, 28.912888 41.026896, 28.912951 41.026884, 28.9129567 41.0268827, 28.91296 41.026882) 466 LINESTRING (28.909554 41.027676, 28.909642 41.0276522, 28.911091 41,31221) proc sql;
create table fixed_geoms as
select a.*, b.wktgeometry, b.segment_id
from table1 as a
left join table2 as b
on b.segment_id = a.segment_id
where contains(b.wktgeometry, point(a.xcoordinate, a.ycoordinate));
quit;
The error I faced:
ERROR: Function CONTAINS could not be located.
NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.
89 quit;
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE SQL used (Total process time):
real time 1.39 seconds
cpu time 0.03 seconds
90
91
92 %studio_hide_wrapper;
103
104
... View more